Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2013 12:12
Show Gist options
  • Save anonymous/6306405 to your computer and use it in GitHub Desktop.
Save anonymous/6306405 to your computer and use it in GitHub Desktop.
/**
*
*/
public function myTestWithNumber()
{
// Mock Service:
$mockService = $this->getMockBuilder('myService')
->disableOriginalConstructor()
->getMock();
$mockService->expects($this->atLeastOnce())
->method('getUserById')
->will($this->returnValue(false));
$controller = new Controller($mockService, array());
$result = $controller->indexAction();
// Assertions:
$this->assertInstanceOf(
'Zend\View\Model\ViewModel',
$result,
'index action with no ID did not return ViewModel'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment