mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add XPath tests for basic types
This commit is contained in:
parent
07c688f224
commit
7be47953a3
1 changed files with 17 additions and 0 deletions
17
ext/dom/tests/xpath_evaluate_basic_types.phpt
Normal file
17
ext/dom/tests/xpath_evaluate_basic_types.phpt
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue