Skip to content

Use NOWDOC syntax for multi-line expected HTML strings#3

Merged
juanmaguitar merged 1 commit intomainfrom
update/nowdoc-syntax-in-tests
Feb 23, 2026
Merged

Use NOWDOC syntax for multi-line expected HTML strings#3
juanmaguitar merged 1 commit intomainfrom
update/nowdoc-syntax-in-tests

Conversation

@juanmaguitar
Copy link
Copy Markdown
Contributor

Summary

  • Switches $expected in test_card_block_renders_with_background_color from a single-quoted string to NOWDOC syntax (<<<'HTML')
  • Uses an indented closing marker so the heredoc aligns naturally with the surrounding method indentation

Context

Suggested by @jonsurrell in a review of the companion article: multi-line HTML strings are nicer to write with NOWDOC, and it's worth mentioning that indented closing markers are available since PHP 7.3 (minimum PHP version for WordPress 7.0).

Reference: https://php.watch/versions/7.3/relaxed-heredoc-nowdoc

Test plan

  • npm run test:php passes with no regressions

🤖 Generated with Claude Code

Switches $expected in test_card_block_renders_with_background_color from a
regular single-quoted string to a NOWDOC (<<<'HTML') with an indented
closing marker. The result is easier to read and aligns naturally with the
surrounding method indentation. Indented closing markers require PHP 7.3+,
which is the minimum version for WordPress 7.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@juanmaguitar juanmaguitar merged commit 33658fa into main Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant