You are here

public function Twig_Tests_TemplateTest::testGetAttributeWithTemplateAsObject in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/TemplateTest.php \Twig_Tests_TemplateTest::testGetAttributeWithTemplateAsObject()

@dataProvider getGetAttributeWithTemplateAsObject

File

vendor/twig/twig/test/Twig/Tests/TemplateTest.php, line 141

Class

Twig_Tests_TemplateTest

Code

public function testGetAttributeWithTemplateAsObject($useExt) {
  $template = new Twig_TemplateTest(new Twig_Environment($this
    ->getMock('Twig_LoaderInterface')), $useExt);
  $template1 = new Twig_TemplateTest(new Twig_Environment($this
    ->getMock('Twig_LoaderInterface')), false);
  $this
    ->assertInstanceof('Twig_Markup', $template
    ->getAttribute($template1, 'string'));
  $this
    ->assertEquals('some_string', $template
    ->getAttribute($template1, 'string'));
  $this
    ->assertInstanceof('Twig_Markup', $template
    ->getAttribute($template1, 'true'));
  $this
    ->assertEquals('1', $template
    ->getAttribute($template1, 'true'));
  $this
    ->assertInstanceof('Twig_Markup', $template
    ->getAttribute($template1, 'zero'));
  $this
    ->assertEquals('0', $template
    ->getAttribute($template1, 'zero'));
  $this
    ->assertNotInstanceof('Twig_Markup', $template
    ->getAttribute($template1, 'empty'));
  $this
    ->assertSame('', $template
    ->getAttribute($template1, 'empty'));
  $this
    ->assertFalse($template
    ->getAttribute($template1, 'env', array(), Twig_Template::ANY_CALL, true));
  $this
    ->assertFalse($template
    ->getAttribute($template1, 'environment', array(), Twig_Template::ANY_CALL, true));
  $this
    ->assertFalse($template
    ->getAttribute($template1, 'getEnvironment', array(), Twig_Template::METHOD_CALL, true));
  $this
    ->assertFalse($template
    ->getAttribute($template1, 'displayWithErrorHandling', array(), Twig_Template::METHOD_CALL, true));
}