From 998b367c0cc9dc8127b50e5d352e01ed96f4436b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 10 Jan 2013 23:37:47 -0500 Subject: [PATCH] Add tests for getting constants from instances. --- test/Twig/Tests/Fixtures/functions/constant.test | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/Twig/Tests/Fixtures/functions/constant.test b/test/Twig/Tests/Fixtures/functions/constant.test index 6d4b374..6312879 100644 --- a/test/Twig/Tests/Fixtures/functions/constant.test +++ b/test/Twig/Tests/Fixtures/functions/constant.test @@ -1,12 +1,10 @@ --TEST-- "constant" function --TEMPLATE-- -{% if constant('DATE_W3C') == expect %} -true -{% else %} -false -{% endif %} +{{ constant('DATE_W3C') == expect ? 'true' : 'false' }} +{{ constant('ARRAY_AS_PROPS', object) }} --DATA-- -return array('expect' => DATE_W3C); +return array('expect' => DATE_W3C, 'object' => new ArrayObject(array('hi'))); --EXPECT-- true +2 -- 1.7.2.5