You are here

public function EsiFragmentRendererTest::testRender in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php \Symfony\Component\HttpKernel\Tests\Fragment\EsiFragmentRendererTest::testRender()

File

vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php, line 34

Class

EsiFragmentRendererTest

Namespace

Symfony\Component\HttpKernel\Tests\Fragment

Code

public function testRender() {
  $strategy = new EsiFragmentRenderer(new Esi(), $this
    ->getInlineStrategy());
  $request = Request::create('/');
  $request
    ->setLocale('fr');
  $request->headers
    ->set('Surrogate-Capability', 'ESI/1.0');
  $this
    ->assertEquals('<esi:include src="/" />', $strategy
    ->render('/', $request)
    ->getContent());
  $this
    ->assertEquals("<esi:comment text=\"This is a comment\" />\n<esi:include src=\"/\" />", $strategy
    ->render('/', $request, array(
    'comment' => 'This is a comment',
  ))
    ->getContent());
  $this
    ->assertEquals('<esi:include src="/" alt="foo" />', $strategy
    ->render('/', $request, array(
    'alt' => 'foo',
  ))
    ->getContent());
}