Add XPath tests for basic types

This commit is contained in:
Niels Dossche 2023-09-02 14:17:07 +02:00
parent 07c688f224
commit 7be47953a3

View file

@ -0,0 +1,17 @@
--TEST--
XPath: basic types evaluation
--EXTENSIONS--
dom
--FILE--
<?php
$dom = new DOMDocument();
$dom->loadHTML('<p align="center">foo</p>');
$xpath = new DOMXpath($dom);
var_dump($xpath->evaluate("count(//p) > 0"));
var_dump($xpath->evaluate("string(//p/@align)"));
?>
--EXPECT--
bool(true)
string(6) "center"