Skip to content

Commit 9607f0e

Browse files
committed
Opt for ignore list rather than ack list
1 parent 4447f46 commit 9607f0e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/phpunit/tests/template.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,17 +1747,24 @@ static function () {
17471747
/*
17481748
* Since new styles could appear at any time and since certain styles leak in from the global scope not being
17491749
* properly reset somewhere else in the test suite, we only check that the expected styles are at least present
1750-
* and in the same order.
1750+
* and in the same order. When new styles are introduced in core, they may be added to this array as opposed to
1751+
* updating the arrays in the data provider, if appropriate.
17511752
*/
1753+
$ignored_styles = array(
1754+
'core-block-supports-duotone-inline-css',
1755+
'wp-block-library-theme-css',
1756+
'wp-block-template-skip-link-inline-css',
1757+
);
1758+
17521759
$found_subset_styles = array();
17531760
foreach ( array( 'HEAD', 'BODY' ) as $group ) {
1754-
$found_subset_styles[ $group ] = array_values( array_intersect( $found_styles[ $group ], $expected_styles[ $group ] ) );
1761+
$found_subset_styles[ $group ] = array_values( array_diff( $found_styles[ $group ], $ignored_styles ) );
17551762
}
17561763

17571764
$this->assertSame(
17581765
$expected_styles,
17591766
$found_subset_styles,
1760-
'Expected the same styles. Snapshot: ' . self::get_array_snapshot_export( $found_styles )
1767+
'Expected the same styles. Snapshot: ' . self::get_array_snapshot_export( $found_subset_styles )
17611768
);
17621769
}
17631770

0 commit comments

Comments
 (0)