You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( $id === $processor->get_attribute( 'id' ) ) {
2000
+
return$processor->get_modifiable_text();
2001
+
}
2002
+
}
2003
+
returnnull;
2004
+
}
2005
+
1989
2006
/**
1990
2007
* Data provider.
1991
2008
*
@@ -2741,10 +2758,8 @@ static function ( $relative, $src, $is_module ) use ( &$filtered ) {
2741
2758
$this->assertTrue( $filter_args['is_module'], 'Filter should receive $is_module=true for script modules.' );
2742
2759
}
2743
2760
2744
-
$processor = newWP_HTML_Tag_Processor( $output );
2745
-
$this->assertTrue( $processor->next_tag( 'SCRIPT' ), 'Output should contain a SCRIPT tag.' );
2746
-
$script_text = $processor->get_modifiable_text();
2747
-
$this->assertStringContainsString( 'wp-script-module-translation-data-test-module', $script_text, 'Translation inline script should be printed with the expected ID.' );
$this->assertNotNull( $script_text, 'Translation inline script should be printed with the expected ID.' );
2748
2763
$this->assertStringContainsString( 'wp.i18n.setLocaleData', $script_text, 'Output should call wp.i18n.setLocaleData().' );
2749
2764
$this->assertStringContainsString( 'Hola', $script_text, 'Output should contain the translated string.' );
2750
2765
}
@@ -2808,10 +2823,8 @@ static function ( $relative, $src, $is_module ) use ( &$filtered ) {
2808
2823
$this->assertTrue( $filter_args['is_module'], 'Filter should receive $is_module=true for script modules.' );
2809
2824
}
2810
2825
2811
-
$processor = newWP_HTML_Tag_Processor( $output );
2812
-
$this->assertTrue( $processor->next_tag( 'SCRIPT' ), 'Output should contain a SCRIPT tag.' );
2813
-
$script_text = $processor->get_modifiable_text();
2814
-
$this->assertStringContainsString( 'wp-script-module-translation-data-dep-module', $script_text, 'Dependency module translations should be printed.' );
0 commit comments