Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHPUnit 6 #22

Closed
bobbingwide opened this issue Jun 2, 2017 · 1 comment
Closed

Support PHPUnit 6 #22

bobbingwide opened this issue Jun 2, 2017 · 1 comment
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jun 2, 2017

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

  • Support PHPUnit 6.1 with WordPress 4.8 and above
  • Support PHPUnit 6.2, due 2nd June 2017
  • Continue to support tests developed with PHPUnit 5.7

Proposed solution

  • Implement a similar solution to WordPress core in the bootstrap code.
@bobbingwide bobbingwide self-assigned this Jun 2, 2017
@bobbingwide
Copy link
Owner Author

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
-->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant