From 4350baa1f12a581c279ea1d461bd446bee8bd521 Mon Sep 17 00:00:00 2001 From: Clark Winkelmann Date: Fri, 14 Feb 2020 15:34:32 +0100 Subject: [PATCH] Rename dead is_activated references with the new is_email_confirmed (#1974) --- .../src/Api/Controller/SendConfirmationEmailController.php | 2 +- framework/core/src/User/Command/ConfirmEmailHandler.php | 4 +--- framework/core/tests/integration/api/users/CreationTest.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/framework/core/src/Api/Controller/SendConfirmationEmailController.php b/framework/core/src/Api/Controller/SendConfirmationEmailController.php index ee66598f4..5912ad275 100644 --- a/framework/core/src/Api/Controller/SendConfirmationEmailController.php +++ b/framework/core/src/Api/Controller/SendConfirmationEmailController.php @@ -71,7 +71,7 @@ class SendConfirmationEmailController implements RequestHandlerInterface $this->assertRegistered($actor); - if ($actor->id != $id || $actor->is_activated) { + if ($actor->id != $id || $actor->is_email_confirmed) { throw new PermissionDeniedException; } diff --git a/framework/core/src/User/Command/ConfirmEmailHandler.php b/framework/core/src/User/Command/ConfirmEmailHandler.php index 0956813e7..16a691409 100644 --- a/framework/core/src/User/Command/ConfirmEmailHandler.php +++ b/framework/core/src/User/Command/ConfirmEmailHandler.php @@ -44,9 +44,7 @@ class ConfirmEmailHandler $user = $token->user; $user->changeEmail($token->email); - if (! $user->is_activated) { - $user->activate(); - } + $user->activate(); $user->save(); $this->dispatchEventsFor($user); diff --git a/framework/core/tests/integration/api/users/CreationTest.php b/framework/core/tests/integration/api/users/CreationTest.php index eb5cad123..e77a44ccc 100644 --- a/framework/core/tests/integration/api/users/CreationTest.php +++ b/framework/core/tests/integration/api/users/CreationTest.php @@ -111,7 +111,7 @@ class CreationTest extends TestCase /** @var User $user */ $user = User::where('username', 'test')->firstOrFail(); - $this->assertEquals(0, $user->is_activated); + $this->assertEquals(0, $user->is_email_confirmed); $this->assertEquals('test', $user->username); $this->assertEquals('test@machine.local', $user->email); }