From: Mark Story Date: Fri, 11 Jan 2013 04:37:47 +0000 (-0500) Subject: Add tests for getting constants from instances. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=998b367c0cc9dc8127b50e5d352e01ed96f4436b;p=web%2Fkonrad%2Ftwig.git Add tests for getting constants from instances. --- 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