| @@ 256-270 (lines=15) @@ | ||
| 253 | $client->execute('aCommand'); |
|
| 254 | } |
|
| 255 | ||
| 256 | public function testWriteException() |
|
| 257 | { |
|
| 258 | $this->setExpectedException(TelnetExceptionInterface::class); |
|
| 259 | ||
| 260 | $client = m::mock(TelnetClient::class)->makePartial(); |
|
| 261 | ||
| 262 | $socket = m::mock(Socket::class) |
|
| 263 | ->shouldReceive('write') |
|
| 264 | ->andThrow(Exception::class) |
|
| 265 | ->shouldReceive('close') |
|
| 266 | ->getMock(); |
|
| 267 | ||
| 268 | $client->setSocket($socket); |
|
| 269 | $client->execute('aCommand'); |
|
| 270 | } |
|
| 271 | ||
| 272 | public function testReadException() |
|
| 273 | { |
|
| @@ 272-287 (lines=16) @@ | ||
| 269 | $client->execute('aCommand'); |
|
| 270 | } |
|
| 271 | ||
| 272 | public function testReadException() |
|
| 273 | { |
|
| 274 | $this->setExpectedException(TelnetExceptionInterface::class); |
|
| 275 | ||
| 276 | $client = m::mock(TelnetClient::class)->makePartial(); |
|
| 277 | ||
| 278 | $socket = m::mock(Socket::class) |
|
| 279 | ->shouldReceive('write') |
|
| 280 | ->shouldReceive('close') |
|
| 281 | ->shouldReceive('read') |
|
| 282 | ->andThrow(Exception::class) |
|
| 283 | ->getMock(); |
|
| 284 | ||
| 285 | $client->setSocket($socket); |
|
| 286 | $client->execute('aCommand'); |
|
| 287 | } |
|
| 288 | ||
| 289 | public function testFactory() |
|
| 290 | { |
|