Skip to content

Commit

Permalink
* Fix tests php 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Lutokhin committed Apr 29, 2019
1 parent f48751b commit 89bf5c0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
13 changes: 13 additions & 0 deletions EmailValidator/Validation/Error/IllegalMailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,17 @@ public function getResponseCode()
{
return $this->responseCode;
}

/**
* @return string
*/
public function __toString()
{
return sprintf(
"%s SMTP response code: %s. Internal code: %s.",
$this->message,
$this->responseCode,
$this->code
);
}
}
14 changes: 12 additions & 2 deletions Tests/EmailValidator/Validation/MailboxCheckValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ class MailboxCheckValidationTest extends TestCase
{
public function testValidMailbox()
{
$socketHelperMock = $this->createMock(SmtpSocketHelper::class);
$socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class)
->disableOriginalConstructor()
->disableOriginalClone()
->disableArgumentCloning()
->disallowMockingUnknownTypes()
->getMock();

$socketHelperMock
->expects($this->any())
Expand Down Expand Up @@ -42,7 +47,12 @@ public function testDNSWarnings()

public function testIllegalMailboxError()
{
$socketHelperMock = $this->createMock(SmtpSocketHelper::class);
$socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class)
->disableOriginalConstructor()
->disableOriginalClone()
->disableArgumentCloning()
->disallowMockingUnknownTypes()
->getMock();

$socketHelperMock
->expects($this->any())
Expand Down

0 comments on commit 89bf5c0

Please sign in to comment.