bobbingwide / oik-batch

Batch interface to WordPress
https://www.oik-plugins.com/oik-plugins/oik-batch
GNU General Public License v2.0
0 stars 0 forks source link

Replace WP_UnitTestCase by BW_UnitTestCase #16

Closed bobbingwide closed 4 years ago

bobbingwide commented 7 years ago

In WordPress 4.7 the PHPUnit testing suite has been changed such that tests that extend WP_UnitTestCase will basically empty the database. This is incompatible with In situ testing which expects the database to be already populated. The BW_UnitTestCase class is a replacement for WP_UnitTestCase. Any plugin that performs in situ testing should be changed to extend BW_UnitTestCase.

Note: This is belt and braces. For 4.7, load_bootstrap_functions (in tests\bootstrap.php) has been changed so that we load our own version of WP_UnitTestCase (from tests\testcase.php). This version differs in that it performs ROLLBACK instead of COMMIT.

bobbingwide commented 7 years ago

This Issue should be referred to by other plugins making changes to their PHPUnit test cases for 4.7.

Note: Making this change may prevent the PHPUnit tests working in WordPress 4.6.

bobbingwide commented 4 years ago

I think we can safely close this now.