@@ 182-196 (lines=15) @@ | ||
179 | $client->execute('aCommand'); |
|
180 | } |
|
181 | ||
182 | public function testWriteException() |
|
183 | { |
|
184 | $this->setExpectedException(TelnetExceptionInterface::class); |
|
185 | ||
186 | $client = m::mock(TelnetClient::class)->makePartial(); |
|
187 | ||
188 | $socket = m::mock(Socket::class) |
|
189 | ->shouldReceive('write') |
|
190 | ->andThrow(\Exception::class) |
|
191 | ->shouldReceive('close') |
|
192 | ->getMock(); |
|
193 | ||
194 | $client->setSocket($socket); |
|
195 | $client->execute('aCommand'); |
|
196 | } |
|
197 | ||
198 | public function testReadException() |
|
199 | { |
|
@@ 198-213 (lines=16) @@ | ||
195 | $client->execute('aCommand'); |
|
196 | } |
|
197 | ||
198 | public function testReadException() |
|
199 | { |
|
200 | $this->setExpectedException(TelnetExceptionInterface::class); |
|
201 | ||
202 | $client = m::mock(TelnetClient::class)->makePartial(); |
|
203 | ||
204 | $socket = m::mock(Socket::class) |
|
205 | ->shouldReceive('write') |
|
206 | ->shouldReceive('close') |
|
207 | ->shouldReceive('read') |
|
208 | ->andThrow(\Exception::class) |
|
209 | ->getMock(); |
|
210 | ||
211 | $client->setSocket($socket); |
|
212 | $client->execute('aCommand'); |
|
213 | } |
|
214 | ||
215 | public function testFactory() |
|
216 | { |