Sfoglia il codice sorgente

Context::find Failing test

Closures don't like it when you touch their properties.
Justin Hileman 13 anni fa
parent
commit
83cf3158ae

+ 30 - 0
test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php

@@ -0,0 +1,30 @@
+<?php
+
+/*
+ * This file is part of Mustache.php.
+ *
+ * (c) 2012 Justin Hileman
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * @group lambdas
+ * @group functional
+ */
+class Mustache_Test_FiveThree_Functional_ClosuresQuirksTest extends PHPUnit_Framework_TestCase
+{
+    private $mustache;
+
+    public function setUp()
+    {
+        $this->mustache = new Mustache_Engine;
+    }
+
+    public function testClosuresDontLikeItWhenYouTouchTheirProperties()
+    {
+        $tpl = $this->mustache->loadTemplate('{{ foo.bar }}');
+        $this->assertEquals('', $tpl->render(array('foo' => function() { return 'FOO'; })));
+    }
+}