attribute.test 280B

12345678910111213
  1. --TEST--
  2. "attribute" function
  3. --TEMPLATE--
  4. {{ attribute(obj, method) }}
  5. {{ attribute(array, item) }}
  6. {{ attribute(obj, "bar", ["a", "b"]) }}
  7. --DATA--
  8. return array('obj' => new Foo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo')
  9. --EXPECT--
  10. foo
  11. bar
  12. bar_a-b