From 97d7d9b5c0d273764307e31e76f4cdc661df79c9 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 05:37:10 +0200 Subject: [PATCH] Prove the heredoc breakpoint scan on a fixture, not production debt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan step 38's last batch cleared the one real medium: this premise test relied on (containment.blade.php's Lists example, now ) — its own goal, not a regression, but it leaves nothing left over to find. The test now builds a real two-heredocs-deep fixture (an @php block nesting a <<<'BLADE' example, exactly how a showcase section is shaped) and reuses the first test's own pattern and helper against it, so the scan is proven on demand instead of by whatever Tailwind happens to still be lying around. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- tests/Feature/BreakpointsTest.php | 34 +++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) 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); + } });