File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,31 @@ public function testClientEndAgainWillNotBlock(Socket $client)
60
60
{
61
61
$ client ->end ();
62
62
$ this ->loop ->run ();
63
+
64
+ return $ client ;
65
+ }
66
+
67
+ /**
68
+ *
69
+ * @param Socket $client
70
+ * @depends testClientEndAgainWillNotBlock
71
+ */
72
+ public function testClientSendAfterEndIsNoop (Socket $ client )
73
+ {
74
+ $ client ->send ('does not matter ' );
75
+ $ this ->loop ->run ();
76
+ }
77
+
78
+ public function testClientSendHugeWillFail ()
79
+ {
80
+ $ promise = $ this ->factory ->createClient ('127.0.0.1 ' , 12345 );
81
+ $ client = $ this ->getValueFromResolvedPromise ($ promise );
82
+
83
+ $ client ->send (str_repeat (1 , 1024 * 1024 ));
84
+ $ client ->on ('error ' , $ this ->expectCallableOnce ());
85
+ $ client ->end ();
86
+
87
+ $ this ->loop ->run ();
63
88
}
64
89
65
90
public function testCreatePair ()
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ protected function expectCallableNever()
48
48
49
49
protected function createCallableMock ()
50
50
{
51
- return $ this ->getMock ('React\Tests\Socket\Stub\ CallableStub ' );
51
+ return $ this ->getMock ('CallableStub ' );
52
52
}
53
53
54
54
protected function createResolverMock ()
@@ -58,3 +58,10 @@ protected function createResolverMock()
58
58
->getMock ();
59
59
}
60
60
}
61
+
62
+ class CallableStub
63
+ {
64
+ public function __invoke ()
65
+ {
66
+ }
67
+ }
You can’t perform that action at this time.
0 commit comments