Skip to content

Commit 89bf5c0

Browse files
author
Ivan Lutokhin
committed
* Fix tests php 5.5
1 parent f48751b commit 89bf5c0

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

EmailValidator/Validation/Error/IllegalMailbox.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,17 @@ public function getResponseCode()
3333
{
3434
return $this->responseCode;
3535
}
36+
37+
/**
38+
* @return string
39+
*/
40+
public function __toString()
41+
{
42+
return sprintf(
43+
"%s SMTP response code: %s. Internal code: %s.",
44+
$this->message,
45+
$this->responseCode,
46+
$this->code
47+
);
48+
}
3649
}

Tests/EmailValidator/Validation/MailboxCheckValidationTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ class MailboxCheckValidationTest extends TestCase
1313
{
1414
public function testValidMailbox()
1515
{
16-
$socketHelperMock = $this->createMock(SmtpSocketHelper::class);
16+
$socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class)
17+
->disableOriginalConstructor()
18+
->disableOriginalClone()
19+
->disableArgumentCloning()
20+
->disallowMockingUnknownTypes()
21+
->getMock();
1722

1823
$socketHelperMock
1924
->expects($this->any())
@@ -42,7 +47,12 @@ public function testDNSWarnings()
4247

4348
public function testIllegalMailboxError()
4449
{
45-
$socketHelperMock = $this->createMock(SmtpSocketHelper::class);
50+
$socketHelperMock = $this->getMockBuilder(SmtpSocketHelper::class)
51+
->disableOriginalConstructor()
52+
->disableOriginalClone()
53+
->disableArgumentCloning()
54+
->disallowMockingUnknownTypes()
55+
->getMock();
4656

4757
$socketHelperMock
4858
->expects($this->any())

0 commit comments

Comments
 (0)