-
-
Notifications
You must be signed in to change notification settings - Fork 2
Version 4 Migration
Version 4 has diverged from the WordPress core upstream. While the majority of functionality from WP core was maintained, some rarely used functionality was removed. Going forward, updates to the WP core upstream will not be merged in unless a specific feature is desired, in which case the single feature will be manually ported into this project.
This library no longer includes the testing data from WP core.
If you are using items from the data
directory, you will want to copy them into your local test suite and update the paths using them.
Some test images have been preserved and are now available via the DIR_TEST_IMAGES
constant. You may migrate uses of DIR_TESTDATA . '/images
to DIR_TEST_IMAGES
.
- The
multisite.xml
config has been removed. - All methods related to "trac" or "tickets" have been removed from
WP_UnitTestCase_Base
. - The
\TracTickets
class has been removed.
Use PHPUnit 7 or above.
No code was changed to update the minimum so it is possible it may work on older versions. We are no longer going to actively support versions before 6.1.
- The file related methods were moved to a new
\Lipe\WP_Unit\Utils\Files
class. - The
remove_add_uploads
methods were moved to a new\Lipe\WP_Unit\Traits\RemoveUploaded
trait.
prepareTemplate
temp_filename
unlink
rmdir
delete_folders
prepareTemplate
scandir
_microtime_to_float
_make_attachment
update_post_modified
text_array_to_dataprovider
skipOnAutomatedBranches
wpTearDownAfterClass
wpSetUpBeforeClass
Instead of cluttering up the WP_UnitTestCase_Base
with a bunch of internal methods, they have been moved to a new \Lipe\WP_Unit\Helpers\Cleanup
class.
reset__SERVER
reset_post_statuses
reset_taxonomies
reset_post_types
reset_lazyload_queue
clean_up_global_scope
flush_cache
unregister_all_meta_keys
-
set_permalink_structure
-> Moved to\Lipe\WP_Unit\Utils\Requests::set_permalink_structure
delete_user
commit_transaction
start_transaction
- All
_
methods called by commit and start.
The Deprecated_TestCase_Base
class was filled with methods and properties which were previously deprecated and left intact for backwards compatibility only. The trait in its entirely has been removed.
These methods and properties are no longer available on the WP_UnitTestCase_Base
class with no replacement.
You can see everything this trait contained here.
If a _doint_it_wrong
function is called more than once for the same function, you now must call expectDoingItWrong
the same number of times.
The create_object
method used to have 3 arguments on some factory classes which were shimmed in for backward compatibility.
Now only the first array $args
argument exists and the shims have been removed. Merge arguments 2 and 3 into the array to retain functionality.
The following methods were moved to \Lipe\WP_Unit\Utils\Requests
a while back and have now been removed from the WP_Http_Remote_Post_TestCase
class.
-
format_json_response
->Requests::json_response
-
format_html_response
->Requests::html_response
The mock_sent
property has been removed in favor of using $this->get_all_sent()
to retrieve the results from \WP_Http_Unit_Test_Transport::get_mocks()