1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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"