Skip to content

Commit cfb6a53

Browse files
sirrealwestonruter
andauthored
Improve types in tests
Co-authored-by: Weston Ruter <[email protected]>
1 parent c5ef32a commit cfb6a53

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ public function test_set_modifiable_fails_non_atomic_tags(
8282
string $html,
8383
string $expected_namespace,
8484
string $expected_tag
85-
) {
85+
): void {
8686
$processor = WP_HTML_Processor::create_fragment( $html );
87+
$this->assertInstanceOf( WP_HTML_Tag_Processor::class, $processor );
8788
while ( $processor->next_tag() && $expected_tag !== $processor->get_tag() ) {
8889
continue;
8990
}
@@ -102,6 +103,8 @@ public function test_set_modifiable_fails_non_atomic_tags(
102103

103104
/**
104105
* Data provider.
106+
*
107+
* @return array<string, array{0: string, 1: string, 2: string}>
105108
*/
106109
public static function data_set_modifiable_fails_non_atomic_tags(): array {
107110
return array(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public function test_set_modifiable_fails_non_atomic_tags(
678678
string $html,
679679
string $parsing_namespace,
680680
string $expected_tag
681-
) {
681+
): void {
682682
$processor = new WP_HTML_Tag_Processor( $html );
683683
$processor->change_parsing_namespace( $parsing_namespace );
684684
$processor->next_token();
@@ -697,9 +697,9 @@ public function test_set_modifiable_fails_non_atomic_tags(
697697
/**
698698
* Data provider.
699699
*
700-
* @return array[]
700+
* @return array<string, array{0: string, 1: string, 2: string}>
701701
*/
702-
public static function data_set_modifiable_fails_non_atomic_tags() {
702+
public static function data_set_modifiable_fails_non_atomic_tags(): array {
703703
return array(
704704
// Plain HTML tags.
705705
'html DIV' => array( '<div>', 'html', 'DIV' ),

0 commit comments

Comments
 (0)