public function testProvidesGetters() { $m = curl_multi_init(); $b = new puzzle_adapter_curl_BatchContext($m, true); $this->assertTrue($b->throwsExceptions()); $this->assertSame($m, $b->getMultiHandle()); $this->assertFalse($b->hasPending()); curl_multi_close($m); }
private function throwException(Exception $e, puzzle_adapter_curl_BatchContext $context) { if ($context->throwsExceptions() || $e instanceof puzzle_exception_RequestException && $e->getThrowImmediately()) { $context->removeAll(); $this->releaseMultiHandle($context->getMultiHandle()); throw $e; } }