Skip to content

Commit 7152b33

Browse files
committed
Remove conditional setting of path data
1 parent 46afeb7 commit 7152b33

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tests/phpunit/tests/template.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,13 +1712,12 @@ static function () {
17121712
// Ensure stylesheet files exist on the filesystem since a build may not have been done.
17131713
$this->ensure_style_asset_file_created(
17141714
'wp-block-library',
1715-
wp_should_load_separate_core_block_assets() ? 'css/dist/block-library/common.css' : 'css/dist/block-library/style.css',
1716-
wp_should_load_separate_core_block_assets()
1715+
wp_should_load_separate_core_block_assets() ? 'css/dist/block-library/common.css' : 'css/dist/block-library/style.css'
17171716
);
1718-
$this->ensure_style_asset_file_created( 'wp-block-library-theme', 'css/dist/block-library/theme.css', true );
1717+
$this->ensure_style_asset_file_created( 'wp-block-library-theme', 'css/dist/block-library/theme.css' );
17191718

17201719
if ( wp_should_load_separate_core_block_assets() ) {
1721-
$this->ensure_style_asset_file_created( 'wp-block-separator', 'blocks/separator/style.css', true );
1720+
$this->ensure_style_asset_file_created( 'wp-block-separator', 'blocks/separator/style.css' );
17221721
}
17231722
$this->assertFalse( wp_is_block_theme(), 'Test is not relevant to block themes (only classic themes).' );
17241723

@@ -1809,7 +1808,7 @@ static function () {
18091808
$this->assertSame(
18101809
$expected_styles,
18111810
$found_subset_styles,
1812-
'Expected the same styles. Snapshot: ' . self::get_array_snapshot_export( $found_subset_styles ) )
1811+
'Expected the same styles. Snapshot: ' . self::get_array_snapshot_export( $found_subset_styles )
18131812
);
18141813
}
18151814

@@ -1823,11 +1822,10 @@ static function () {
18231822
*
18241823
* @param string $handle Style handle.
18251824
* @param string $relative_path Relative path to the CSS file in wp-includes.
1826-
* @param bool $add_path_data Whether to add the path data.
18271825
*
18281826
* @throws Exception If the supplied style handle is not registered as expected.
18291827
*/
1830-
private function ensure_style_asset_file_created( string $handle, string $relative_path, bool $add_path_data = false ) {
1828+
private function ensure_style_asset_file_created( string $handle, string $relative_path ) {
18311829
$dependency = wp_styles()->query( $handle );
18321830
if ( ! $dependency ) {
18331831
throw new Exception( "The stylesheet for $handle is not registered." );
@@ -1838,9 +1836,7 @@ private function ensure_style_asset_file_created( string $handle, string $relati
18381836
if ( 0 === filesize( $path ) ) {
18391837
file_put_contents( $path, "/* CSS for $handle */" );
18401838
}
1841-
if ( $add_path_data ) {
1842-
wp_style_add_data( $handle, 'path', $path );
1843-
}
1839+
wp_style_add_data( $handle, 'path', $path );
18441840
}
18451841

18461842
public function assertTemplateHierarchy( $url, array $expected, $message = '' ) {

0 commit comments

Comments
 (0)