public function testInvoke() { $url = 'someUrl'; $this->routeMatch->expects($this->once())->method('getMatchedRouteName')->will($this->returnValue('someRoute')); $headers = $this->getMock('Zend\\Http\\Headers'); $headers->expects($this->once())->method('addHeaderLine')->with('Location', $url); $this->router->expects($this->any())->method('assemble')->with(array(), array('name' => 'zfcuser'))->will($this->returnValue($url)); $this->response->expects($this->once())->method('getHeaders')->will($this->returnValue($headers)); $this->response->expects($this->once())->method('setStatusCode')->with(302); $result = $this->redirectCallback->__invoke(); $this->assertSame($this->response, $result); }