I have wordpress project running on my local. I use docker.
I install phpunit using composer require phpunit/phpunit command. (Version is 8.5)
Then I use scaffold command to create plugin test files.
docker-compose exec wp my-project-name wp scaffold plugin-tests sample-plugin (I have all files)
Then I run following command but it didn’t create tmp/ directory in my project. Instead it made directory here: C:UsersUnknownAppDataLocalTemp.
bin/install-wp-tests.sh wordpress_my root ‘mypassword’ localhost latest
Now when I run following command, it gives following error.
vendor/bin/phpunit –bootstrap ./vendor/autoload.php wp-content/plugins/sample-plugin/tests/test-sample.php
Fatal error: Uncaught Error: Class ‘WP_UnitTestCase’ not found in C:gitmy-projectwp-contentpluginssample-pluginteststest-sample.php:11
I also followed first 4 steps from https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/ but no luck.
Please help me!