Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 20 months ago

#56664 closed defect (bug) (fixed)

Add unit test for non-existing block-styles registration

Reported by: aristath's profile aristath Owned by: audrasjb's profile audrasjb
Milestone: 6.1 Priority: normal
Severity: normal Version: 6.1
Component: General Keywords: has-patch has-unit-tests commit
Focuses: Cc:

Change History (12)

This ticket was mentioned in PR #3336 on WordPress/wordpress-develop by aristath.

20 months ago

  • Keywords has-patch added

#2 @mukesh27
20 months ago

  • Keywords reporter-feedback added

@aristath in which case we get result for generate_block_asset_handle( $metadata['name'], $field_name, $index )?

Do we need the unit test for this changes?

#3 @aristath
20 months ago

  • Description modified (diff)

#4 @aristath
20 months ago

The issue was introduced in, where wp_normalize_path() was added on line 227 a few days ago.

Do we need the unit test for this changes?

We should probably add one to prevent something like this from happening in the future. However, writing a test for this one will be a bit more complicated than the existing tests for this function. I'll work on it, but in the meantime, the lack of a future-proofing test should not be considered a blocker for this bugfix.

#5 @aristath
20 months ago

Turns out, the test for this was simpler than I initially believed. Added the test 👍

#6 @aristath
20 months ago

  • Keywords has-unit-tests added; reporter-feedback removed

#7 @mukesh27
20 months ago

Thanks for the unit test. The PR has some conflict that must be resolved.

#8 @aristath
20 months ago

😂 Looks like this was just fixed a few minutes ago in
However, that patch does not include a unit-test. I'll change the subject of this ticket, remove the changes in blocks.php from my patch and leave only the PHPUnit test as it should still be relevant with the patch that was pushed.

#9 @aristath
20 months ago

  • Description modified (diff)
  • Severity changed from major to normal
  • Summary changed from Blocks try to load non-existent block-styles on the frontend to Add unit test for non-existing block-styles registration

#10 @audrasjb
20 months ago

  • Keywords commit added
  • Owner set to audrasjb
  • Status changed from new to accepted

Self assigning for commit.

#11 @audrasjb
20 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 54472:

Build/Test Tools: Add unit test for non-existing block-styles registration.

Follow-up to [54155].

Props aristath, mukesh27.
Fixes #56664.

Note: See TracTickets for help on using tickets.