These files and folders for developers who want to run WordPress plugin unit tests on Windows but cannot install it using bash.
- Download and extract everything inside tmp folder into your PHP CLI temp folder location.
For Windows, use this command to find out.php -i | findstr temp
.
For Linux, use this command to find out.php -i | grep temp
. - Follow instructions on 3 README.md files.
- Follow the Generate the plugin test files instruction on thispage. Do not go to other step and no need to run bash. OR...
- Download the demo plugin test from this link.
- Create your plugin main file with required header to prevent error.
- If the error occurs and it is related to PHP opcache, please restart your computer.
- Run
phpunit
command.
If no error occur then congratulations! You are ready to start plugin development.
These files and folders are copied after I run the command on Windows sub system Ubuntu.
All the credits are for these pages:
- https://make.wordpress.org/cli/handbook/plugin-unit-tests/ - WordPress official tutorial.
- https://www.chanhvuong.com/3368/install-subversion-on-ubuntu-wsl-on-windows-10/ Install SVN on Ubuntu.
- https://askubuntu.com/questions/223012/how-can-i-install-mysql-client-on-10-04 Install MySQL client on Ubuntu.