@@ -51,8 +51,6 @@ public function connectionToTcpServerShouldSucceed()
5151 $ loop = Factory::create ();
5252
5353 $ server = new TcpServer (9999 , $ loop );
54- $ server ->on ('connection ' , $ this ->expectCallableOnce ());
55- $ server ->on ('connection ' , array ($ server , 'close ' ));
5654
5755 $ connector = new TcpConnector ($ loop );
5856
@@ -61,6 +59,7 @@ public function connectionToTcpServerShouldSucceed()
6159 $ this ->assertInstanceOf ('React\Socket\ConnectionInterface ' , $ connection );
6260
6361 $ connection ->close ();
62+ $ server ->close ();
6463 }
6564
6665 /** @test */
@@ -69,7 +68,6 @@ public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget()
6968 $ loop = Factory::create ();
7069
7170 $ server = new TcpServer (9999 , $ loop );
72- $ server ->on ('connection ' , array ($ server , 'close ' ));
7371
7472 $ connector = new TcpConnector ($ loop );
7573
@@ -79,6 +77,7 @@ public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget()
7977 $ this ->assertEquals ('tcp://127.0.0.1:9999 ' , $ connection ->getRemoteAddress ());
8078
8179 $ connection ->close ();
80+ $ server ->close ();
8281 }
8382
8483 /** @test */
@@ -87,7 +86,6 @@ public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost()
8786 $ loop = Factory::create ();
8887
8988 $ server = new TcpServer (9999 , $ loop );
90- $ server ->on ('connection ' , array ($ server , 'close ' ));
9189
9290 $ connector = new TcpConnector ($ loop );
9391
@@ -98,6 +96,7 @@ public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost()
9896 $ this ->assertNotEquals ('tcp://127.0.0.1:9999 ' , $ connection ->getLocalAddress ());
9997
10098 $ connection ->close ();
99+ $ server ->close ();
101100 }
102101
103102 /** @test */
@@ -106,13 +105,13 @@ public function connectionToTcpServerShouldSucceedWithNullAddressesAfterConnecti
106105 $ loop = Factory::create ();
107106
108107 $ server = new TcpServer (9999 , $ loop );
109- $ server ->on ('connection ' , array ($ server , 'close ' ));
110108
111109 $ connector = new TcpConnector ($ loop );
112110
113111 $ connection = Block \await ($ connector ->connect ('127.0.0.1:9999 ' ), $ loop , self ::TIMEOUT );
114112 /* @var $connection ConnectionInterface */
115113
114+ $ server ->close ();
116115 $ connection ->close ();
117116
118117 $ this ->assertNull ($ connection ->getRemoteAddress ());
@@ -165,9 +164,6 @@ public function connectionToIp6TcpServerShouldSucceed()
165164 $ this ->markTestSkipped ('Unable to start IPv6 server socket (IPv6 not supported on this system?) ' );
166165 }
167166
168- $ server ->on ('connection ' , $ this ->expectCallableOnce ());
169- $ server ->on ('connection ' , array ($ server , 'close ' ));
170-
171167 $ connector = new TcpConnector ($ loop );
172168
173169 $ connection = Block \await ($ connector ->connect ('[::1]:9999 ' ), $ loop , self ::TIMEOUT );
@@ -179,6 +175,7 @@ public function connectionToIp6TcpServerShouldSucceed()
179175 $ this ->assertNotEquals ('tcp://[::1]:9999 ' , $ connection ->getLocalAddress ());
180176
181177 $ connection ->close ();
178+ $ server ->close ();
182179 }
183180
184181 /** @test */
0 commit comments