diff --git a/composer.json b/composer.json index 660c1547..8f74bcc9 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "cakephp/cakephp": "^5.1.0", "cakephp/cakephp-codesniffer": "^5.0", "firebase/php-jwt": "^6.2", - "phpunit/phpunit": "^10.5.32 || ^11.3.3 || ^12.0.9" + "phpunit/phpunit": "^10.5.58 || ^11.5.3 || ^12.4" }, "suggest": { "ext-ldap": "Make sure this php extension is installed and enabled on your system if you want to use the built-in LDAP adapter for \"LdapIdentifier\".", diff --git a/tests/TestCase/AuthenticationServiceTest.php b/tests/TestCase/AuthenticationServiceTest.php index b6e9713e..0a11738d 100644 --- a/tests/TestCase/AuthenticationServiceTest.php +++ b/tests/TestCase/AuthenticationServiceTest.php @@ -34,12 +34,14 @@ use Cake\I18n\DateTime; use Cake\Routing\Router; use InvalidArgumentException; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use PHPUnit\Runner\Version; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use stdClass; +#[AllowMockObjectsWithoutExpectations] class AuthenticationServiceTest extends TestCase { /** diff --git a/tests/TestCase/Authenticator/AbstractAuthenticatorTest.php b/tests/TestCase/Authenticator/AbstractAuthenticatorTest.php index 90b2bcdc..e0fc2831 100644 --- a/tests/TestCase/Authenticator/AbstractAuthenticatorTest.php +++ b/tests/TestCase/Authenticator/AbstractAuthenticatorTest.php @@ -21,7 +21,9 @@ use Authentication\Authenticator\ResultInterface; use Authentication\Identifier\IdentifierInterface; use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +#[AllowMockObjectsWithoutExpectations] class AbstractAuthenticatorTest extends TestCase { /** diff --git a/tests/TestCase/Authenticator/AuthenticatorCollectionTest.php b/tests/TestCase/Authenticator/AuthenticatorCollectionTest.php index c1565955..35ac283d 100644 --- a/tests/TestCase/Authenticator/AuthenticatorCollectionTest.php +++ b/tests/TestCase/Authenticator/AuthenticatorCollectionTest.php @@ -21,7 +21,9 @@ use Authentication\Authenticator\FormAuthenticator; use Authentication\Identifier\IdentifierCollection; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +#[AllowMockObjectsWithoutExpectations] class AuthenticatorCollectionTest extends TestCase { /** diff --git a/tests/TestCase/Authenticator/EnvironmentAuthenticatorTest.php b/tests/TestCase/Authenticator/EnvironmentAuthenticatorTest.php index a5eb2d4d..6d37b067 100644 --- a/tests/TestCase/Authenticator/EnvironmentAuthenticatorTest.php +++ b/tests/TestCase/Authenticator/EnvironmentAuthenticatorTest.php @@ -22,8 +22,10 @@ use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; use Cake\Http\ServerRequestFactory; use Cake\Routing\Router; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use RuntimeException; +#[AllowMockObjectsWithoutExpectations] class EnvironmentAuthenticatorTest extends TestCase { /** diff --git a/tests/TestCase/Authenticator/FormAuthenticatorTest.php b/tests/TestCase/Authenticator/FormAuthenticatorTest.php index 1c00a414..faffcafd 100644 --- a/tests/TestCase/Authenticator/FormAuthenticatorTest.php +++ b/tests/TestCase/Authenticator/FormAuthenticatorTest.php @@ -22,8 +22,10 @@ use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; use Cake\Http\ServerRequestFactory; use Cake\Routing\Router; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use RuntimeException; +#[AllowMockObjectsWithoutExpectations] class FormAuthenticatorTest extends TestCase { /** diff --git a/tests/TestCase/Controller/Component/AuthenticationComponentTest.php b/tests/TestCase/Controller/Component/AuthenticationComponentTest.php index 4659fd9b..19313987 100644 --- a/tests/TestCase/Controller/Component/AuthenticationComponentTest.php +++ b/tests/TestCase/Controller/Component/AuthenticationComponentTest.php @@ -34,12 +34,14 @@ use Cake\ORM\Entity; use Cake\Routing\Router; use InvalidArgumentException; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use TestApp\Authentication\InvalidAuthenticationService; use UnexpectedValueException; /** * Authentication component test. */ +#[AllowMockObjectsWithoutExpectations] class AuthenticationComponentTest extends TestCase { /** diff --git a/tests/TestCase/Identifier/IdentifierCollectionTest.php b/tests/TestCase/Identifier/IdentifierCollectionTest.php index b296c4b5..fcf898b1 100644 --- a/tests/TestCase/Identifier/IdentifierCollectionTest.php +++ b/tests/TestCase/Identifier/IdentifierCollectionTest.php @@ -20,7 +20,9 @@ use Authentication\Identifier\IdentifierInterface; use Authentication\Identifier\PasswordIdentifier; use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +#[AllowMockObjectsWithoutExpectations] class IdentifierCollectionTest extends TestCase { public function testConstruct() diff --git a/tests/TestCase/Identifier/LdapIdentifierTest.php b/tests/TestCase/Identifier/LdapIdentifierTest.php index 87369acb..b9cc2260 100644 --- a/tests/TestCase/Identifier/LdapIdentifierTest.php +++ b/tests/TestCase/Identifier/LdapIdentifierTest.php @@ -22,8 +22,10 @@ use Authentication\Identifier\LdapIdentifier; use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; use ErrorException; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use stdClass; +#[AllowMockObjectsWithoutExpectations] class LdapIdentifierTest extends TestCase { /** diff --git a/tests/TestCase/Identifier/PasswordIdentifierTest.php b/tests/TestCase/Identifier/PasswordIdentifierTest.php index da8a8123..2a7e51bf 100644 --- a/tests/TestCase/Identifier/PasswordIdentifierTest.php +++ b/tests/TestCase/Identifier/PasswordIdentifierTest.php @@ -23,7 +23,9 @@ use Authentication\PasswordHasher\LegacyPasswordHasher; use Authentication\PasswordHasher\PasswordHasherInterface; use Authentication\Test\TestCase\AuthenticationTestCase as TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; +#[AllowMockObjectsWithoutExpectations] class PasswordIdentifierTest extends TestCase { /** diff --git a/tests/TestCase/Identifier/Resolver/ResolverAwareTraitTest.php b/tests/TestCase/Identifier/Resolver/ResolverAwareTraitTest.php index 5d9612ae..375f473c 100644 --- a/tests/TestCase/Identifier/Resolver/ResolverAwareTraitTest.php +++ b/tests/TestCase/Identifier/Resolver/ResolverAwareTraitTest.php @@ -19,8 +19,10 @@ use Authentication\Identifier\Resolver\ResolverAwareTrait; use Authentication\Identifier\Resolver\ResolverInterface; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use TestApp\Identifier\Resolver\TestResolver; +#[AllowMockObjectsWithoutExpectations] class ResolverAwareTraitTest extends TestCase { public function testBuildResolverFromClassName() diff --git a/tests/TestCase/Middleware/AuthenticationMiddlewareTest.php b/tests/TestCase/Middleware/AuthenticationMiddlewareTest.php index 8c11ef61..6d5c21f5 100644 --- a/tests/TestCase/Middleware/AuthenticationMiddlewareTest.php +++ b/tests/TestCase/Middleware/AuthenticationMiddlewareTest.php @@ -29,9 +29,11 @@ use Cake\Http\Response; use Cake\Http\ServerRequestFactory; use Firebase\JWT\JWT; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use TestApp\Application; use TestApp\Http\TestRequestHandler; +#[AllowMockObjectsWithoutExpectations] class AuthenticationMiddlewareTest extends TestCase { use ContainerStubTrait; diff --git a/tests/TestCase/PasswordHasher/PasswordHasherTraitTest.php b/tests/TestCase/PasswordHasher/PasswordHasherTraitTest.php index 576ac971..268af66d 100644 --- a/tests/TestCase/PasswordHasher/PasswordHasherTraitTest.php +++ b/tests/TestCase/PasswordHasher/PasswordHasherTraitTest.php @@ -19,10 +19,12 @@ use Authentication\PasswordHasher\PasswordHasherInterface; use Authentication\PasswordHasher\PasswordHasherTrait; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; /** * Test case for PasswordHasherTrait */ +#[AllowMockObjectsWithoutExpectations] class PasswordHasherTraitTest extends TestCase { /** diff --git a/tests/test_app/Plugin/TestPlugin/src/TestPluginPlugin.php b/tests/test_app/Plugin/TestPlugin/src/TestPluginPlugin.php new file mode 100644 index 00000000..b577961a --- /dev/null +++ b/tests/test_app/Plugin/TestPlugin/src/TestPluginPlugin.php @@ -0,0 +1,22 @@ +