From bd3161db1c7d52a3f5521240f0609703ca0ffc1e Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Thu, 4 Jan 2024 09:42:32 +1100 Subject: [PATCH] [10.x] Add assertViewEmpty to TestView (#49558) * Add assertEmpty to TestView * Update TestView.php --------- Co-authored-by: Taylor Otwell --- src/Illuminate/Testing/TestView.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Illuminate/Testing/TestView.php b/src/Illuminate/Testing/TestView.php index 137b41e6a992..ad64fb5b73a7 100644 --- a/src/Illuminate/Testing/TestView.php +++ b/src/Illuminate/Testing/TestView.php @@ -106,6 +106,16 @@ public function assertViewMissing($key) return $this; } + /** + * Assert that the view's rendered content is empty. + */ + public function assertViewEmpty() + { + PHPUnit::assertEmpty($this->rendered); + + return true; + } + /** * Assert that the given string is contained within the view. *