@@ -59,7 +59,7 @@ public function testWaitFor(string $locator): void
5959 $ crawler = $ client ->request ('GET ' , '/waitfor.html ' );
6060 $ c = $ client ->waitFor ($ locator );
6161 $ this ->assertInstanceOf (Crawler::class, $ c );
62- $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text ());
62+ $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
6363 }
6464
6565 public function testWaitForHiddenInputElement (): void
@@ -86,7 +86,7 @@ public function testWaitForVisibility(string $locator): void
8686 $ crawler = $ client ->request ('GET ' , '/waitfor-element-to-be-visible.html ' );
8787 $ c = $ client ->waitForVisibility ($ locator );
8888 $ this ->assertInstanceOf (Crawler::class, $ c );
89- $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text ());
89+ $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
9090 }
9191
9292 /**
@@ -98,7 +98,7 @@ public function testWaitForInvisibility(string $locator): void
9898 $ crawler = $ client ->request ('GET ' , '/waitfor-element-to-be-invisible.html ' );
9999 $ c = $ client ->waitForInvisibility ($ locator );
100100 $ this ->assertInstanceOf (Crawler::class, $ c );
101- $ this ->assertSame ('' , $ crawler ->filter ('#hello ' )->text ());
101+ $ this ->assertSame ('' , $ crawler ->filter ('#hello ' )->text (null , true ));
102102 }
103103
104104 /**
@@ -110,7 +110,7 @@ public function testWaitForElementToContain(string $locator): void
110110 $ crawler = $ client ->request ('GET ' , '/waitfor-element-to-contain.html ' );
111111 $ c = $ client ->waitForElementToContain ($ locator , 'new content ' );
112112 $ this ->assertInstanceOf (Crawler::class, $ c );
113- $ this ->assertSame ('Hello new content ' , $ crawler ->filter ('#hello ' )->text ());
113+ $ this ->assertSame ('Hello new content ' , $ crawler ->filter ('#hello ' )->text (null , true ));
114114 }
115115
116116 /**
@@ -122,7 +122,7 @@ public function testWaitForElementToNotContain(string $locator): void
122122 $ crawler = $ client ->request ('GET ' , '/waitfor-element-to-not-contain.html ' );
123123 $ c = $ client ->waitForElementToNotContain ($ locator , 'removed content ' );
124124 $ this ->assertInstanceOf (Crawler::class, $ c );
125- $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text ());
125+ $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
126126 }
127127
128128 /**
@@ -234,7 +234,7 @@ public function testRefreshCrawler(): void
234234 $ crawler = $ client ->request ('GET ' , '/js-redirect.html ' );
235235 $ linkCrawler = $ crawler ->selectLink ('Redirect Link ' );
236236
237- $ this ->assertSame ('Redirect Link ' , $ linkCrawler ->text ());
237+ $ this ->assertSame ('Redirect Link ' , $ linkCrawler ->text (null , true ));
238238
239239 $ client ->click ($ linkCrawler ->link ());
240240 $ client ->wait (5 )->until (WebDriverExpectedCondition::titleIs ('A basic page ' ));
@@ -243,7 +243,7 @@ public function testRefreshCrawler(): void
243243
244244 $ this ->assertInstanceOf (Crawler::class, $ refreshedCrawler );
245245 $ this ->assertSame (self ::$ baseUri .'/basic.html ' , $ refreshedCrawler ->getUri ());
246- $ this ->assertSame ('Hello ' , $ refreshedCrawler ->filter ('h1 ' )->text ());
246+ $ this ->assertSame ('Hello ' , $ refreshedCrawler ->filter ('h1 ' )->text (null , true ));
247247 }
248248
249249 /**
@@ -282,15 +282,15 @@ public function testSubmitForm(callable $clientFactory): void
282282 $ this ->assertInstanceOf (Crawler::class, $ crawler );
283283 }
284284 $ this ->assertSame (self ::$ baseUri .'/form-handle.php ' , $ crawler ->getUri ());
285- $ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text ());
285+ $ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
286286
287287 $ crawler = $ client ->back ();
288288 $ form = $ crawler ->filter ('form ' )->eq (0 )->form ([
289289 'i1 ' => 'Michel ' ,
290290 ]);
291291
292292 $ crawler = $ client ->submit ($ form );
293- $ this ->assertSame ('I1: n/a ' , $ crawler ->filter ('#result ' )->text ());
293+ $ this ->assertSame ('I1: n/a ' , $ crawler ->filter ('#result ' )->text (null , true ));
294294 $ this ->assertSame (self ::$ baseUri .'/form-handle.php?i1=Michel&i2=&i3=&i4=i4a ' , $ crawler ->getUri ());
295295 }
296296
@@ -312,7 +312,7 @@ public function testSubmitFormWithValues(callable $clientFactory, string $type):
312312 $ this ->assertInstanceOf (Crawler::class, $ crawler );
313313 }
314314 $ this ->assertSame (self ::$ baseUri .'/form-handle.php ' , $ crawler ->getUri ());
315- $ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text ());
315+ $ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
316316 }
317317
318318 /**
@@ -353,7 +353,7 @@ public function testCookie(callable $clientFactory, string $type): void
353353 $ cookieJar ->clear (); // Firefox keeps the existing context by default, be sure to clear existing cookies
354354
355355 $ crawler = $ client ->request ('GET ' , self ::$ baseUri .'/cookie.php ' );
356- $ this ->assertSame ('0 ' , $ crawler ->filter ('#barcelona ' )->text ());
356+ $ this ->assertSame ('0 ' , $ crawler ->filter ('#barcelona ' )->text (null , true ));
357357
358358 $ this ->assertInstanceOf (BrowserKitCookieJar::class, $ cookieJar );
359359 if (Client::class === $ type ) {
@@ -378,7 +378,7 @@ public function testCookie(callable $clientFactory, string $type): void
378378 $ this ->assertNotNull ($ cookieJar ->get ('barcelona ' , '/cookie.php/bar ' , '127.0.0.1 ' ));
379379
380380 $ crawler = $ client ->reload ();
381- $ this ->assertSame ('1 ' , $ crawler ->filter ('#barcelona ' )->text ());
381+ $ this ->assertSame ('1 ' , $ crawler ->filter ('#barcelona ' )->text (null , true ));
382382
383383 $ this ->assertNotEmpty ($ cookieJar ->all ());
384384 $ cookieJar ->clear ();
@@ -387,8 +387,8 @@ public function testCookie(callable $clientFactory, string $type): void
387387 $ cookieJar ->set (new Cookie ('foo ' , 'bar ' ));
388388 $ crawler = $ client ->reload ();
389389 $ this ->assertSame ('bar ' , $ cookieJar ->get ('foo ' )->getValue ());
390- $ this ->assertSame ('0 ' , $ crawler ->filter ('#barcelona ' )->text ());
391- $ this ->assertSame ('bar ' , $ crawler ->filter ('#foo ' )->text ());
390+ $ this ->assertSame ('0 ' , $ crawler ->filter ('#barcelona ' )->text (null , true ));
391+ $ this ->assertSame ('bar ' , $ crawler ->filter ('#foo ' )->text (null , true ));
392392
393393 $ cookieJar ->expire ('foo ' );
394394 $ this ->assertNull ($ cookieJar ->get ('foo ' ));
0 commit comments