From a652c601f2cdfbeca4cdab2840b2f0c7563478d6 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 22 Oct 2024 14:39:29 +1300 Subject: [PATCH] MNT Fix unit test --- tests/php/Security/VersionedMemberAuthenticatorTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/php/Security/VersionedMemberAuthenticatorTest.php b/tests/php/Security/VersionedMemberAuthenticatorTest.php index a2693156796..29136b3d796 100644 --- a/tests/php/Security/VersionedMemberAuthenticatorTest.php +++ b/tests/php/Security/VersionedMemberAuthenticatorTest.php @@ -42,6 +42,14 @@ protected function setUp(): void return; } + // Explicity add the Versioned extension to Member, even though it's already in $required_extensions. + // This is done to call `unset(self::class::$extra_methods[strtolower($subclass)]);` in + // Extension::add_extension() so when CustomMethods::getExtraMethodConfig() updates the $extra_methods + // it will include methods of Versioned such as publishSingle() + // This issue will only occur when running subsequent unit test classes in the same process, rather than this + // this unit test class in isolation + Member::add_extension(Versioned::class); + // Enforce dummy validation (this can otherwise be influenced by recipe config) PasswordValidator::singleton() ->setMinLength(0)