You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've set up the plugin test using scaffold in WP-CLI. In my plugin the plugin structure is
my-plugin/
|
- bin
install-wp-tests.sh
|
- tests
bootstrap.php
...
I've installed everyting I need with Composer.
The install script installs the test WordPress in some temporary folder on my Mac /var/folders/xj/asdq3e232ad.../T/wordpress
When I run the tests without adding the WP_Mock in my bootstrap the phpunit works fine. But when I add
// First we need to load the composer autoloader so we can use WP Mockrequire_oncedirname( dirname( __FILE__ ) ) . '/vendor/autoload.php';
// Now call the bootstrap method of WP Mock
\WP_Mock::bootstrap();
WP_Mock is incompatible with the core test framework (what you get when you scaffold a plugin). #49 is currently open requesting the ability to use both in the same test suite, but the conclusion seems to be that you need separate test suites to make it work. #114 is also under discussion, which would get around the problem by at least making it easier to get a plugin set up correctly with WP_Mock instead of the WP core framework.
I've set up the plugin test using scaffold in WP-CLI. In my plugin the plugin structure is
I've installed everyting I need with Composer.
The install script installs the test WordPress in some temporary folder on my Mac
/var/folders/xj/asdq3e232ad.../T/wordpress
When I run the tests without adding the
WP_Mock
in my bootstrap thephpunit
works fine. But when I addI get an error
For local environment I'm using VVV.
I'm unsure how is VVV affecting the unit tests. Should I remove
wordpress-develop
from it and it should work?EDIT:
Deleted the
wordpress-develop
and when runningbash bin/install-wp-tests.sh wordpress_test root '' localhost latest
and then running
phpunit
I still get the same error.The text was updated successfully, but these errors were encountered: