private function retryFailedConnection(puzzle_adapter_TransactionInterface $transaction, puzzle_adapter_curl_BatchContext $context) { // Add the request back to the batch to retry automatically. $context->addTransaction($transaction, $this->curlFactory->__invoke($transaction, $this->messageFactory)); }
/** * Hack to enable PHP 5.2 unit tests. Do not use in production! */ public static function __enableTestMode() { self::$_TEST_MODE = true; }
/** * @expectedException puzzle_exception_AdapterException */ public function testThrowsForStreamOption() { $request = new puzzle_message_Request('GET', puzzle_test_Server::$url . 'haha'); $request->getConfig()->set('stream', true); $t = new puzzle_adapter_Transaction(new puzzle_Client(), $request); $f = new puzzle_adapter_curl_CurlFactory(); $f->__invoke($t, new puzzle_message_MessageFactory()); }