Permalink
Browse files

minor twigphp#1329 added test for accessing xml attributes (Tobion)

This PR was merged into the 1.15-dev branch.

Discussion
----------

added test for accessing xml attributes

Closes twigphp#1328

Commits
-------

bdbc56d added test for accessing xml attributes
  • Loading branch information...
fabpot committed Jan 31, 2014
2 parents e9e4748 + bdbc56d commit 5fd4db64de8398dedf5fcde3ec9c0dfdc910c81b
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/Twig/Tests/Fixtures/regression/simple_xml_element.test
@@ -4,14 +4,16 @@ Twig is able to deal with SimpleXMLElement instances as variables
version_compare(phpversion(), '5.3.0', '>=')
--TEMPLATE--
Hello '{{ images.image.0.group }}'!
{{ images.image.0.group.attributes.myattr }}
{{ images.children().image.count() }}
{% for image in images %}
- {{ image.group }}
{% endfor %}
--DATA--
return array('images' => new SimpleXMLElement('<images><image><group>foo</group></image><image><group>bar</group></image></images>'))
return array('images' => new SimpleXMLElement('<images><image><group myattr="example">foo</group></image><image><group>bar</group></image></images>'))
--EXPECT--
Hello 'foo'!
example
2
- foo
- bar

0 comments on commit 5fd4db6

Please sign in to comment.