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