/** * @expectedException \RuntimeException * @expectedExceptionMessage Transaction not registered */ public function testThrowsWhenRemovingNonExistentTransaction() { $b = new BatchContext('foo', false); $t = new Transaction(new Client(), new Request('GET', 'http://httbin.org')); $b->removeTransaction($t); }
private function processResponse(TransactionInterface $transaction, array $curl, BatchContext $context) { $info = $context->removeTransaction($transaction); try { if (!$this->isCurlException($transaction, $curl, $context, $info) && $this->validateResponseWasSet($transaction, $context)) { RequestEvents::emitComplete($transaction, $info); } } catch (\Exception $e) { $this->throwException($e, $context); } }