@@ -435,7 +435,7 @@ public function test_permalinks_with_trailing_slash_produce_links_with_trailing_
435435 $ found_links = 0 ;
436436 while ( $ processor ->next_tag ( 'A ' ) ) {
437437 ++$ found_links ;
438- $ href = $ processor ->get_attribute ( 'href ' );
438+ $ href = ( string ) $ processor ->get_attribute ( 'href ' );
439439 $ this ->assertStringEndsWith ( '/ ' , $ href , "Pagination links should end with a trailing slash, found: $ href " );
440440 }
441441 $ this ->assertGreaterThan ( 0 , $ found_links , 'There should be pagination links found. ' );
@@ -459,8 +459,8 @@ public function test_permalinks_without_trailing_slash_produce_links_without_tra
459459 $ found_links = 0 ;
460460 while ( $ processor ->next_tag ( 'A ' ) ) {
461461 ++$ found_links ;
462- $ href = $ processor ->get_attribute ( 'href ' );
463- $ this ->assertStringEndsNotWith ( '/ ' , $ href , "Pagination links should end with a trailing slash, found: $ href " );
462+ $ href = ( string ) $ processor ->get_attribute ( 'href ' );
463+ $ this ->assertStringEndsNotWith ( '/ ' , $ href , "Pagination links should not end with a trailing slash, found: $ href " );
464464 }
465465 $ this ->assertGreaterThan ( 0 , $ found_links , 'There should be pagination links found. ' );
466466 }
@@ -474,7 +474,6 @@ public function test_permalinks_without_trailing_slash_produce_links_without_tra
474474 * @dataProvider data_query_strings
475475 *
476476 * @param string $query_string Query string.
477- * @param string $unexpected Unexpected query string.
478477 */
479478 public function test_permalinks_with_trailing_slash_do_not_modify_query_strings ( string $ query_string ) {
480479 update_option ( 'posts_per_page ' , 2 );
@@ -489,7 +488,7 @@ public function test_permalinks_with_trailing_slash_do_not_modify_query_strings(
489488 $ found_links = 0 ;
490489 while ( $ processor ->next_tag ( 'A ' ) ) {
491490 ++$ found_links ;
492- $ href = $ processor ->get_attribute ( 'href ' );
491+ $ href = ( string ) $ processor ->get_attribute ( 'href ' );
493492 $ this ->assertStringEndsWith ( "/? {$ query_string }" , $ href , "Pagination links should not modify the query string, found: $ href " );
494493 }
495494 $ this ->assertGreaterThan ( 0 , $ found_links , 'There should be pagination links found. ' );
@@ -504,7 +503,6 @@ public function test_permalinks_with_trailing_slash_do_not_modify_query_strings(
504503 * @dataProvider data_query_strings
505504 *
506505 * @param string $query_string Query string.
507- * @param string $unexpected Unexpected query string.
508506 */
509507 public function test_permalinks_without_trailing_slash_do_not_modify_query_strings ( string $ query_string ) {
510508 update_option ( 'posts_per_page ' , 2 );
@@ -519,7 +517,7 @@ public function test_permalinks_without_trailing_slash_do_not_modify_query_strin
519517 $ found_links = 0 ;
520518 while ( $ processor ->next_tag ( 'A ' ) ) {
521519 ++$ found_links ;
522- $ href = $ processor ->get_attribute ( 'href ' );
520+ $ href = ( string ) $ processor ->get_attribute ( 'href ' );
523521 $ this ->assertStringEndsWith ( "? {$ query_string }" , $ href , "Pagination links should not modify the query string, found: $ href " );
524522 $ this ->assertStringEndsNotWith ( "/? {$ query_string }" , $ href , "Pagination links should not be slashed before the query string, found: $ href " );
525523 }
@@ -531,12 +529,12 @@ public function test_permalinks_without_trailing_slash_do_not_modify_query_strin
531529 * - test_permalinks_without_trailing_slash_do_not_modify_query_strings
532530 * - test_permalinks_with_trailing_slash_do_not_modify_query_strings
533531 *
534- * @return array<string[] > Data provider.
532+ * @return array<string, array{ 0: string } > Data provider.
535533 */
536534 public function data_query_strings (): array {
537535 return array (
538- array ( 'foo=bar ' ),
539- array ( 'foo=bar&pen=pencil ' ),
536+ ' single query var ' => array ( 'foo=bar ' ),
537+ ' multi query vars ' => array ( 'foo=bar&pen=pencil ' ),
540538 );
541539 }
542540}
0 commit comments