diff --git a/tests/Feature/BreakpointsTest.php b/tests/Feature/BreakpointsTest.php index 61df1074..b34db9b5 100644 --- a/tests/Feature/BreakpointsTest.php +++ b/tests/Feature/BreakpointsTest.php @@ -78,8 +78,34 @@ it('scans the showcase example heredocs too, where the package teaches its own m ->filter(fn (SplFileInfo $file): bool => str_contains($file->getRelativePathname(), 'showcase'.DIRECTORY_SEPARATOR.'sections')) ->filter(fn (SplFileInfo $file): bool => str_contains($file->getContents(), "<<<'BLADE'")); - // The scan reads whole files, so nothing above can be hiding inside a heredoc; this only holds - // the premise up, in case the examples ever move out of them. - expect($sections)->not->toBeEmpty() - ->and($sections->filter(fn (SplFileInfo $file): bool => str_contains($file->getContents(), 'medium:'))->isNotEmpty())->toBeTrue(); + // Every section still teaches its examples through a heredoc nested inside an @php block + // (plan step 38 rewrote what is inside them, not the mechanism), so the two scans above — + // which read a file's raw text rather than its parsed Blade or PHP — still reach them. + expect($sections)->not->toBeEmpty(); + + // The premise itself, proven on a fixture now that plan step 38 has cleared every Tailwind + // breakpoint prefix out of the showcase (its own goal, so production content can no longer + // carry one): a real file, shaped exactly like a showcase section (an outer heredoc nesting an + // inner one, `@php … <<<'BLADE' … BLADE, … @endphp`), still gives up a prefix hiding two + // heredocs deep to the same pattern and helper the first test above uses. + $directory = sys_get_temp_dir().'/breakpoint-heredoc-probe-'.uniqid(); + File::ensureDirectoryExists($directory); + File::put($directory.'/probe.blade.php', <<<'OUTER' + @php + $examples = [ + 'Probe' => <<<'BLADE' +
+ BLADE, + ]; + @endphp + OUTER); + + try { + $pattern = '/(?not->toBeEmpty(); + } finally { + File::deleteDirectory($directory); + } });