Skip to content

Commit b7717be

Browse files
committed
Add more unsupported tests
1 parent 0b0a5bf commit b7717be

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
CSS Selectors - Pseudo classes: dir
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
require __DIR__ . '/test_utils.inc';
9+
10+
$dom = DOM\XMLDocument::createFromString(<<<XML
11+
<container dir="rtl">
12+
<p>1</p>
13+
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
14+
<p>2</p>
15+
</html>
16+
</container>
17+
XML);
18+
19+
test_failure($dom, ':dir(rtl)', true);
20+
test_failure($dom, ':dir(ltr)', true);
21+
22+
?>
23+
--EXPECT--
24+
--- Selector: :dir(rtl) ---
25+
Code 12 Invalid selector (Selectors. Not supported: dir)
26+
--- Selector: :dir(ltr) ---
27+
Code 12 Invalid selector (Selectors. Not supported: dir)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
CSS Selectors - Pseudo classes: lang
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
require __DIR__ . '/test_utils.inc';
9+
10+
$dom = DOM\XMLDocument::createFromString(<<<XML
11+
<container lang="en">
12+
<p>1</p>
13+
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl">
14+
<p>2</p>
15+
</html>
16+
</container>
17+
XML);
18+
19+
test_failure($dom, ':lang(en)', true);
20+
test_failure($dom, ':lang(nl)', true);
21+
22+
?>
23+
--EXPECT--
24+
--- Selector: :lang(en) ---
25+
Code 12 Invalid selector (Selectors. Not supported: lang)
26+
--- Selector: :lang(nl) ---
27+
Code 12 Invalid selector (Selectors. Not supported: lang)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--TEST--
2+
CSS Selectors - Pseudo classes: nth-(last-)col
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
require __DIR__ . '/test_utils.inc';
9+
10+
$dom = DOM\HTMLDocument::createFromString(<<<HTML
11+
<!DOCTYPE html>
12+
<html>
13+
<body>
14+
<table>
15+
<tr>
16+
<th>Col 1</th>
17+
<th>Col 2</th>
18+
</tr>
19+
<tr>
20+
<td>1</td>
21+
<td>2</td>
22+
</tr>
23+
</table>
24+
</body>
25+
</html>
26+
HTML);
27+
28+
test_failure($dom, ':nth-col(1)', true);
29+
test_failure($dom, ':nth-last-col(1)', true);
30+
31+
?>
32+
--EXPECT--
33+
--- Selector: :nth-col(1) ---
34+
Code 12 Invalid selector (Selectors. Not supported: nth-col)
35+
--- Selector: :nth-last-col(1) ---
36+
Code 12 Invalid selector (Selectors. Not supported: nth-last-col)

0 commit comments

Comments
 (0)