diff --git a/app/Containers/AppSection/Authentication/Tasks/ExtractLoginCustomAttributeTask.php b/app/Containers/AppSection/Authentication/Tasks/ExtractLoginCustomAttributeTask.php index 731d7233f..e738a7973 100644 --- a/app/Containers/AppSection/Authentication/Tasks/ExtractLoginCustomAttributeTask.php +++ b/app/Containers/AppSection/Authentication/Tasks/ExtractLoginCustomAttributeTask.php @@ -33,8 +33,8 @@ public function run(array $data): array } return [ - 'username' => $loginUsername, - 'loginAttribute' => $loginAttribute, + $loginUsername, + $loginAttribute, ]; } diff --git a/app/Containers/AppSection/Authentication/Tests/Unit/ExtractLoginCustomAttributeTaskTest.php b/app/Containers/AppSection/Authentication/Tests/Unit/ExtractLoginCustomAttributeTaskTest.php index 8809b563e..c95db9e3c 100644 --- a/app/Containers/AppSection/Authentication/Tests/Unit/ExtractLoginCustomAttributeTaskTest.php +++ b/app/Containers/AppSection/Authentication/Tests/Unit/ExtractLoginCustomAttributeTaskTest.php @@ -27,12 +27,11 @@ public function testGivenValidLoginAttributeThenExtractUsername(): void $this->assertAttributeIsExtracted($result, $userDetails); } - private function assertAttributeIsExtracted($result, $userDetails): void + private function assertAttributeIsExtracted(array $result, array $userDetails): void { - $this->assertIsArray($result); - $this->assertArrayHasKey('username', $result); - $this->assertArrayHasKey('loginAttribute', $result); - $this->assertSame($result['username'], $userDetails['email']); + list($username, $loginAttribute) = $result; + $this->assertSame($username, $userDetails['email']); + $this->assertSame($loginAttribute, 'email'); } public function testWhenNoLoginAttributeIsProvidedShouldUseEmailFieldAsDefaultFallback(): void