From 5a354ea859cf52dd378ecf5ff3e85307ea3a035c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 12 Sep 2010 08:01:34 +0200 Subject: [PATCH] made a small update to doc and rename a test file --- doc/02-Twig-for-Template-Designers.markdown | 2 +- test/Twig/Tests/Fixtures/tests/const.test | 12 ------------ test/Twig/Tests/Fixtures/tests/constant.test | 12 ++++++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 test/Twig/Tests/Fixtures/tests/const.test create mode 100644 test/Twig/Tests/Fixtures/tests/constant.test diff --git a/doc/02-Twig-for-Template-Designers.markdown b/doc/02-Twig-for-Template-Designers.markdown index f93939b..c0dace8 100644 --- a/doc/02-Twig-for-Template-Designers.markdown +++ b/doc/02-Twig-for-Template-Designers.markdown @@ -1246,7 +1246,7 @@ variable: the foo attribute really is the `false` PHP value {% endif %} -### `constant` +### `constant` (new in Twig 0.9.9) `constant` checks if a variable has the exact same value as a constant. You can use either global constants or class constants: diff --git a/test/Twig/Tests/Fixtures/tests/const.test b/test/Twig/Tests/Fixtures/tests/const.test deleted file mode 100644 index 83d33f4..0000000 --- a/test/Twig/Tests/Fixtures/tests/const.test +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -"const" test ---TEMPLATE-- -{{ 30719 is constant('E_ALL') ? 'ok' : 'no' }} -{{ 'bar' is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} -{{ value is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} ---DATA-- -return array('value' => 'bar'); ---EXPECT-- -ok -ok -ok \ No newline at end of file diff --git a/test/Twig/Tests/Fixtures/tests/constant.test b/test/Twig/Tests/Fixtures/tests/constant.test new file mode 100644 index 0000000..83d33f4 --- /dev/null +++ b/test/Twig/Tests/Fixtures/tests/constant.test @@ -0,0 +1,12 @@ +--TEST-- +"const" test +--TEMPLATE-- +{{ 30719 is constant('E_ALL') ? 'ok' : 'no' }} +{{ 'bar' is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} +{{ value is constant('Foo::BAR_NAME') ? 'ok' : 'no' }} +--DATA-- +return array('value' => 'bar'); +--EXPECT-- +ok +ok +ok \ No newline at end of file -- 1.7.2.5