From ff826c5c724b9c5b1480be9dacfde196d126d752 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 15 Dec 2022 11:41:46 +0100 Subject: [PATCH 1/2] Wrap the file path in brackets for the FileNotFoundException --- .../src/Framework/Exceptions/FileNotFoundException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Framework/Exceptions/FileNotFoundException.php b/packages/framework/src/Framework/Exceptions/FileNotFoundException.php index 8a704005132..ead43ecbac7 100644 --- a/packages/framework/src/Framework/Exceptions/FileNotFoundException.php +++ b/packages/framework/src/Framework/Exceptions/FileNotFoundException.php @@ -16,7 +16,7 @@ class FileNotFoundException extends Exception public function __construct(?string $path = null, ?string $message = null) { - $this->message = $message ?? ($path ? "File $path not found." : $this->message); + $this->message = $message ?? ($path ? "File [$path] not found." : $this->message); parent::__construct($this->message, $this->code); } From ad30de7378fe6ceeeb8bae1cbb49cf1e331af310 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 15 Dec 2022 11:43:59 +0100 Subject: [PATCH 2/2] Expect updated exception message --- .../tests/Feature/Actions/AnonymousViewCompilerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/tests/Feature/Actions/AnonymousViewCompilerTest.php b/packages/framework/tests/Feature/Actions/AnonymousViewCompilerTest.php index 54a6e8742ea..8630714ce49 100644 --- a/packages/framework/tests/Feature/Actions/AnonymousViewCompilerTest.php +++ b/packages/framework/tests/Feature/Actions/AnonymousViewCompilerTest.php @@ -30,7 +30,7 @@ public function testCanCompileBladeFileWithData() public function testWithMissingView() { $this->expectException(FileNotFoundException::class); - $this->expectExceptionMessage('File foo.blade.php not found.'); + $this->expectExceptionMessage('File [foo.blade.php] not found.'); AnonymousViewCompiler::call('foo.blade.php'); }