From aeed5e473fe41316433239f819478f662a328d40 Mon Sep 17 00:00:00 2001 From: Ivan Lutokhin Date: Mon, 29 Apr 2019 11:33:46 +0300 Subject: [PATCH] * Fix tests php 5.5 --- EmailValidator/Validation/Error/IllegalMailbox.php | 13 +++++++++++++ .../Validation/MailboxCheckValidationTest.php | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/EmailValidator/Validation/Error/IllegalMailbox.php b/EmailValidator/Validation/Error/IllegalMailbox.php index 51fa110..1b6646e 100644 --- a/EmailValidator/Validation/Error/IllegalMailbox.php +++ b/EmailValidator/Validation/Error/IllegalMailbox.php @@ -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 + ); + } } diff --git a/Tests/EmailValidator/Validation/MailboxCheckValidationTest.php b/Tests/EmailValidator/Validation/MailboxCheckValidationTest.php index f7e0881..5ef87ce 100644 --- a/Tests/EmailValidator/Validation/MailboxCheckValidationTest.php +++ b/Tests/EmailValidator/Validation/MailboxCheckValidationTest.php @@ -13,7 +13,9 @@ class MailboxCheckValidationTest extends TestCase { public function testValidMailbox() { - $socketHelperMock = $this->createMock(SmtpSocketHelper::class); + $socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class) + ->disableOriginalConstructor() + ->getMock(); $socketHelperMock ->expects($this->any()) @@ -42,7 +44,9 @@ public function testDNSWarnings() public function testIllegalMailboxError() { - $socketHelperMock = $this->createMock(SmtpSocketHelper::class); + $socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class) + ->disableOriginalConstructor() + ->getMock(); $socketHelperMock ->expects($this->any())