-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
33 additions
and
34 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
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ public function testValidationIsUsed() | |
|
||
$this->assertTrue($validator->isValid("[email protected]", $validation)); | ||
} | ||
|
||
public function testMultipleValidation() | ||
{ | ||
$validator = new EmailValidator(); | ||
|
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 |
---|---|---|
|
@@ -34,21 +34,21 @@ public function testValidDNS($validEmail) | |
$validation = new DNSCheckValidation(); | ||
$this->assertTrue($validation->isValid($validEmail, new EmailLexer())); | ||
} | ||
|
||
public function testInvalidDNS() | ||
{ | ||
$validation = new DNSCheckValidation(); | ||
$this->assertFalse($validation->isValid("[email protected]", new EmailLexer())); | ||
} | ||
|
||
public function testDNSWarnings() | ||
{ | ||
$validation = new DNSCheckValidation(); | ||
$expectedWarnings = [NoDNSMXRecord::CODE => new NoDNSMXRecord()]; | ||
$validation->isValid("[email protected]", new EmailLexer()); | ||
$this->assertEquals($expectedWarnings, $validation->getWarnings()); | ||
} | ||
|
||
public function testNoDNSError() | ||
{ | ||
$validation = new DNSCheckValidation(); | ||
|
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 |
---|---|---|
|
@@ -54,16 +54,16 @@ public function testAccumulatesWarnings() | |
DomainLiteral::CODE => new DomainLiteral() | ||
]; | ||
$expectedResult = array_merge($warnings1, $warnings2); | ||
|
||
$lexer = $this->getMock("Egulias\\EmailValidator\\EmailLexer"); | ||
$validation1 = $this->getMock("Egulias\\EmailValidator\\Validation\\EmailValidation"); | ||
$validation1->expects($this->any())->method("isValid")->willReturn(true); | ||
$validation1->expects($this->once())->method("getWarnings")->willReturn($warnings1); | ||
|
||
$validation2 = $this->getMock("Egulias\\EmailValidator\\Validation\\EmailValidation"); | ||
$validation2->expects($this->any())->method("isValid")->willReturn(false); | ||
$validation2->expects($this->once())->method("getWarnings")->willReturn($warnings2); | ||
|
||
$multipleValidation = new MultipleValidationWithAnd([$validation1, $validation2]); | ||
$multipleValidation->isValid("[email protected]", $lexer); | ||
$this->assertEquals($expectedResult, $multipleValidation->getWarnings()); | ||
|
@@ -73,11 +73,11 @@ public function testGathersAllTheErrors() | |
{ | ||
$error1 = new CommaInDomain(); | ||
$error2 = new NoDomainPart(); | ||
|
||
$expectedResult = new MultipleErrors([$error1, $error2]); | ||
|
||
$lexer = $this->getMock("Egulias\\EmailValidator\\EmailLexer"); | ||
|
||
$validation1 = $this->getMock("Egulias\\EmailValidator\\Validation\\EmailValidation"); | ||
$validation1->expects($this->any())->method("isValid")->willReturn(true); | ||
$validation1->expects($this->once())->method("getWarnings")->willReturn([]); | ||
|
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