Skip to content

Commit

Permalink
Update WpAddGlobalStylesForBlocks test strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed May 10, 2024
1 parent fd9bd6a commit d58bcea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/phpunit/tests/theme/wpAddGlobalStylesForBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function test_third_party_blocks_inline_styles_not_register_to_global_sty
wp_add_global_styles_for_blocks();

$this->assertNotContains(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$this->get_global_styles()
);
}
Expand All @@ -59,15 +59,15 @@ public function test_third_party_blocks_inline_styles_get_registered_to_global_s
wp_register_style( 'global-styles', false, array(), true, true );

$this->assertNotContains(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$this->get_global_styles(),
'Third party block inline style should not be registered before running wp_add_global_styles_for_blocks()'
);

wp_add_global_styles_for_blocks();

$this->assertContains(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$this->get_global_styles(),
'Third party block inline style should be registered after running wp_add_global_styles_for_blocks()'
);
Expand All @@ -83,15 +83,15 @@ public function test_third_party_blocks_inline_styles_get_registered_to_global_s
wp_register_style( 'global-styles', false, array(), true, true );

$this->assertNotContains(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$this->get_global_styles(),
'Third party block inline style should not be registered before running wp_add_global_styles_for_blocks()'
);

wp_add_global_styles_for_blocks();

$this->assertContains(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$this->get_global_styles(),
'Third party block inline style should be registered after running wp_add_global_styles_for_blocks()'
);
Expand All @@ -111,7 +111,7 @@ public function test_third_party_blocks_inline_styles_get_rendered_when_per_bloc
$actual = get_echo( 'wp_print_styles' );

$this->assertStringContainsString(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$actual,
'Third party block inline style should render'
);
Expand All @@ -133,7 +133,7 @@ public function test_blocks_inline_styles_get_rendered() {
$actual = get_echo( 'wp_print_styles' );

$this->assertStringContainsString(
'.wp-block-my-third-party-block{background-color: hotpink;}',
':where(.wp-block-my-third-party-block){background-color: hotpink;}',
$actual,
'Third party block inline style should render'
);
Expand All @@ -158,7 +158,7 @@ public function test_third_party_blocks_inline_styles_for_elements_get_rendered_
$actual = get_echo( 'wp_print_styles' );

$this->assertStringContainsString(
'.wp-block-my-third-party-block cite{color: white;}',
':where(.wp-block-my-third-party-block cite){color: white;}',
$actual
);
}
Expand All @@ -174,7 +174,7 @@ public function test_third_party_blocks_inline_styles_for_elements_get_rendered(
$actual = get_echo( 'wp_print_styles' );

$this->assertStringContainsString(
'.wp-block-my-third-party-block cite{color: white;}',
':where(.wp-block-my-third-party-block cite){color: white;}',
$actual
);
}
Expand Down

0 comments on commit d58bcea

Please sign in to comment.