eZ\Publish\Core\MVC\Symfony\FieldType\Tests\RichText\RendererTest::testRenderTagWithTemplate PHP Метод

testRenderTagWithTemplate() публичный Метод

public testRenderTagWithTemplate ( $tagName, array $configResolverParams, array $loggerParams, $templateEngineTemplate, $renderTemplate, $isInline, $renderResult )
$configResolverParams array
$loggerParams array
    public function testRenderTagWithTemplate($tagName, array $configResolverParams, array $loggerParams, $templateEngineTemplate, $renderTemplate, $isInline, $renderResult)
    {
        $renderer = $this->getMockedRenderer(array('render'));
        $parameters = array('parameters');
        if (!isset($renderTemplate)) {
            $renderer->expects($this->never())->method('render');
        } else {
            $renderer->expects($this->once())->method('render')->with($renderTemplate, $parameters)->will($this->returnValue($renderResult));
        }
        if (!isset($templateEngineTemplate)) {
            $this->templateEngineMock->expects($this->never())->method($this->anything());
        } else {
            $this->templateEngineMock->expects($this->once())->method('exists')->with($templateEngineTemplate)->will($this->returnValue(true));
        }
        if (empty($configResolverParams)) {
            $this->configResolverMock->expects($this->never())->method($this->anything());
        } else {
            $i = 0;
            foreach ($configResolverParams as $params) {
                $method = $params[0];
                $namespace = $params[1];
                $returnValue = $params[2];
                $this->configResolverMock->expects($this->at($i))->method($method)->with($namespace)->will($this->returnValue($returnValue));
                ++$i;
            }
        }
        if (empty($loggerParams)) {
            $this->loggerMock->expects($this->never())->method($this->anything());
        } else {
            $i = 0;
            foreach ($loggerParams as $params) {
                $method = $params[0];
                $message = $params[1];
                $this->loggerMock->expects($this->at($i))->method($method)->with($message);
                ++$i;
            }
        }
        $this->assertEquals($renderResult, $renderer->renderTag($tagName, $parameters, $isInline));
    }