@@ -968,12 +968,12 @@ public function test_varying_versions_added_to_handle_args_registered_then_enque
968968 *
969969 * @dataProvider data_duplicate_query_vars_and_fragments_preserved_in_styles
970970 *
971- * @param string $src The stylesheet's source URL.
972- * @param string|null $ver The style's version.
973- * @param string $expected_url The expected URL.
974- * @param string $handle Optional. The style's registered handle. Default 'test-style'.
971+ * @param string $src The stylesheet's source URL.
972+ * @param string|bool| null $ver The style's version.
973+ * @param string $expected_url The expected URL.
974+ * @param string $handle Optional. The style's registered handle. Default 'test-style'.
975975 */
976- public function test_duplicate_query_vars_and_fragments_preserved_in_styles ( string $ src , ? string $ ver , string $ expected_url , string $ handle = 'test-style ' ): void {
976+ public function test_duplicate_query_vars_and_fragments_preserved_in_styles ( string $ src , $ ver , string $ expected_url , string $ handle = 'test-style ' ): void {
977977 wp_enqueue_style ( $ handle , $ src , array (), $ ver );
978978 $ output = get_echo ( 'wp_print_styles ' );
979979 $ processor = new WP_HTML_Tag_Processor ( $ output );
@@ -985,32 +985,39 @@ public function test_duplicate_query_vars_and_fragments_preserved_in_styles( str
985985 /**
986986 * Data provider for test_duplicate_query_vars_and_fragments_preserved_in_styles.
987987 *
988- * @return array<string, array{src: string, ver: string|null, expected_url: string, handle?: string}> Data provider.
988+ * @return array<string, array{src: string, ver: string|bool| null, expected_url: string, handle?: string}> Data provider.
989989 */
990990 public function data_duplicate_query_vars_and_fragments_preserved_in_styles (): array {
991+ $ ver = get_bloginfo ( 'version ' );
992+
991993 return array (
992- 'duplicate query vars ' => array (
994+ 'duplicate query vars ' => array (
993995 'src ' => 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap ' ,
994996 'ver ' => '1.0 ' ,
995997 'expected_url ' => 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap&ver=1.0 ' ,
996998 ),
997- 'duplicate query vars, null version ' => array (
999+ 'duplicate query vars, null version ' => array (
9981000 'src ' => 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap ' ,
9991001 'ver ' => null ,
10001002 'expected_url ' => 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap ' ,
10011003 ),
1002- 'duplicate query vars in handle ' => array (
1004+ 'duplicate query vars, false version ' => array (
1005+ 'src ' => 'https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap ' ,
1006+ 'ver ' => false ,
1007+ 'expected_url ' => "https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap&ver= $ ver " ,
1008+ ),
1009+ 'duplicate query vars in handle ' => array (
10031010 'src ' => 'https://example.com/test-style.css ' ,
10041011 'ver ' => '1.0 ' ,
10051012 'expected_url ' => 'https://example.com/test-style.css?ver=1.0&a=1&a=2 ' ,
10061013 'handle ' => 'test-style?a=1&a=2 ' ,
10071014 ),
1008- 'duplicate query vars and fragments ' => array (
1015+ 'duplicate query vars and fragments ' => array (
10091016 'src ' => 'https://example.com/style.css?arg=1&arg=2#anchor ' ,
10101017 'ver ' => '1.0 ' ,
10111018 'expected_url ' => 'https://example.com/style.css?arg=1&arg=2&ver=1.0#anchor ' ,
10121019 ),
1013- 'zero query var in handle ' => array (
1020+ 'zero query var in handle ' => array (
10141021 'src ' => 'https://example.com/test-style.css ' ,
10151022 'ver ' => '1.0 ' ,
10161023 'expected_url ' => 'https://example.com/test-style.css?ver=1.0&0 ' ,
0 commit comments