Added test case for issue #1143
authorTugdual Saunier <tugdual.saunier@gmail.com>
Tue, 23 Jul 2013 19:45:47 +0000 (21:45 +0200)
committerTugdual Saunier <tugdual.saunier@gmail.com>
Tue, 23 Jul 2013 20:04:57 +0000 (22:04 +0200)
test/Twig/Tests/Fixtures/regression/issue_1143.test [new file with mode: 0644]

diff --git a/test/Twig/Tests/Fixtures/regression/issue_1143.test b/test/Twig/Tests/Fixtures/regression/issue_1143.test
new file mode 100644 (file)
index 0000000..ff7c8bb
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+error in twig extension
+--TEMPLATE--
+{{ object.region is not null ? object.regionChoices[object.region] }}
+--DATA--
+class House
+{
+    const REGION_S = 1;
+    const REGION_P = 2;
+
+    public static $regionChoices = array(self::REGION_S => 'house.region.s', self::REGION_P => 'house.region.p');
+
+    public function getRegionChoices()
+    {
+        return self::$regionChoices;
+    }
+}
+
+$object = new House();
+$object->region = 1;
+return array('object' => $object)
+--EXPECT--
+house.region.s