1234567891011121314151617181920212223242526272829303132 |
- <?php
- class Default404PageTest extends PHPUnit_Framework_TestCase
- {
- private $testObj;
- private $twig;
- public function setUp()
- {
- $this->twig = $this->getMockBuilder('TwigWrapper')
- ->disableOriginalConstructor()
- ->getMock();
- $this->testObj = new Default404Page($this->twig);
- }
- public function tearDown()
- {
- }
- public function testDisplayDisplaysThe404Template()
- {
- $expected = TestUtils::getRandomString(20);
- $this->twig->expects($this->once())
- ->method('render')
- ->with('404page.html', array())
- ->willReturn($expected);
-
- // train mock
- $actual = $this->testObj->display();
- $this->assertEquals($expected, $actual);
- }
- }
|