public function testResponseValue() { $response = new Sabel_Response_Object(); $response->setResponse("a", "10"); $response->setResponse("b", "20"); $this->assertEquals("10", $response->getResponse("a")); $this->assertEquals("20", $response->getResponse("b")); $this->assertEquals(null, $response->getResponse("c")); }
public function testProcess() { $bus = $this->bus; $response = new Sabel_Response_Object(); $response->setResponse("a", "1"); $response->setResponse("b", "2"); $controller = new ResponseTestController($response); $controller->setAttribute("b", "3"); $controller->setAttribute("c", "4"); $bus->set("controller", $controller); $bus->set("response", $response); $processor = new Processor_Response("response"); $processor->afterAction($bus); $responses = $bus->get("response")->getResponses(); $this->assertEquals("1", $responses["a"]); $this->assertEquals("3", $responses["b"]); $this->assertEquals("4", $responses["c"]); $this->assertFalse(isset($responses["d"])); }