Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backport-changelog/7.2/13766.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/13766

* https://github.com/WordPress/gutenberg/pull/83544
8 changes: 3 additions & 5 deletions phpunit/class-wp-icons-registry-gutenberg-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function test_register_icon_sanitizes_content() {
$this->assertTrue( $result );

$icon = $this->registry->get_registered_icon( $name );
$this->assertSame( '<svg viewbox="0 0 24 24"><path d="M0 0" /></svg>', $icon['content'] );
$this->assertEqualHTML( '<svg viewbox="0 0 24 24"><path d="M0 0" /></svg>', $icon['content'] );
}

/**
Expand All @@ -422,7 +422,7 @@ public function test_register_icon_sanitizes_content() {
* @param non-falsy-string $expected The expected sanitized output.
*/
public function test_sanitize_icon_content( $input, $expected ) {
$this->assertSame( $expected, $this->sanitize_icon_content( $input ) );
$this->assertEqualHTML( $expected, $this->sanitize_icon_content( $input ) );
}

/**
Expand Down Expand Up @@ -520,8 +520,6 @@ public function data_library_icons(): array {
*/
public function test_sanitize_icon_content_preserves_library_icons( string $file_path ) {
$content = file_get_contents( $file_path );
// `wp_kses()` lowercases attribute names, so `viewBox` comes back as `viewbox`.
$expected = str_replace( 'viewBox=', 'viewbox=', $content );
$this->assertSame( $expected, $this->sanitize_icon_content( $content ) );
$this->assertEqualHTML( $content, $this->sanitize_icon_content( $content ) );
}
}
Loading