public function testSetGetValue() { $instance = new RequestResponse(); $this->assertFalse($instance->has('Foo')); $instance->set('Foo', 42); $this->assertEquals(42, $instance->get('Foo')); $this->assertEquals(array('Foo' => 42), $instance->getList()); }
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)); } }