PHPUnit and Zend Framework assertRedirectTo() issue
问题 I'm having an issue with assertRedirectTo() in a test I have created, below is the code I have used: public function testLoggedInIndexAction() { $this->dispatch('/'); $this->assertController('index'); $this->resetResponse(); $this->request->setPost(array( 'type' => 'login', 'username' => 'root', 'password' => 'asdasd', )); $this->request->setMethod('POST'); $this->dispatch('/'); $this->assertRedirectTo('/feed/'); } You log in through / (index.php/) and submit post details there and the it