Releases: alleyinteractive/mantle-framework
Releases · alleyinteractive/mantle-framework
v1.12.1
Changed
- Remove some unnecessary data from the serialized HTTP response to reduce the size when caching.
v1.12.0
Added
- Added
mixed_query_var()helper to retrieve a query variable as mixed data type. - Added
Exit_Simulation_Exceptionexception to simulateexitcalls during testing. - Added
terminate_request()helper to be used instead ofexit()for safer termination during testing. - Added
send_json_response()helper to send a JSON response and terminate the request safely. - Added
mixed_json()method toMantle\Http_Client\Responseto parse the body as JSON and return a mixed data helper. - Added
with_base_url()method to the HTTP client. - Added closure support for the cache TTL in the HTTP client.
Changed
- Throws an exception in the cached HTTP client if the cache stale TTL is greater than the cache expiration TTL.
v1.11.1
Fixed
- Ensure that
wp_scripts()andwp_styles()globals are properly set before cloning them.
v1.11.0
Added
- Added an
optionscallback to thefeed()method of the HTTP client response to allow for customizing the SimplePie feed parser.
Changed
- Multiple properties in
Makes_Http_Requestsare now private to prevent unintended side effects from tests that modify these properties directly.
Fixed
- Disable rewrite for internal queue post type.
v1.10.0
Changed
- Backup the
wp_scriptsandwp_stylesglobals before any tests are run and restore it before each HTTP request to prevent side effects from tests that modify these globals. - Backup and restore the state of Alley's
wp-asset-managerplugin if it is present during testing to prevent side effects from tests that modify the asset manager state. - Mark more hooks as not being run before each test run to provide a cleaner environment for tests. Filters and actions that are not run include:
parse_query-parse_request-posts_selection-pre_get_posts-rest_api_init-send_headers-template_redirect-wp_enqueue_scripts-wp_footer-wp_head-wp_print_scripts-wp_print_styles-wp
Fixed
- Fixed issue with
feed()method inMantle\Http_Client\Responseto account for WordPress 6.5 - 6.6.
v1.9.5
Added
- Added flexible caching to the HTTP client.
- Added
is_html()andhtml()toMantle\Http_Client\Responseto check if the response is HTML and to return anHTMLinstance for making assertions against the HTML content. - Added
feed()method toMantle\Http_Client\Responseto parse the body as a feed using SimplePie.
v1.9.4
Added
- Added schema support to
register_meta_from_file()to validate meta definitions against a JSON schema.
Changed
- Added more strict types to the framework.
Fixed
- Fix issue with a callable string being passed to the expectation container not being handled properly.
v1.9.3
Added
- Added array support to the
with_byline_manager_authors()andwith_cap_authors()methods on post factories. - Added
assertJsonPathEmpty(),assertJsonPathNotEmpty(),assertJsonPathContains(),assertJsonPathNotContains(), andassertJsonPathCallback()methods to the test response class. - Added
dump_backtrace()/dd_backtrace()methods.
Changed
- Changed the
theme()method of the installation manager to set theWP_DEFAULT_THEMEenvironment variable to ensure that the theme is properly set during installation. - Throw an exception if the user attempts to make a testing request to a path that is not supported by the testing framework (e.g.
/wp-login.php,/wp-admin/*, etc.).
Fixed
- Fixed issue with empty JSON not being parsed properly with
Assertable_Json_String.
v1.9.2
Added
- Added
Single_Site_Testtrait to skip tests if not in single site mode.
Changed
- Limit length of site title to 20 characters in blog factory.
- When using the
Refresh_Databasetrait, all blogs will be deleted in thetearDownAfterClass()route. - Align the
flush_cache()method in testing to match core's behavior.
Fixed
- Ensure that the faker instance used in factories and tests has unique enabled by default to prevent duplicate values when generating data.
v1.9.1
Added
- Added
with_snapshot()toMantle\Testing\Mock_Http_Responseto allow for mocking of a HTTP request from a stored snapshot. - Added a
memo()helper to memoize the result of a closure based on its dependencies and context.
Changed
- Adjusted the bootstrap of parallel unit testing.