Closed bobbingwide closed 4 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.
I think we can safely close this now.
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 forWP_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
(intests\bootstrap.php
) has been changed so that we load our own version of WP_UnitTestCase (fromtests\testcase.php
). This version differs in that it performs ROLLBACK instead of COMMIT.