public function testUnregisteredKeyThrowsException() { $instance = new RequestResponse(); $this->setExpectedException('InvalidArgumentException'); $instance->get('Foo'); }
private function postResponseToCallback(RequestResponse $requestResponse) { $requestResponse->set('requestProcTime', microtime(true) - $requestResponse->get('requestProcTime')); if (is_callable($this->getOption(ONOI_HTTP_REQUEST_ON_COMPLETED_CALLBACK)) && $requestResponse->get('wasCompleted')) { call_user_func_array($this->getOption(ONOI_HTTP_REQUEST_ON_COMPLETED_CALLBACK), array($requestResponse)); } if (is_callable($this->getOption(ONOI_HTTP_REQUEST_ON_FAILED_CALLBACK)) && (!$requestResponse->get('wasCompleted') || !$requestResponse->get('wasAccepted'))) { call_user_func_array($this->getOption(ONOI_HTTP_REQUEST_ON_FAILED_CALLBACK), array($requestResponse)); } }