1--TEST--
2CSS Selectors - Pseudo classes: optional/required
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8require __DIR__ . '/test_utils.inc';
9
10$dom = DOM\XMLDocument::createFromString(<<<XML
11<html xmlns="http://www.w3.org/1999/xhtml">
12    <input type="checkbox" required="required" />
13    <select required="required" />
14    <textarea required="" />
15    <input type="checkbox" />
16    <select />
17    <textarea />
18    <input xmlns=""/>
19    <input xmlns="" required="" />
20</html>
21XML);
22
23test_helper($dom, ':required');
24test_helper($dom, ':optional');
25
26?>
27--EXPECT--
28--- Selector: :required ---
29<input xmlns="http://www.w3.org/1999/xhtml" type="checkbox" required="required" />
30<select xmlns="http://www.w3.org/1999/xhtml" required="required"></select>
31<textarea xmlns="http://www.w3.org/1999/xhtml" required=""></textarea>
32--- Selector: :optional ---
33<input xmlns="http://www.w3.org/1999/xhtml" type="checkbox" />
34<select xmlns="http://www.w3.org/1999/xhtml"></select>
35<textarea xmlns="http://www.w3.org/1999/xhtml"></textarea>
36