Skip to content

Releases: alleyinteractive/mantle-framework

v1.4.1

21 Jan 19:34
e9714e2
Compare
Choose a tag to compare

Changed

  • Load vip-config.php during testing using the WP_CONTENT_DIR constant.
  • Use the testing directory (WP_TESTS_INSTALL_PATH) for ABSPATH if not set.

v1.4.0

20 Jan 16:31
7a6609d
Compare
Choose a tag to compare

📢 Minimum PHP version is now 8.2. The framework supports 8.2 - 8.4.

Added

  • ✨ Experimental feature ✨: Use the home URL as the base URL for testing rather than WP_TESTS_DOMAIN. This can be enabled by calling the with_experimental_testing_url_host() method of the installation manager or by setting the MANTLE_EXPERIMENTAL_TESTING_USE_HOME_URL_HOST environment variable.
    Once enabled, the home URL will be used as the base URL for testing rather the hard-coded WP_TESTS_DOMAIN. It will also infer the HTTPS status from the home URL.
  • Added with_option()/with_home_url()/with_site_url() methods to the installation manager.
  • Add a without_local_object_cache() method to prevent the object-cache.php drop-in from being loaded locally.
  • Added a better dump() method to the response object when testing HTTP requests that will dump the request/response to the console.

Changed

  • Removed support for PHP 8.1. The minimum PHP version is now 8.2.
  • For projects that require PHPUnit 9, the phpunit/phpunit version is now set to ^9.6.22.
  • Upgraded to Symfony 7.0 packages.
  • Disable spatie/once's cache if found during unit testing.
  • Ensure that the QUERY_STRING server variable is set when testing HTTP requests.

Fixed

  • Ensure that built-in taxonomies properly register their rewrite rules during testing.

v1.3.3

10 Jan 21:28
08a66b0
Compare
Choose a tag to compare

Added

  • Added Mantle\Support\Helpers\capture helper to capture output from a callback using output buffering.

Changed

  • Updated the Mantle\Support\Helpers\defer helper to be able to used outside
    of the Mantle Framework via the shutdown hook.

Fixed

  • Allow Filter/Action attributes to be used multiple times on the same method.

v1.3.2

17 Dec 19:22
8d4c417
Compare
Choose a tag to compare
  • Allow stray requests to be ignored and pass through when being prevented with ignore_stray_request().

v1.3.1

13 Dec 14:12
9fdb1a9
Compare
Choose a tag to compare

Fixed

  • Fixed issue where output buffers were left open when an exception occurred during setup.

v1.3.0

02 Dec 14:59
33c10bc
Compare
Choose a tag to compare

Added

  • Define a thumbnail relationship on the post model that when defined will return an attachment model.
  • Added count support to assertSee() for responses and assertContains() for HTML string assertions.
  • Added assertContains() to response assertions.

Changed

  • Post factories that are passed a term slug to with_terms() will create the term if it doesn't exist by default. This can be disabled by calling the create_terms() method on the factory or replacing the with terms method call with with_terms_only_existing().

Fixed

  • Attachment factories now properly use the Attachment_Factory class.
  • Ensure that the delete() method of the HTTP Client doesn't set a body by default.
  • Ensure that with_terms() can support an array of term slugs when passed with a taxonomy index.
  • Ensure that framework configuration respects the application configuration.
  • Ensure that collections can properly implode Stringable objects.

v1.2.0

17 Oct 14:58
1cd7774
Compare
Choose a tag to compare

Added

  • Add support for dispatching jobs to the queue after the current response has
    been sent.
  • Allow the block factory to override text when generating blocks.
  • Added new defer() helper.
  • Added Cache::flexible() method to add SWR support to the cache (docs)
  • Added support for parallel unit testing with brianium/paratest (in beta).
  • Added dynamic creation of post type/taxonomy factories.
  • Added Reset_Server trait to reset the server between tests.
  • Add with_https() to control if the request being tested is over HTTPS.
  • Add andReturnBoolean() and andReturn( fn ( $value ) => ... ) support to
    action/filter expectations
  • Add cached HTTP response support using the cache() method.

Changed

  • Breaking: Http Client pools should now be built using ->method() and ->url() instead.
  • Dropped support for Redis as a cache backend in favor of the default object
    cache drop-in.
  • Allow returning falsey from Collection::map_to_dictionary().

v1.1.3

15 Aug 03:34
2a4229b
Compare
Choose a tag to compare

Added

  • Added a with_image() helper to mocked HTTP responses.
  • Added a is_blob() and is_file() helper to Mantle\Http_Client\Response.
  • Added with_real_thumbnail() method to post factory for creating posts with
    real underlying thumbnail files.

Changed

  • Added support for faking specific HTTP requests by method.
  • Added helper for fluently building HTTP sequence responses.

Fixed

  • Fixed an issue with taxonomy registration not returning an array.

v1.1.2

20 Jun 15:23
408a5ca
Compare
Choose a tag to compare

Fixed

  • Fixed issue with the mantle-framework/testkit package depending on classes that do not exist for that package (introduced in v1.1.0).

v1.1.1

20 Jun 13:26
0aa37b7
Compare
Choose a tag to compare

Added

  • Add a with_json() helper to the HTTP client to send JSON data in a request.

Changed

  • Added types to the HTTP client methods.

Fixed

  • Fix the order of the vip-config.php loading that was added during 1.0.