From: Tobias Schultze Date: Fri, 31 Jan 2014 14:53:51 +0000 (+0100) Subject: added test for accessing xml attributes X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=bdbc56d385621f53b14424b37def75237deba065;p=web%2Fkonrad%2Ftwig.git added test for accessing xml attributes --- diff --git a/test/Twig/Tests/Fixtures/regression/simple_xml_element.test b/test/Twig/Tests/Fixtures/regression/simple_xml_element.test index 61babef..60c3c51 100644 --- a/test/Twig/Tests/Fixtures/regression/simple_xml_element.test +++ b/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('foobar')) +return array('images' => new SimpleXMLElement('foobar')) --EXPECT-- Hello 'foo'! +example 2 - foo - bar