eZ\Publish\Core\MVC\Symfony\View\Tests\ViewManagerTest::testRenderContent PHP Method

testRenderContent() public method

public testRenderContent ( )
    public function testRenderContent()
    {
        $content = new Content(['versionInfo' => new VersionInfo(['contentInfo' => new ContentInfo()])]);
        $params = ['foo' => 'bar'];
        $templateIdentifier = 'foo:bar:baz';
        $this->viewConfigurator->expects($this->once())->method('configure')->will($this->returnCallback(function (View $view) use($templateIdentifier) {
            $view->setTemplateIdentifier($templateIdentifier);
        }));
        // Configuring template engine behaviour
        $expectedTemplateResult = 'This is content rendering';
        $this->templateEngineMock->expects($this->once())->method('render')->with($templateIdentifier, $params + array('content' => $content, 'viewbaseLayout' => $this->viewBaseLayout))->will($this->returnValue($expectedTemplateResult));
        self::assertSame($expectedTemplateResult, $this->viewManager->renderContent($content, 'customViewType', $params));
    }