/** * @expectedException \Exception * @expectedExceptionMessage foo */ public function testThrowException() { $exception = new \Exception('foo'); $this->wrappedConnection->expects($this->atLeastOnce())->method('open')->will($this->onConsecutiveCalls($this->throwException($exception), 'salt')); $connection = new Retryable($this->wrappedConnection, 2); $connection->open(); }
/** * @dataProvider provideCallbackData */ public function testOpenConnectionBeforeSend($methodName, array $methodArgs) { $this->connection->expects($this->once())->method('isClosed')->will($this->returnValue(true)); $this->connection->expects($this->once())->method('open'); call_user_func_array([$this->client, $methodName], $methodArgs); }