Skip to content

Commit a95dd0e

Browse files
Tests: Add missing @covers tags for WP_Block_Parser tests.
Includes moving the data provider after the corresponding test for consistency with the rest of the test suite. Follow-up to [43751]. Props sagardeshmukh. See #64225. git-svn-id: https://develop.svn.wordpress.org/trunk@62259 602fd350-edb4-49c9-b593-d223f7449a82
1 parent adf6443 commit a95dd0e

1 file changed

Lines changed: 30 additions & 26 deletions

File tree

tests/phpunit/tests/blocks/wpBlockParser.php

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @since 5.0.0
88
*
99
* @group blocks
10+
*
11+
* @coversDefaultClass WP_Block_Parser
1012
*/
1113
class Tests_Blocks_wpBlockParser extends WP_UnitTestCase {
1214
/**
@@ -17,35 +19,11 @@ class Tests_Blocks_wpBlockParser extends WP_UnitTestCase {
1719
*/
1820
protected static $fixtures_dir;
1921

20-
/**
21-
* @ticket 45109
22-
*/
23-
public function data_parsing_test_filenames() {
24-
self::$fixtures_dir = DIR_TESTDATA . '/blocks/fixtures';
25-
26-
$fixture_filenames = array_merge(
27-
glob( self::$fixtures_dir . '/*.json' ),
28-
glob( self::$fixtures_dir . '/*.html' )
29-
);
30-
31-
$fixture_filenames = array_values(
32-
array_unique(
33-
array_map(
34-
array( $this, 'clean_fixture_filename' ),
35-
$fixture_filenames
36-
)
37-
)
38-
);
39-
40-
return array_map(
41-
array( $this, 'pass_parser_fixture_filenames' ),
42-
$fixture_filenames
43-
);
44-
}
45-
4622
/**
4723
* @dataProvider data_parsing_test_filenames
4824
* @ticket 45109
25+
*
26+
* @covers ::parse
4927
*/
5028
public function test_default_parser_output( $html_filename, $parsed_json_filename ) {
5129
$html_path = self::$fixtures_dir . '/' . $html_filename;
@@ -70,6 +48,32 @@ public function test_default_parser_output( $html_filename, $parsed_json_filenam
7048
);
7149
}
7250

51+
/**
52+
* @ticket 45109
53+
*/
54+
public function data_parsing_test_filenames() {
55+
self::$fixtures_dir = DIR_TESTDATA . '/blocks/fixtures';
56+
57+
$fixture_filenames = array_merge(
58+
glob( self::$fixtures_dir . '/*.json' ),
59+
glob( self::$fixtures_dir . '/*.html' )
60+
);
61+
62+
$fixture_filenames = array_values(
63+
array_unique(
64+
array_map(
65+
array( $this, 'clean_fixture_filename' ),
66+
$fixture_filenames
67+
)
68+
)
69+
);
70+
71+
return array_map(
72+
array( $this, 'pass_parser_fixture_filenames' ),
73+
$fixture_filenames
74+
);
75+
}
76+
7377
/**
7478
* Helper function to remove relative paths and extension from a filename, leaving just the fixture name.
7579
*

0 commit comments

Comments
 (0)