| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | public function testSendFailure() |
||
| 23 | { |
||
| 24 | // create a connection, kill the udp connection (without changing the socket), attempt to send, should re-connect and send again |
||
| 25 | $client = new Client(); |
||
| 26 | $client->configure(['host' => '127.0.0.1']); |
||
| 27 | |||
| 28 | // create the connection |
||
| 29 | $client->increment('metric', 1); |
||
| 30 | |||
| 31 | // close the socket |
||
| 32 | $reflector = new ReflectionProperty(Client::class, 'socket'); |
||
| 33 | $reflector->setAccessible(true); |
||
| 34 | $socket = $reflector->getValue($client); |
||
| 35 | fclose($socket); |
||
| 36 | |||
| 37 | $client->increment('reconnect', 1); |
||
| 38 | $this->assertEquals('reconnect:1|c', $client->getLastMessage()); |
||
| 39 | |||
| 40 | $this->assertAttributeInternalType('resource', 'socket', $client); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |