File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
EmailValidator/Validation/Error
Tests/EmailValidator/Validation Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,17 @@ public function getResponseCode()
33
33
{
34
34
return $ this ->responseCode ;
35
35
}
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
+ }
36
49
}
Original file line number Diff line number Diff line change @@ -13,7 +13,12 @@ class MailboxCheckValidationTest extends TestCase
13
13
{
14
14
public function testValidMailbox ()
15
15
{
16
- $ socketHelperMock = $ this ->createMock (SmtpSocketHelper::class);
16
+ $ socketHelperMock = $ this ->getMockBuilder (SmtpSocketHelper::class)
17
+ ->disableOriginalConstructor ()
18
+ ->disableOriginalClone ()
19
+ ->disableArgumentCloning ()
20
+ ->disallowMockingUnknownTypes ()
21
+ ->getMock ();
17
22
18
23
$ socketHelperMock
19
24
->expects ($ this ->any ())
@@ -42,7 +47,12 @@ public function testDNSWarnings()
42
47
43
48
public function testIllegalMailboxError ()
44
49
{
45
- $ socketHelperMock = $ this ->createMock (SmtpSocketHelper::class);
50
+ $ socketHelperMock = $ this ->getMockBuilder (SmtpSocketHelper::class)
51
+ ->disableOriginalConstructor ()
52
+ ->disableOriginalClone ()
53
+ ->disableArgumentCloning ()
54
+ ->disallowMockingUnknownTypes ()
55
+ ->getMock ();
46
56
47
57
$ socketHelperMock
48
58
->expects ($ this ->any ())
You can’t perform that action at this time.
0 commit comments