sanpii/behatch-contexts — pull request #45 by mgaskill (2013-12-24 23:42:15+00:00)
Title: Validations for XML elements and attributes

Added validations similar to those found in the JSON context.

The following sentences are added in this PR:
* the response should be in XML
* the response should not be in XML
* the XML element "(?P[^"]*)" should exists?
* the XML element "(?P[^"]*)" should not exists?
* the XML element "(?P(?:[^"]|\\")*)" should be equal to "(?P

[^"]*)"
* the XML element "(?P(?:[^"]|\\")*)" should not be equal to "(?P

[^"]*)"
* the XML attribute "(?P[^"]*)" on element "(?P(?:[^"]|\\")*)" should exists?
* the XML attribute "(?P[^"]*)" on element "(?P(?:[^"]|\\")*)" should not exists?
* the XML attribute "(?P[^"]*)" on element "(?P(?:[^"]|\\")*)" should be equal to "(?P

[^"]*)"
* the XML attribute "(?P[^"]*)" on element "(?P(?:[^"]|\\")*)" should not be equal to "(?P

[^"]*)"
* the XML element "(?P[^"]*)" should have (?P\d+) elements?
* the XML element "(?P[^"]*)" should contain "(?P

[^"]*)"
* the XML element "(?P[^"]*)" should not contain "(?P

[^"]*)"

Scenarios have been added to test each of these sentences. The 'book.xml' fixture is added as the canonical XML example from the PHP documentation, which can be found at: http://www.php.net/manual/en/dom.examples.php