From dfc335fd4e9dddcafe43cb814e4910310fa337b2 Mon Sep 17 00:00:00 2001 From: Tugdual Saunier Date: Tue, 23 Jul 2013 21:45:47 +0200 Subject: [PATCH] Added test case for issue #1143 --- .../Twig/Tests/Fixtures/regression/issue_1143.test | 23 ++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 test/Twig/Tests/Fixtures/regression/issue_1143.test diff --git a/test/Twig/Tests/Fixtures/regression/issue_1143.test b/test/Twig/Tests/Fixtures/regression/issue_1143.test new file mode 100644 index 0000000..ff7c8bb --- /dev/null +++ b/test/Twig/Tests/Fixtures/regression/issue_1143.test @@ -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 -- 1.7.2.5