Skip to content

Commit 8d39c10

Browse files
committed
Fix lint, clean up yields
1 parent b3127a0 commit 8d39c10

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

tests/phpunit/tests/html-api/wpHtmlProcessorModifiableText.php

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,38 @@ public function test_modifiable_text_special_leading_whitespace( string $html, i
105105

106106
/**
107107
* Data provider.
108-
*
109-
* @return Generator
110108
*/
111109
public static function data_modifiable_text_special_leading_whitespace() {
112110
$set_text = "\nAFTER NEWLINE.";
113111

114112
foreach ( self::data_modifiable_text_special_pre_tags() as $tag_data ) {
115-
$tag_name = $tag_data[0];
116-
$TAG = strtoupper( $tag_name );
113+
$tag_name = $tag_data[0];
114+
$tag_label = strtoupper( $tag_name );
117115

118-
yield "{$TAG} with leading newline, first text node" => array( "<{$tag_name}>\nREPLACEME<!--x--></{$tag_name}>", 1, '', "<{$tag_name}>\n{$set_text}REPLACEME<!--x--></{$tag_name}>" );
119-
yield "{$TAG} with leading newline, second text node" => array( "<{$tag_name}>\nREPLACEME<!--x--></{$tag_name}>", 2, 'REPLACEME', "<{$tag_name}>\n{$set_text}<!--x--></{$tag_name}>" );
120-
yield "{$TAG} with leading space, first text node" => array( "<{$tag_name}> REPLACEME<!--x--></{$tag_name}>", 1, ' ', "<{$tag_name}>\n{$set_text}REPLACEME<!--x--></{$tag_name}>" );
121-
yield "{$TAG} with leading space, second text node" => array( "<{$tag_name}> REPLACEME<!--x--></{$tag_name}>", 2, 'REPLACEME', "<{$tag_name}>\n {$set_text}<!--x--></{$tag_name}>" );
116+
yield "{$tag_label} with leading newline, first text node" => array(
117+
"<{$tag_name}>\nREPLACEME<!--x--></{$tag_name}>",
118+
1,
119+
'',
120+
"<{$tag_name}>\n{$set_text}REPLACEME<!--x--></{$tag_name}>",
121+
);
122+
yield "{$tag_label} with leading newline, second text node" => array(
123+
"<{$tag_name}>\nREPLACEME<!--x--></{$tag_name}>",
124+
2,
125+
'REPLACEME',
126+
"<{$tag_name}>\n{$set_text}<!--x--></{$tag_name}>",
127+
);
128+
yield "{$tag_label} with leading space, first text node" => array(
129+
"<{$tag_name}> REPLACEME<!--x--></{$tag_name}>",
130+
1,
131+
' ',
132+
"<{$tag_name}>\n{$set_text}REPLACEME<!--x--></{$tag_name}>",
133+
);
134+
yield "{$tag_label} with leading space, second text node" => array(
135+
"<{$tag_name}> REPLACEME<!--x--></{$tag_name}>",
136+
2,
137+
'REPLACEME',
138+
"<{$tag_name}>\n {$set_text}<!--x--></{$tag_name}>",
139+
);
122140
}
123141
}
124142
}

0 commit comments

Comments
 (0)