Skip to content

Commit 26c476d

Browse files
authored
[9.x] Improve assertSeeText and assertDontSeeText test methods (#45274)
1 parent e969ffc commit 26c476d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Illuminate/Testing/TestResponse.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,11 @@ public function assertSeeText($value, $escape = true)
621621

622622
$values = $escape ? array_map('e', ($value)) : $value;
623623

624-
tap(strip_tags($this->getContent()), function ($content) use ($values) {
625-
foreach ($values as $value) {
626-
PHPUnit::assertStringContainsString((string) $value, $content);
627-
}
628-
});
624+
$content = strip_tags($this->getContent());
625+
626+
foreach ($values as $value) {
627+
PHPUnit::assertStringContainsString((string) $value, $content);
628+
}
629629

630630
return $this;
631631
}
@@ -679,11 +679,11 @@ public function assertDontSeeText($value, $escape = true)
679679

680680
$values = $escape ? array_map('e', ($value)) : $value;
681681

682-
tap(strip_tags($this->getContent()), function ($content) use ($values) {
683-
foreach ($values as $value) {
684-
PHPUnit::assertStringNotContainsString((string) $value, $content);
685-
}
686-
});
682+
$content = strip_tags($this->getContent());
683+
684+
foreach ($values as $value) {
685+
PHPUnit::assertStringNotContainsString((string) $value, $content);
686+
}
687687

688688
return $this;
689689
}

0 commit comments

Comments
 (0)