Skip to content

Commit

Permalink
fix: return extracted values with expected formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Apr 16, 2022
1 parent 49d324a commit 7ece8ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function run(array $data): array
}

return [
'username' => $loginUsername,
'loginAttribute' => $loginAttribute,
$loginUsername,
$loginAttribute,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ece8ab

Please sign in to comment.