You are here

public function HIncludeFragmentRendererTest::testRenderWithDefault in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php, line 46

Class

HIncludeFragmentRendererTest

Namespace

Symfony\Component\HttpKernel\Tests\Fragment

Code

public function testRenderWithDefault() {

  // only default
  $strategy = new HIncludeFragmentRenderer();
  $this
    ->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy
    ->render('/foo', Request::create('/'), array(
    'default' => 'default',
  ))
    ->getContent());

  // only global default
  $strategy = new HIncludeFragmentRenderer(null, null, 'global_default');
  $this
    ->assertEquals('<hx:include src="/foo">global_default</hx:include>', $strategy
    ->render('/foo', Request::create('/'), array())
    ->getContent());

  // global default and default
  $strategy = new HIncludeFragmentRenderer(null, null, 'global_default');
  $this
    ->assertEquals('<hx:include src="/foo">default</hx:include>', $strategy
    ->render('/foo', Request::create('/'), array(
    'default' => 'default',
  ))
    ->getContent());
}