1 | <?php |
||
13 | class Html extends Stream |
||
14 | { |
||
15 | /** |
||
16 | * @var Crawler |
||
17 | */ |
||
18 | protected $html; |
||
19 | |||
20 | /** |
||
21 | * Constructor. |
||
22 | * |
||
23 | * @param StreamInterface $stream |
||
24 | * @param AbstractAssert|null $previous |
||
25 | */ |
||
26 | public function __construct(StreamInterface $stream, Utils\AbstractAssert $previous = null) |
||
33 | |||
34 | /** |
||
35 | * Asserts the number of elements matching with a selector. |
||
36 | * |
||
37 | * @param string $selector |
||
38 | * @param int $count |
||
39 | * @param string $message |
||
40 | * |
||
41 | * @return self |
||
42 | */ |
||
43 | public function count($selector, $count, $message = '') |
||
47 | |||
48 | /** |
||
49 | * Asserts that there is (at least) one element matching with a selector. |
||
50 | * |
||
51 | * @param string $selector |
||
52 | * @param string $message |
||
53 | * |
||
54 | * @return self |
||
55 | */ |
||
56 | public function has($selector, $message = '') |
||
60 | |||
61 | /** |
||
62 | * Asserts that there is not elements matching with a selector. |
||
63 | * |
||
64 | * @param string $selector |
||
65 | * @param string $message |
||
66 | * |
||
67 | * @return self |
||
68 | */ |
||
69 | public function hasNot($selector, $message = '') |
||
73 | |||
74 | /** |
||
75 | * Asserts that there is (at least) one element matching with a selector and content. |
||
76 | * |
||
77 | * @param string $selector |
||
78 | * @param string $text |
||
79 | * @param string $message |
||
80 | * |
||
81 | * @return self |
||
82 | */ |
||
83 | public function contains($selector, $text, $message = '') |
||
87 | |||
88 | /** |
||
89 | * Asserts that there is no elements matching with a selector and content. |
||
90 | * |
||
91 | * @param string $selector |
||
92 | * @param string $text |
||
93 | * @param string $message |
||
94 | * |
||
95 | * @return self |
||
96 | */ |
||
97 | public function notContains($selector, $text, $message = '') |
||
101 | |||
102 | /** |
||
103 | * Asserts that the html is valid. |
||
104 | * |
||
105 | * @param string $message |
||
106 | * |
||
107 | * @return self |
||
108 | */ |
||
109 | public function isValid($message = '') |
||
113 | |||
114 | /** |
||
115 | * Executes the callback for each element found. |
||
116 | * |
||
117 | * @param string $selector |
||
118 | * @param Closure $callback |
||
119 | * |
||
120 | * @return self |
||
121 | */ |
||
122 | public function map($selector, Closure $callback) |
||
128 | } |
||
129 |