Skip to content

Commit

Permalink
update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
skie committed Sep 15, 2023
1 parent 23406df commit 45720fb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"minimum-stability": "dev",
"require": {
"php": ">=8.1.0",
"cakephp/cakephp": "5.x-dev"
"cakephp/cakephp": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
Expand All @@ -40,9 +40,9 @@
"google/recaptcha": "@stable",
"robthree/twofactorauth": "^2.0",
"league/oauth1-client": "^1.7",
"cakephp/authorization": "3.x-dev",
"cakephp/authorization": "^3.0",
"cakephp/cakephp-codesniffer": "^5.0",
"cakephp/authentication": "3.x-dev",
"cakephp/authentication": "^3.0",
"yubico/u2flib-server": "^1.0"
},
"suggest": {
Expand Down
53 changes: 27 additions & 26 deletions tests/TestCase/Authenticator/FormAuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Authentication\Authenticator\FormAuthenticator as CakeFormAuthenticator;
use Authentication\Authenticator\Result;
use Authentication\Identifier\AbstractIdentifier;
use Authentication\Identifier\IdentifierCollection;
use Authentication\Identifier\IdentifierInterface;
use Cake\Core\Configure;
Expand Down Expand Up @@ -58,8 +59,8 @@ public function testAuthenticateBaseFailed()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
],
Expand All @@ -72,8 +73,8 @@ public function testAuthenticateBaseFailed()
$this->equalTo($identifiers),
$this->equalTo([
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
])
Expand Down Expand Up @@ -126,8 +127,8 @@ public function testAuthenticate()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
],
Expand All @@ -140,8 +141,8 @@ public function testAuthenticate()
$this->equalTo($identifiers),
$this->equalTo([
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
])
Expand Down Expand Up @@ -199,8 +200,8 @@ public function testAuthenticateNotRequiredReCaptcha()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
],
])->onlyMethods(['createBaseAuthenticator', 'validateReCaptcha'])->getMock();
Expand All @@ -212,8 +213,8 @@ public function testAuthenticateNotRequiredReCaptcha()
$this->equalTo($identifiers),
$this->equalTo([
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
])
Expand Down Expand Up @@ -266,8 +267,8 @@ public function testAuthenticateInvalidRecaptcha()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
],
])->onlyMethods(['createBaseAuthenticator', 'validateReCaptcha'])->getMock();
Expand All @@ -279,8 +280,8 @@ public function testAuthenticateInvalidRecaptcha()
$this->equalTo($identifiers),
$this->equalTo([
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
])
Expand Down Expand Up @@ -314,8 +315,8 @@ public function testGetBaseAuthenticator()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
]
Expand All @@ -325,8 +326,8 @@ public function testGetBaseAuthenticator()
$this->assertNotInstanceOf(FormAuthenticator::class, $actual);
$expected = [
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'loginUrl' => null,
'urlChecker' => 'Authentication.Default',
Expand All @@ -349,8 +350,8 @@ public function testGetBaseAuthenticatorCustom()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
'baseClassName' => CakeFormAuthenticator::class,
Expand All @@ -361,8 +362,8 @@ public function testGetBaseAuthenticatorCustom()
$this->assertNotInstanceOf(FormAuthenticator::class, $actual);
$expected = [
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'loginUrl' => null,
'urlChecker' => 'Authentication.Default',
Expand All @@ -385,8 +386,8 @@ public function testGetBaseAuthenticatorError()
$identifiers,
[
'fields' => [
IdentifierInterface::CREDENTIAL_USERNAME => 'email',
IdentifierInterface::CREDENTIAL_PASSWORD => 'password',
AbstractIdentifier::CREDENTIAL_USERNAME => 'email',
AbstractIdentifier::CREDENTIAL_PASSWORD => 'password',
],
'keyCheckEnabledRecaptcha' => 'Users.reCaptcha.login',
'baseClassName' => 'NotExistingAuthenticator',
Expand Down
10 changes: 10 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@
$loader = new SchemaLoader();
$loader->loadInternalFile(env('FIXTURE_SCHEMA_METADATA'));
}

$error = [
'errorLevel' => E_ALL,
'skipLog' => [],
'log' => true,
'trace' => true,
'ignoredDeprecationPaths' => [],
];
(new Cake\Error\ErrorTrap($error))->register();

0 comments on commit 45720fb

Please sign in to comment.