Security update to Drupal 8.4.6
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / NativeExtensionTest.php
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 {
14     /**
15      * @requires PHP 5.3
16      */
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 }