Skip to content

Commit

Permalink
[#1] Update ActionController tests
Browse files Browse the repository at this point in the history
- Tests now recognize that return value from notFoundAction() is a
  ViewModel
  • Loading branch information
weierophinney committed Feb 19, 2012
1 parent 78ba1dc commit e23c369
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/Zend/Mvc/Controller/ActionControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ public function testDispatchInvokesNotFoundActionWhenNoActionPresentInRouteMatch
$result = $this->controller->dispatch($this->request, $this->response);
$response = $this->controller->getResponse();
$this->assertEquals(404, $response->getStatusCode());
$this->assertTrue(isset($result['content']));
$this->assertContains('Page not found', $result['content']);
$this->assertInstanceOf('Zend\View\Model', $result);
$this->assertEquals('content', $result->captureTo());
$vars = $result->getVariables();
$this->assertArrayHasKey('content', $vars, var_export($vars, 1));
$this->assertContains('Page not found', $vars['content']);
}

public function testDispatchInvokesNotFoundActionWhenInvalidActionPresentInRouteMatch()
Expand All @@ -44,8 +47,11 @@ public function testDispatchInvokesNotFoundActionWhenInvalidActionPresentInRoute
$result = $this->controller->dispatch($this->request, $this->response);
$response = $this->controller->getResponse();
$this->assertEquals(404, $response->getStatusCode());
$this->assertTrue(isset($result['content']));
$this->assertContains('Page not found', $result['content']);
$this->assertInstanceOf('Zend\View\Model', $result);
$this->assertEquals('content', $result->captureTo());
$vars = $result->getVariables();
$this->assertArrayHasKey('content', $vars, var_export($vars, 1));
$this->assertContains('Page not found', $vars['content']);
}

public function testDispatchInvokesProvidedActionWhenMethodExists()
Expand Down

0 comments on commit e23c369

Please sign in to comment.