|
@@ 115-122 (lines=8) @@
|
| 112 |
|
* |
| 113 |
|
* @Then /^the XML element "(?P<element>(?:[^"]|\\")*)" should be equal to "(?P<text>[^"]*)"$/ |
| 114 |
|
*/ |
| 115 |
|
public function theXmlElementShouldBeEqualTo($element, $text) |
| 116 |
|
{ |
| 117 |
|
$elements = $this->theXmlElementShouldExist($element); |
| 118 |
|
$actual = $elements->item(0)->nodeValue; |
| 119 |
|
if ($text != $actual) { |
| 120 |
|
throw new \Exception(sprintf("The element value is `%s`", $actual)); |
| 121 |
|
} |
| 122 |
|
} |
| 123 |
|
|
| 124 |
|
/** |
| 125 |
|
* Checks that the specified XML element is not equal to the given value |
|
@@ 129-136 (lines=8) @@
|
| 126 |
|
* |
| 127 |
|
* @Then /^the XML element "(?P<element>(?:[^"]|\\")*)" should not be equal to "(?P<text>[^"]*)"$/ |
| 128 |
|
*/ |
| 129 |
|
public function theXmlElementShouldNotBeEqualTo($element, $text) |
| 130 |
|
{ |
| 131 |
|
$elements = $this->theXmlElementShouldExist($element); |
| 132 |
|
$actual = $elements->item(0)->nodeValue; |
| 133 |
|
if ($text == $actual) { |
| 134 |
|
throw new \Exception(sprintf("The element value is `%s`", $actual)); |
| 135 |
|
} |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
/** |
| 139 |
|
* Checks that the XML attribute on the specified element exists |