diff --git a/src/Illuminate/Testing/TestResponse.php b/src/Illuminate/Testing/TestResponse.php index 52acab73beda..b6a96f5483bb 100644 --- a/src/Illuminate/Testing/TestResponse.php +++ b/src/Illuminate/Testing/TestResponse.php @@ -621,11 +621,11 @@ public function assertSeeText($value, $escape = true) $values = $escape ? array_map('e', ($value)) : $value; - tap(strip_tags($this->getContent()), function ($content) use ($values) { - foreach ($values as $value) { - PHPUnit::assertStringContainsString((string) $value, $content); - } - }); + $content = strip_tags($this->getContent()); + + foreach ($values as $value) { + PHPUnit::assertStringContainsString((string) $value, $content); + } return $this; } @@ -679,11 +679,11 @@ public function assertDontSeeText($value, $escape = true) $values = $escape ? array_map('e', ($value)) : $value; - tap(strip_tags($this->getContent()), function ($content) use ($values) { - foreach ($values as $value) { - PHPUnit::assertStringNotContainsString((string) $value, $content); - } - }); + $content = strip_tags($this->getContent()); + + foreach ($values as $value) { + PHPUnit::assertStringNotContainsString((string) $value, $content); + } return $this; }