not->toBeFalse(); $needle = " /modules/stripe/invoice:"; $start = strpos($contents, $needle); expect($start)->not->toBeFalse(); $nextPathStart = strpos($contents, "\n /", $start + strlen($needle)); if ($nextPathStart === false) { $nextPathStart = strlen($contents); } $block = substr($contents, $start, $nextPathStart - $start); // Normalise trailing whitespace so the assertion is stable across editors. $normalised = preg_replace('/[ \t]+$/m', '', $block); expect($normalised)->toContain(" /modules/stripe/invoice:"); expect($normalised)->toContain('summary: Create Stripe invoice (retired - TRU-74 / DRIFT 13)'); expect($normalised)->toContain("'410':"); expect($normalised)->toContain('stripe_email_payment_disabled'); expect($normalised)->toContain('Cancel/clean up a legacy Stripe hosted invoice'); expect($normalised)->toContain('cancelLegacyStripeInvoice'); });