Skip to content

Commit 7be4795

Browse files
committed
Add XPath tests for basic types
1 parent 07c688f commit 7be4795

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
XPath: basic types evaluation
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
$dom = new DOMDocument();
9+
$dom->loadHTML('<p align="center">foo</p>');
10+
$xpath = new DOMXpath($dom);
11+
var_dump($xpath->evaluate("count(//p) > 0"));
12+
var_dump($xpath->evaluate("string(//p/@align)"));
13+
14+
?>
15+
--EXPECT--
16+
bool(true)
17+
string(6) "center"

0 commit comments

Comments
 (0)