diff --git a/tests/Integration/View/BladeTest.php b/tests/Integration/View/BladeTest.php index ce390c1d87a9..058be384301f 100644 --- a/tests/Integration/View/BladeTest.php +++ b/tests/Integration/View/BladeTest.php @@ -8,6 +8,7 @@ use Illuminate\View\Component; use Orchestra\Testbench\TestCase; use Symfony\Component\Finder\Finder; +use Symfony\Component\Finder\SplFileInfo; class BladeTest extends TestCase { @@ -170,27 +171,15 @@ public function test_bound_name_attribute_can_be_used_if_using_short_slot_names_ public function testViewCacheCommandHandlesConfiguredBladeExtensions() { - View::addExtension('sh', 'blade'); - $path = View::make('different-extension')->getPath(); - $compiled = Blade::getCompiledPath($path); - $this->artisan('view:clear'); - $this->assertFileDoesNotExist($compiled); + View::addExtension('sh', 'blade'); $this->artisan('view:cache'); - collect(Finder::create() - ->in(Config::get('view.compiled')) - ->files())->dd(); - - $this->assertStringEqualsFile($compiled, <<< COMPILED_BLADE - - - echo "" > output.log - - COMPILED_BLADE); + $compiledFiles = Finder::create()->in(Config::get('view.compiled'))->files(); + $found = collect($compiledFiles) + ->contains(fn (SplFileInfo $file) => str_contains($file->getContents(), 'echo "" > output.log')); + $this->assertTrue($found); $this->artisan('view:clear'); } diff --git a/tests/Integration/View/templates/different-extension.sh b/tests/Integration/View/templates/different-extension.sh index 76bd251f4dfd..0e3eb4632007 100644 --- a/tests/Integration/View/templates/different-extension.sh +++ b/tests/Integration/View/templates/different-extension.sh @@ -1,5 +1 @@ -@php - $scriptMessage = 'Hello World'; -@endphp - echo "{{ $scriptMessage }}" > output.log