-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5435 from getkirby/releases/3.9.6.1
3.9.6.1
- Loading branch information
Showing
16 changed files
with
160 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ public function tearDown(): void | |
{ | ||
$this->app->session()->destroy(); | ||
Dir::remove($this->tmp); | ||
App::destroy(); | ||
} | ||
|
||
public function testChangeEmail() | ||
|
@@ -303,7 +304,7 @@ public function testChangeEmailHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.changeEmail:before' => function (User $user, $email) use ($phpunit, &$calls) { | ||
$phpunit->assertSame('[email protected]', $user->email()); | ||
|
@@ -318,7 +319,7 @@ public function testChangeEmailHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->changeEmail('[email protected]'); | ||
|
||
$this->assertSame(2, $calls); | ||
|
@@ -329,7 +330,7 @@ public function testChangeLanguageHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.changeLanguage:before' => function (User $user, $language) use ($phpunit, &$calls) { | ||
$phpunit->assertSame('en', $user->language()); | ||
|
@@ -344,7 +345,7 @@ public function testChangeLanguageHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->changeLanguage('de'); | ||
|
||
$this->assertSame(2, $calls); | ||
|
@@ -355,7 +356,7 @@ public function testChangeNameHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.changeName:before' => function (User $user, $name) use ($phpunit, &$calls) { | ||
$phpunit->assertNull($user->name()->value()); | ||
|
@@ -370,7 +371,7 @@ public function testChangeNameHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->changeName('Edith Thor'); | ||
|
||
$this->assertSame(2, $calls); | ||
|
@@ -381,7 +382,7 @@ public function testChangePasswordHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.changePassword:before' => function (User $user, $password) use ($phpunit, &$calls) { | ||
$phpunit->assertEmpty($user->password()); | ||
|
@@ -402,7 +403,7 @@ public function testChangePasswordHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->changePassword('topsecret2018'); | ||
|
||
$this->assertSame(3, $calls); | ||
|
@@ -445,7 +446,7 @@ public function testChangeRoleHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.changeRole:before' => function (User $user, $role) use ($phpunit, &$calls) { | ||
$phpunit->assertSame('editor', $user->role()->name()); | ||
|
@@ -460,7 +461,7 @@ public function testChangeRoleHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->changeRole('admin'); | ||
|
||
$this->assertSame(2, $calls); | ||
|
@@ -476,7 +477,7 @@ public function testCreateHooks() | |
'model' => 'admin', | ||
]; | ||
|
||
$this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.create:before' => function (User $user, $input) use ($phpunit, $userInput, &$calls) { | ||
$phpunit->assertSame('[email protected]', $user->email()); | ||
|
@@ -502,7 +503,7 @@ public function testDeleteHooks() | |
$calls = 0; | ||
$phpunit = $this; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.delete:before' => function (User $user) use ($phpunit, &$calls) { | ||
$phpunit->assertSame('[email protected]', $user->email()); | ||
|
@@ -518,7 +519,7 @@ public function testDeleteHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->delete(); | ||
|
||
$this->assertSame(2, $calls); | ||
|
@@ -532,7 +533,7 @@ public function testUpdateHooks() | |
'website' => 'https://getkirby.com' | ||
]; | ||
|
||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.update:before' => function (User $user, $values, $strings) use ($phpunit, $input, &$calls) { | ||
$phpunit->assertNull($user->website()->value()); | ||
|
@@ -548,7 +549,7 @@ public function testUpdateHooks() | |
] | ||
]); | ||
|
||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->update($input); | ||
|
||
$this->assertSame(2, $calls); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,9 @@ public function setUp(): void | |
|
||
public function tearDown(): void | ||
{ | ||
$this->app->session()->destroy(); | ||
Dir::remove($this->tmp); | ||
App::destroy(); | ||
} | ||
|
||
public function testGlobalUserState() | ||
|
@@ -50,7 +52,7 @@ public function testLoginLogoutHooks() | |
|
||
$calls = 0; | ||
$logoutSession = false; | ||
$app = $this->app->clone([ | ||
$this->app = $this->app->clone([ | ||
'hooks' => [ | ||
'user.login:before' => function ($user, $session) use ($phpunit, &$calls) { | ||
$phpunit->assertSame('[email protected]', $user->email()); | ||
|
@@ -86,7 +88,7 @@ public function testLoginLogoutHooks() | |
]); | ||
|
||
// without prepopulated session | ||
$user = $app->user('[email protected]'); | ||
$user = $this->app->user('[email protected]'); | ||
$user->loginPasswordless(); | ||
$user->logout(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.