File tree Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Expand file tree Collapse file tree 2 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Zenstruck \Browser \Response ;
4
4
5
- use Behat \Mink \Element \NodeElement ;
6
5
use Symfony \Component \DomCrawler \Crawler ;
7
6
use Symfony \Component \VarDumper \VarDumper ;
8
7
use Zenstruck \Browser \Response ;
@@ -31,15 +30,14 @@ final public function dump(?string $selector = null): void
31
30
return ;
32
31
}
33
32
34
- $ elements = $ this ->session ()->getPage ()->findAll ('css ' , $ selector );
35
- $ elements = \array_map (static fn (NodeElement $ node ) => $ node ->getHtml (), $ elements );
33
+ $ elements = $ this ->crawler ()->filter ($ selector );
36
34
37
- if (empty ( $ elements )) {
35
+ if (0 === $ elements-> count ( )) {
38
36
throw new \RuntimeException ("Element \"{$ selector }\" not found. " );
39
37
}
40
38
41
- foreach ( $ elements as $ element ) {
42
- VarDumper::dump ($ element );
43
- }
39
+ $ elements-> each ( function ( Crawler $ node ) {
40
+ VarDumper::dump ($ node -> html () );
41
+ });
44
42
}
45
43
}
Original file line number Diff line number Diff line change @@ -187,22 +187,6 @@ public function cannot_follow_invisible_link(): void
187
187
;
188
188
}
189
189
190
- /**
191
- * @test
192
- */
193
- public function can_dump_html_element (): void
194
- {
195
- $ this ->markTestIncomplete ('TODO: fix. ' );
196
- }
197
-
198
- /**
199
- * @test
200
- */
201
- public function if_dump_selector_matches_multiple_elements_all_are_dumped (): void
202
- {
203
- $ this ->markTestIncomplete ('TODO: fix. ' );
204
- }
205
-
206
190
protected function browser (): PantherBrowser
207
191
{
208
192
return $ this ->pantherBrowser ();
You can’t perform that action at this time.
0 commit comments