lithium\tests\cases\template\ViewTest::testNolayout PHP Method

testNolayout() public method

public testNolayout ( )
    public function testNolayout()
    {
        $view = new View(array('loader' => 'lithium\\tests\\mocks\\template\\view\\adapters\\TestRenderer', 'renderer' => 'lithium\\tests\\mocks\\template\\view\\adapters\\TestRenderer', 'paths' => array('template' => '{:library}/tests/mocks/template/view/adapters/{:template}.html.php', 'layout' => false)));
        $options = array('template' => 'testFile', 'library' => Libraries::get('lithium', 'path'));
        $result = $view->render('all', array(), $options);
        $expected = 'This is a test.';
        $this->assertEqual($expected, $result);
        $templateData = TestRenderer::$templateData;
        $expectedPath = Libraries::get('lithium', 'path');
        $expectedPath .= '/tests/mocks/template/view/adapters/testFile.html.php';
        $expected = array(array('type' => 'template', 'params' => array('template' => 'testFile', 'library' => Libraries::get('lithium', 'path'), 'type' => 'html'), 'return' => $expectedPath));
        $this->assertEqual($expected, $templateData);
        $renderData = TestRenderer::$renderData;
        $expected = array(array('template' => $expectedPath, 'data' => array(), 'options' => array('template' => 'testFile', 'library' => $options['library'], 'type' => 'html', 'layout' => null, 'context' => array())));
        $this->assertInstanceOf('Closure', $renderData[0]['data']['h']);
        unset($renderData[0]['data']['h']);
        $this->assertEqual($expected, $renderData);
    }