Problems setting up phpunit integration test in Local Lightning on windows 10

Hi, all –

I followed this awesome tut on my Windows 10 laptop recently (mid-Sept 2020), with a few adjustments, and I’m able to run phpunit on Local Lighting.

I created an empty database in my test site using these helpful instructions from Clay:

Adminer may look a little different now. I also added a user with all privileges and used that user’s info in wp_tests_config. You could probably also just use the default root user.

I used cmder for my terminal. That’s what I typically use and like.

Step 8, changing the site URL to have /build at the end, I did manually in the db.

Step 9a: I set up wp_tests_config manually.
Step 9b: I think I had issues with this. But it’s not a deal breaker.
Step 9c: I had already had phpunit installed globally on my machine (following phpunit instructions, linked to from WordPress’s docs, I believe – https://phpunit.readthedocs.io/en/latest/installation.html#windows). I understand it’s a best practice to install it for each project. If the command in 9c doesn’t work for you as is, phpunit’s instructions could be the way to go.

I set a different database prefix for wp_tests_config and wp_config.

I’m sure this can be tweaked and improved. You may want to try a completely different approach. The good news is that it is possible to get phpunit working on Local Lightning on Windows 10.

Note: I’ve had issues when trying to upgrade Local Lightning on Windows, so I’m using an earlier version.