Skip to content

Commit ef23ee8

Browse files
committed
Test has
1 parent a93703a commit ef23ee8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
CSS Selectors - Pseudo classes: has
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
require __DIR__ . '/test_utils.inc';
9+
10+
$dom = DOM\XMLDocument::createFromString(<<<XML
11+
<container>
12+
<div>
13+
<p class="foo"/>
14+
</div>
15+
<div>
16+
<p/>
17+
</div>
18+
</container>
19+
XML);
20+
21+
test_helper($dom, 'div:has(p.foo)');
22+
test_helper($dom, 'div:has(:not(p.foo))');
23+
24+
?>
25+
--EXPECT--
26+
--- Selector: div:has(p.foo) ---
27+
<div>
28+
<p class="foo"/>
29+
</div>
30+
--- Selector: div:has(:not(p.foo)) ---
31+
<div>
32+
<p/>
33+
</div>

0 commit comments

Comments
 (0)