From: fabien Date: Mon, 12 Oct 2009 17:10:22 +0000 (+0000) Subject: added a test for method chain calls X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=ad12473dcb16310ebc70b0bd8d00092be6d36f08;p=konrad%2Ftwig.git added a test for method chain calls git-svn-id: http://svn.twig-project.org/trunk@36 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- diff --git a/test/fixtures/expressions/method_call.test b/test/fixtures/expressions/method_call.test index adea3b3..14674b8 100644 --- a/test/fixtures/expressions/method_call.test +++ b/test/fixtures/expressions/method_call.test @@ -2,15 +2,19 @@ Twig supports method calls --TEMPLATE-- {{ items.foo.foo }} +{{ items.foo.getFoo() }} {{ items.foo.bar }} {{ items.foo['bar'] }} {{ items.foo.bar('a', 43) }} {{ items.foo.bar(foo) }} +{{ items.foo.self.foo() }} --DATA-- return array('foo' => 'bar', 'items' => array('foo' => new Foo(), 'bar' => 'foo')) --EXPECT-- foo +foo bar bar_a-43 bar_bar +foo diff --git a/test/unit/integrationTest.php b/test/unit/integrationTest.php index cb5e14e..ee2f098 100644 --- a/test/unit/integrationTest.php +++ b/test/unit/integrationTest.php @@ -28,6 +28,11 @@ class Foo { return 'foo'; } + + public function getSelf() + { + return $this; + } } $t = new LimeTest(44);