private static assertXpathEquals ( $xml, $xpath, $expectedValue, $attribute = null, $comment = null ) |
private static function assertXpathEquals($xml, $xpath, $expectedValue, $attribute = null, $comment = null)
{
static::assertXpathNotEmpty($xml, $xpath);
$xml = new SimpleXMLElement($xml);
$element = current($xml->xpath($xpath));
if ($attribute) {
$element = $element[$attribute];
}
static::assertEquals($expectedValue, (string) $element);
}