Skip to content

Commit

Permalink
added test for accessing xml attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Jan 31, 2014
1 parent e9e4748 commit bdbc56d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/Twig/Tests/Fixtures/regression/simple_xml_element.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 bdbc56d

Please sign in to comment.