Closed bobbingwide closed 7 years ago
Sample output with: WordPress 4.7.5, PHPUnit 6.2.0, PHP 7.1.1 and wordpress-develop-tests v4.8
C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch>phpunit
Searching for wp-config.php in directories leading to: C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch
Found wp-config.php in: C:\apache\htdocs/
Found wp-config.php in: C:\apache\htdocs\wordpress/
Domain: localhost
cli
End cli:oik_batch_loaded
cli
oik-wp running WordPress 4.7.5
C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch
cli
Warning: potentially incompatible versions: WordPress: 4.7.5, wordpress-develop-tests: 4.8
Using wordpress-develop-tests plugin
There you go: C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\tests\test-phpunit.php
PHPUnit 6.2.0 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.1
Configuration: C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\phpunit.xml
.......... 10 / 10 (100%)
Time: 8.29 seconds, Memory: 22.00MB
OK (10 tests, 14 assertions)
<!--PHP version:7.1.1
--><!--PHP functions:1297
--><!--User functions:4400
--><!--Classes:1160
--><!--Plugins:57
--><!--Files:1114
--><!--Registered widgets:28
--><!--Post types:48
--><!--Taxonomies:31
--><!--Queries:160
--><!--Query time:0.68729496002197
--><!--Trace file:C:/apache/htdocs/wordpress/bwtraces.loh
--><!--Trace records:52
--><!--Remote addr:
--><!--Elapsed (secs):7.844171
-->
For WordPress 4.8, the PHPUnit test code has been changed to be compatible with both PHPUnit 5.7 and PHPUnit 6.
https://core.trac.wordpress.org/ticket/39822
Requirement
Proposed solution