diff options
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php')
-rw-r--r-- | vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php new file mode 100644 index 00000000..3fafd335 --- /dev/null +++ b/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php | |||
@@ -0,0 +1,29 @@ | |||
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 | } | ||