From 9755d09cf6885673c8f98ca40144390f0ee217fd Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Tue, 30 May 2023 14:39:48 -0400 Subject: [PATCH] Allow object cache to be forcefully included (#391) * Add support for rsync-ing mu-plugins and adding object-cache.php during testing * Ignore object cache * Lock to 85b3aff18f181fd2c7a08dfd639fa4688fe1179a to debug * lock to the https://github.com/alleyinteractive/mantle-ci/pull/10 branch * Testing without * Restore debug code * Disable fast-fail * Disable object cache * Disable the branch lock in --- .github/workflows/tests.yml | 1 + CHANGELOG.md | 6 +++++- src/mantle/testing/concerns/trait-rsync-installation.php | 8 +------- tests/bootstrap.php | 1 - 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f4d00270..9b8129dc5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,7 @@ on: jobs: php-tests: strategy: + fail-fast: false matrix: php: [8.0, 8.1] wordpress: ["latest"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d51353b..973ceaa48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v0.11.0 - 2023-05-xx +## v0.11.0 - 2023-05-30 + +### Added + +- Add support for rsync-ing mu-plugins and adding object-cache.php during testing. ### Changes diff --git a/src/mantle/testing/concerns/trait-rsync-installation.php b/src/mantle/testing/concerns/trait-rsync-installation.php index 4bc55defa..f5a0d73dc 100644 --- a/src/mantle/testing/concerns/trait-rsync-installation.php +++ b/src/mantle/testing/concerns/trait-rsync-installation.php @@ -184,13 +184,7 @@ public function with_object_cache( bool $install = true ): static { } // Check if Memcached is installed. - if ( ! class_exists( \Memcached::class ) ) { - // Allow the object cache to be forcefully required. - if ( Utils::env( 'MANTLE_REQUIRE_OBJECT_CACHE', false ) ) { - Utils::error( 'Memcached is not installed. Cannot install object cache. Exiting...' ); - exit( 1 ); - } - + if ( ! class_exists( \Memcached::class ) && ! Utils::env( 'MANTLE_REQUIRE_OBJECT_CACHE', false ) ) { Utils::error( 'Memcached is not installed. Cannot install object cache. Skipping...' ); return $this; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index cb1efc318..5497f7681 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -14,6 +14,5 @@ \Mantle\Testing\manager() ->maybe_rsync_plugin() - ->with_object_cache() ->with_vip_mu_plugins() ->install();