File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,31 @@ public function testClientEndAgainWillNotBlock(Socket $client)
6060 {
6161 $ client ->end ();
6262 $ 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 ();
6388 }
6489
6590 public function testCreatePair ()
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ protected function expectCallableNever()
4848
4949 protected function createCallableMock ()
5050 {
51- return $ this ->getMock ('React\Tests\Socket\Stub\ CallableStub ' );
51+ return $ this ->getMock ('CallableStub ' );
5252 }
5353
5454 protected function createResolverMock ()
@@ -58,3 +58,10 @@ protected function createResolverMock()
5858 ->getMock ();
5959 }
6060}
61+
62+ class CallableStub
63+ {
64+ public function __invoke ()
65+ {
66+ }
67+ }
You can’t perform that action at this time.
0 commit comments