-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(users): add email to MergeIdentifier object
- Loading branch information
1 parent
51b1810
commit 7b98f47
Showing
2 changed files
with
75 additions
and
4 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
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 |
---|---|---|
|
@@ -52,4 +52,54 @@ public function validProvider(): array | |
[$mergeIdentifier], | ||
]; | ||
} | ||
|
||
/** | ||
* @dataProvider validEmailIdentifierProvider | ||
* @doesNotPerformAssertions | ||
*/ | ||
public function testValidEmailIdentifier(MergeIdentifier $mergeIdentifier): void | ||
{ | ||
$mergeIdentifier->validate(true); | ||
} | ||
|
||
public function validEmailIdentifierProvider(): array | ||
{ | ||
$mergeIdentifier = new MergeIdentifier(); | ||
$mergeIdentifier->email = '[email protected]'; | ||
$mergeIdentifier->prioritization = ['unidentified', 'most_recently_updated']; | ||
|
||
return [ | ||
[$mergeIdentifier], | ||
]; | ||
} | ||
|
||
/** | ||
* @dataProvider invalidEmailIdentifierProvider | ||
*/ | ||
public function testInvalidEmailIdentifier(MergeIdentifier $mergeIdentifier): void | ||
{ | ||
$this->expectException(ValidationException::class); | ||
|
||
$mergeIdentifier->validate(false); | ||
} | ||
|
||
public function invalidEmailIdentifierProvider(): array | ||
{ | ||
$mergeIdentifier1 = new MergeIdentifier(); | ||
$mergeIdentifier1->email = '[email protected]'; | ||
|
||
$mergeIdentifier2 = new MergeIdentifier(); | ||
$mergeIdentifier2->email = '[email protected]'; | ||
$mergeIdentifier2->prioritization = ['email']; | ||
|
||
$mergeIdentifier3 = new MergeIdentifier(); | ||
$mergeIdentifier3->email = '[email protected]'; | ||
$mergeIdentifier3->prioritization = ['identified', 'unidentified']; | ||
|
||
return [ | ||
[$mergeIdentifier1], | ||
[$mergeIdentifier2], | ||
[$mergeIdentifier3], | ||
]; | ||
} | ||
} |