You are here

public function EsiFragmentRendererTest::testRenderControllerReference 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::testRenderControllerReference()

File

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

Class

EsiFragmentRendererTest

Namespace

Symfony\Component\HttpKernel\Tests\Fragment

Code

public function testRenderControllerReference() {
  $signer = new UriSigner('foo');
  $strategy = new EsiFragmentRenderer(new Esi(), $this
    ->getInlineStrategy(), $signer);
  $request = Request::create('/');
  $request
    ->setLocale('fr');
  $request->headers
    ->set('Surrogate-Capability', 'ESI/1.0');
  $reference = new ControllerReference('main_controller', array(), array());
  $altReference = new ControllerReference('alt_controller', array(), array());
  $this
    ->assertEquals('<esi:include src="/_fragment?_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller&_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D" alt="/_fragment?_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller&_hash=iPJEdRoUpGrM1ztqByiorpfMPtiW%2FOWwdH1DBUXHhEc%3D" />', $strategy
    ->render($reference, $request, array(
    'alt' => $altReference,
  ))
    ->getContent());
}