From 623fac04bebaaa02c672def35dad6ae90280e6cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Haso=C5=88?= Date: Thu, 16 Feb 2012 10:55:45 +0100 Subject: [PATCH] Fixed test for "dump" function if xdebug>2.2 is loaded --- test/Twig/Tests/Fixtures/functions/dump.test | 10 ---------- test/Twig/Tests/Fixtures/functions/dump_array.test | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 test/Twig/Tests/Fixtures/functions/dump_array.test diff --git a/test/Twig/Tests/Fixtures/functions/dump.test b/test/Twig/Tests/Fixtures/functions/dump.test index cf6acf8..371a587 100644 --- a/test/Twig/Tests/Fixtures/functions/dump.test +++ b/test/Twig/Tests/Fixtures/functions/dump.test @@ -1,7 +1,6 @@ --TEST-- "dump" function --TEMPLATE-- -{{ dump() }} {{ dump('foo') }} {{ dump('foo', 'bar') }} --DATA-- @@ -9,15 +8,6 @@ return array('foo' => 'foo', 'bar' => 'bar') --CONFIG-- return array('debug' => true, 'autoescape' => false); --EXPECT-- -array(3) { - ["foo"]=> - string(3) "foo" - ["bar"]=> - string(3) "bar" - ["global"]=> - string(6) "global" -} - string(3) "foo" string(3) "foo" diff --git a/test/Twig/Tests/Fixtures/functions/dump_array.test b/test/Twig/Tests/Fixtures/functions/dump_array.test new file mode 100644 index 0000000..889b7a9 --- /dev/null +++ b/test/Twig/Tests/Fixtures/functions/dump_array.test @@ -0,0 +1,19 @@ +--TEST-- +"dump" function, xdebug is not loaded or xdebug <2.2-dev is loaded +--CONDITION-- +!extension_loaded('xdebug') || (($r = new ReflectionExtension('xdebug')) && version_compare($r->getVersion(), '2.2-dev', '<')) +--TEMPLATE-- +{{ dump() }} +--DATA-- +return array('foo' => 'foo', 'bar' => 'bar') +--CONFIG-- +return array('debug' => true, 'autoescape' => false); +--EXPECT-- +array(3) { + ["foo"]=> + string(3) "foo" + ["bar"]=> + string(3) "bar" + ["global"]=> + string(6) "global" +} -- 1.7.2.5