added a test for method chain calls
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 17:10:22 +0000 (17:10 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 17:10:22 +0000 (17:10 +0000)
git-svn-id: http://svn.twig-project.org/trunk@36 93ef8e89-cb99-4229-a87c-7fa0fa45744b

test/fixtures/expressions/method_call.test
test/unit/integrationTest.php

index adea3b3..14674b8 100644 (file)
@@ -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
index cb5e14e..ee2f098 100644 (file)
@@ -28,6 +28,11 @@ class Foo
   {
     return 'foo';
   }
+
+  public function getSelf()
+  {
+    return $this;
+  }
 }
 
 $t = new LimeTest(44);