Exemplo n.º 1
0
 public function testGetConnectionThatHasErroredButIsDueRetry()
 {
     $identifier = 'id-123';
     $command = 'stats';
     $connection = $this->getMockConnection($identifier);
     $connection->expects($this->any())->method($command)->will($this->throwException(new RuntimeException()));
     $collection = new Collection([$connection], $this->strategy, ['retry_delay' => 0]);
     try {
         $collection->sendToExact($identifier, $command);
     } catch (\Exception $e) {
         // void
     }
     $this->assertSame($connection, $collection->getConnection($identifier));
 }