Skip to content

Commit

Permalink
Adapt unit tests to new auth.debug option
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/Cms/Auth/AuthChallengeTest.php
  • Loading branch information
lukasbestle committed Oct 17, 2022
1 parent 38214ac commit 411996d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
19 changes: 14 additions & 5 deletions tests/Cms/Auth/AuthChallengeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public function setUp(): void
}
],
'options' => [
'auth.trials' => 2,
'debug' => true
'auth' => [
'debug' => true,
'trials' => 2
]
],
'roots' => [
'index' => $this->fixtures = __DIR__ . '/fixtures/AuthTest'
Expand Down Expand Up @@ -74,7 +76,9 @@ public function testCreateChallenge()
{
$this->app = $this->app->clone([
'options' => [
'debug' => false
'auth' => [
'debug' => false
]
]
]);
$auth = $this->app->auth();
Expand Down Expand Up @@ -173,7 +177,10 @@ public function testCreateChallengeCustomTimeout()
{
$this->app = $this->app->clone([
'options' => [
'auth.challenge.timeout' => 10
'auth' => [
'challenge.timeout' => 10,
'debug' => false
]
]
]);
$auth = $this->app->auth();
Expand Down Expand Up @@ -372,7 +379,9 @@ public function testVerifyChallengeNoChallengeNoDebug()
{
$this->app = $this->app->clone([
'options' => [
'debug' => false
'auth' => [
'debug' => false
]
]
]);
$auth = $this->app->auth();
Expand Down
17 changes: 14 additions & 3 deletions tests/Cms/Auth/AuthProtectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function setUp(): void
$self = $this;

$this->app = new App([
'options' => [
'auth' => [
'debug' => false
]
],
'roots' => [
'index' => $this->fixtures = __DIR__ . '/fixtures/AuthTest'
],
Expand Down Expand Up @@ -278,7 +283,9 @@ public function testValidatePasswordDebugInvalid1()
copy(__DIR__ . '/fixtures/logins.json', $this->fixtures . '/site/accounts/.logins');
$this->app = $this->app->clone([
'options' => [
'debug' => true
'auth' => [
'debug' => true
]
]
]);
$this->auth = new Auth($this->app);
Expand Down Expand Up @@ -306,7 +313,9 @@ public function testValidatePasswordDebugInvalid2()
copy(__DIR__ . '/fixtures/logins.json', $this->fixtures . '/site/accounts/.logins');
$this->app = $this->app->clone([
'options' => [
'debug' => true
'auth' => [
'debug' => true
]
]
]);
$this->auth = new Auth($this->app);
Expand Down Expand Up @@ -335,7 +344,9 @@ public function testValidatePasswordDebugBlocked()
copy(__DIR__ . '/fixtures/logins.json', $this->fixtures . '/site/accounts/.logins');
$this->app = $this->app->clone([
'options' => [
'debug' => true
'auth' => [
'debug' => true
]
]
]);
$this->auth = new Auth($this->app);
Expand Down
3 changes: 3 additions & 0 deletions tests/Cms/Auth/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function setUp(): void
'api' => [
'basicAuth' => true,
'allowInsecure' => true
],
'auth' => [
'debug' => false
]
],
'users' => [
Expand Down

0 comments on commit 411996d

Please sign in to comment.