Skip to content

Commit d88d4a0

Browse files
committed
Adding @Covers annotations
1 parent e8ce7a6 commit d88d4a0

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

tests/phpunit/tests/style-engine/styleEngine.php

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ public function tear_down() {
2424
/**
2525
* Tests generating block styles and classnames based on various manifestations of the $block_styles argument.
2626
*
27+
* @covers ::wp_style_engine_get_styles
28+
*
2729
* @dataProvider data_get_styles_fixtures
2830
*
2931
* @param array $block_styles The incoming block styles object.
3032
* @param array $options Style engine options.
3133
* @param string $expected_output The expected output.
3234
*/
33-
public function test_generate_get_styles( $block_styles, $options, $expected_output ) {
35+
public function test_wp_style_engine_get_styles( $block_styles, $options, $expected_output ) {
3436
$generated_styles = wp_style_engine_get_styles( $block_styles, $options );
3537
$this->assertSame( $expected_output, $generated_styles );
3638
}
@@ -491,8 +493,10 @@ public function data_get_styles_fixtures() {
491493

492494
/**
493495
* Tests adding rules to a store and retrieving a generated stylesheet.
496+
*
497+
* @covers ::wp_style_engine_get_styles
494498
*/
495-
public function test_store_block_styles_using_context() {
499+
public function test_wp_style_engine_get_styles_and_store_using_context() {
496500
$block_styles = array(
497501
'spacing' => array(
498502
'padding' => array(
@@ -518,8 +522,10 @@ public function test_store_block_styles_using_context() {
518522

519523
/**
520524
* Tests adding rules to a store and retrieving a generated stylesheet.
525+
*
526+
* @covers ::wp_style_engine_get_styles
521527
*/
522-
public function test_does_not_store_block_styles_without_context() {
528+
public function test_wp_style_engine_get_styles_without_context() {
523529
$block_styles = array(
524530
'typography' => array(
525531
'fontSize' => '999px',
@@ -540,8 +546,10 @@ public function test_does_not_store_block_styles_without_context() {
540546

541547
/**
542548
* Tests adding rules to a store and retrieving a generated stylesheet.
549+
*
550+
* @covers ::wp_style_engine_get_stylesheet_from_context
543551
*/
544-
public function test_add_to_store() {
552+
public function test_wp_style_engine_get_stylesheet_from_context() {
545553
$css_rules = array(
546554
array(
547555
'selector' => '.frodo',
@@ -569,16 +577,15 @@ public function test_add_to_store() {
569577
)
570578
);
571579

572-
// Check that the style engine knows about the store.
573-
$stored_store = WP_Style_Engine::get_store( 'test-store' );
574-
$this->assertInstanceOf( 'WP_Style_Engine_CSS_Rules_Store', $stored_store );
575-
$this->assertSame( $compiled_stylesheet, WP_Style_Engine::compile_stylesheet_from_css_rules( $stored_store->get_all_rules() ) );
580+
$this->assertSame( $compiled_stylesheet, wp_style_engine_get_stylesheet_from_context( 'test-store' ) );
576581
}
577582

578583
/**
579584
* Tests retrieving a generated stylesheet from any rules.
585+
*
586+
* @covers ::wp_style_engine_get_stylesheet_from_css_rules
580587
*/
581-
public function test_get_stylesheet_from_css_rules() {
588+
public function test_wp_style_engine_get_stylesheet_from_css_rules() {
582589
$css_rules = array(
583590
array(
584591
'selector' => '.saruman',
@@ -615,8 +622,10 @@ public function test_get_stylesheet_from_css_rules() {
615622

616623
/**
617624
* Tests that incoming styles are deduped and merged.
625+
*
626+
* @covers ::wp_style_engine_get_stylesheet_from_css_rules
618627
*/
619-
public function test_get_deduped_and_merged_stylesheet() {
628+
public function test_wp_style_engine_get_stylesheet_from_css_rules_dedupes_and_merges() {
620629
$css_rules = array(
621630
array(
622631
'selector' => '.gandalf',

0 commit comments

Comments
 (0)