ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
NativeExtensionTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of Twig.
5  *
6  * (c) Fabien Potencier
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 class Twig_Tests_NativeExtensionTest extends \PHPUnit\Framework\TestCase
13 {
17  public function testGetProperties()
18  {
19  $twig = new Twig_Environment(new Twig_Loader_Array(array('index' => '{{ d1.date }}{{ d2.date }}')), array(
20  'debug' => true,
21  'cache' => false,
22  'autoescape' => false,
23  ));
24 
25  $d1 = new DateTime();
26  $d2 = new DateTime();
27  $output = $twig->render('index', compact('d1', 'd2'));
28 
29  // If it fails, PHP will crash.
30  $this->assertEquals($output, $d1->date.$d2->date);
31  }
32 }
Stores the Twig configuration.
Definition: Environment.php:17
Loads a template from an array.
Definition: Array.php:26