From cfb6f31ce64d55a0c9d5c6598e11ddc2b7f0b18d Mon Sep 17 00:00:00 2001 From: MaxGiting Date: Wed, 22 May 2024 16:26:51 +0100 Subject: [PATCH 1/4] Check mockConsoleOutput property exists --- .../Foundation/Testing/LazilyRefreshDatabase.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php index 3de593d9406b..a848eb3a14d2 100644 --- a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php @@ -24,13 +24,17 @@ public function refreshDatabase() RefreshDatabaseState::$lazilyRefreshed = true; - $shouldMockOutput = $this->mockConsoleOutput; - - $this->mockConsoleOutput = false; + if(property_exists($this, 'mockConsoleOutput')){ + $shouldMockOutput = $this->mockConsoleOutput; + + $this->mockConsoleOutput = false; + } $this->baseRefreshDatabase(); - $this->mockConsoleOutput = $shouldMockOutput; + if(property_exists($this, 'mockConsoleOutput')){ + $this->mockConsoleOutput = $shouldMockOutput; + } }; $database->beforeStartingTransaction($callback); From f03889b1448cbf4535b95cc1340dcaa8ab895be5 Mon Sep 17 00:00:00 2001 From: MaxGiting Date: Wed, 22 May 2024 21:37:45 +0100 Subject: [PATCH 2/4] Update src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php Co-authored-by: AJ <60591772+devajmeireles@users.noreply.github.com> --- src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php index a848eb3a14d2..9d50b59baf6b 100644 --- a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php @@ -24,7 +24,7 @@ public function refreshDatabase() RefreshDatabaseState::$lazilyRefreshed = true; - if(property_exists($this, 'mockConsoleOutput')){ + if (property_exists($this, 'mockConsoleOutput')){ $shouldMockOutput = $this->mockConsoleOutput; $this->mockConsoleOutput = false; From 5900d6a54394a0911a3b44c7b77a7982b005ba3e Mon Sep 17 00:00:00 2001 From: MaxGiting Date: Wed, 22 May 2024 21:37:53 +0100 Subject: [PATCH 3/4] Update src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php Co-authored-by: AJ <60591772+devajmeireles@users.noreply.github.com> --- src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php index 9d50b59baf6b..d4dd8a7dcd1d 100644 --- a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php @@ -32,7 +32,7 @@ public function refreshDatabase() $this->baseRefreshDatabase(); - if(property_exists($this, 'mockConsoleOutput')){ + if (property_exists($this, 'mockConsoleOutput')){ $this->mockConsoleOutput = $shouldMockOutput; } }; From d17a84a386177155cef5d55b67659ce42e7f2f8f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 22 May 2024 16:12:11 -0500 Subject: [PATCH 4/4] Update LazilyRefreshDatabase.php --- src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php index d4dd8a7dcd1d..74af6f1b1d62 100644 --- a/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php +++ b/src/Illuminate/Foundation/Testing/LazilyRefreshDatabase.php @@ -24,7 +24,7 @@ public function refreshDatabase() RefreshDatabaseState::$lazilyRefreshed = true; - if (property_exists($this, 'mockConsoleOutput')){ + if (property_exists($this, 'mockConsoleOutput')) { $shouldMockOutput = $this->mockConsoleOutput; $this->mockConsoleOutput = false; @@ -32,7 +32,7 @@ public function refreshDatabase() $this->baseRefreshDatabase(); - if (property_exists($this, 'mockConsoleOutput')){ + if (property_exists($this, 'mockConsoleOutput')) { $this->mockConsoleOutput = $shouldMockOutput; } };