Skip to content

Commit 1d82427

Browse files
authored
Merge pull request #725 from cakephp/tests-deprecations
Fix deprecation warnings in tests.
2 parents ebaec2b + bbffe81 commit 1d82427

File tree

9 files changed

+134
-139
lines changed

9 files changed

+134
-139
lines changed

docs/en/identity-object.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ that implements the required interface::
108108
// Then pass it to the service configuration
109109
$service = new AuthenticationService([
110110
'identityClass' => $identityResolver,
111-
'identifiers' => [
112-
'Authentication.Password'
113-
],
114111
'authenticators' => [
115-
'Authentication.Form'
112+
'Authentication.Form' => [
113+
'identifier' => 'Authentication.Password',
114+
],
116115
]
117116
]);

phpunit.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
colors="true"
44
processIsolation="false"
55
stopOnFailure="false"
6+
failOnDeprecation="true"
7+
displayDetailsOnTestsThatTriggerDeprecations="true"
68
cacheDirectory=".phpunit.cache"
79
bootstrap="tests/bootstrap.php"
810
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">

src/AuthenticationService.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,10 @@ class AuthenticationService implements AuthenticationServiceInterface, Impersona
8989
* ```
9090
* $service = new AuthenticationService([
9191
* 'authenticators' => [
92-
* 'Authentication.Form
92+
* 'Authentication.Form' => [
93+
* 'identifier' => 'Authentication.Password',
94+
* ],
9395
* ],
94-
* 'identifiers' => [
95-
* 'Authentication.Password'
96-
* ]
9796
* ]);
9897
* ```
9998
*
@@ -172,7 +171,7 @@ public function loadIdentifier(string $name, array $config = []): IdentifierInte
172171
{
173172
deprecationWarning(
174173
'3.3.0',
175-
'loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.',
174+
'loadIdentifier() usage is deprecated. Directly pass `\'identifier\'` config to the Authenticator.',
176175
);
177176

178177
return $this->identifiers()->load($name, $config);

src/Authenticator/AuthenticatorCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(IdentifierCollection $identifiers, array $config = [
4646
if ($identifiers->count() > 0) {
4747
deprecationWarning(
4848
'3.3.0',
49-
'loadIdentifier() usage is deprecated. Directly pass Identifier to Authenticator.',
49+
'loadIdentifier() usage is deprecated. Directly pass `\'identifier\'` config to the Authenticator.',
5050
);
5151
}
5252

@@ -70,7 +70,7 @@ protected function _create(object|string $class, string $alias, array $config):
7070
} else {
7171
deprecationWarning(
7272
'3.3.0',
73-
'loadIdentifier() usage is deprecated. Directly pass `\'identifier\'` config to Authenticator.',
73+
'loadIdentifier() usage is deprecated. Directly pass `\'identifier\'` config to the Authenticator.',
7474
);
7575
}
7676

0 commit comments

Comments
 (0)