]>
Commit | Line | Data |
---|---|---|
4f5b44bd NL |
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 | public function testGetProperties() | |
15 | { | |
16 | $twig = new Twig_Environment(new Twig_Loader_String(), array( | |
17 | 'debug' => true, | |
18 | 'cache' => false, | |
19 | 'autoescape' => false | |
20 | )); | |
21 | ||
22 | $d1 = new DateTime(); | |
23 | $d2 = new DateTime(); | |
24 | $output = $twig->render('{{ d1.date }}{{ d2.date }}', compact('d1', 'd2')); | |
25 | ||
26 | // If it fails, PHP will crash. | |
27 | $this->assertEquals($output, $d1->date . $d2->date); | |
28 | } | |
29 | } |