Skip to content

Commit 8cb025e

Browse files
Tests: Remove duplicated array keys in test data.
This removes redundant array entries that were silently overwritten by a later key with the same name. Follow-up to [943/tests], [53941], [59866]. Props Soean. See #64894. git-svn-id: https://develop.svn.wordpress.org/trunk@62675 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9645ea0 commit 8cb025e

3 files changed

Lines changed: 7 additions & 60 deletions

File tree

tests/phpunit/tests/blocks/wpBlock.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,9 +1301,8 @@ public function test_build_query_vars_from_block_query_exclude_sticky_posts() {
13011301
'post_type' => 'post',
13021302
'order' => 'DESC',
13031303
'orderby' => 'date',
1304-
'post__not_in' => array(),
1305-
'tax_query' => array(),
13061304
'post__not_in' => array( $sticky_post_id ),
1305+
'tax_query' => array(),
13071306
),
13081307
$query_args
13091308
);

tests/phpunit/tests/functions.php

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -457,16 +457,7 @@ public function test_add_query_arg() {
457457

458458
$this->assertSame( "$url?foo=1", add_query_arg( 'foo', '1', $url ) );
459459
$this->assertSame( "$url?foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
460-
$this->assertSame(
461-
"$url?foo=2",
462-
add_query_arg(
463-
array(
464-
'foo' => '1',
465-
'foo' => '2',
466-
),
467-
$url
468-
)
469-
);
460+
$this->assertSame( "$url?foo=2", add_query_arg( array( 'foo' => '2' ), $url ) );
470461
$this->assertSame(
471462
"$url?foo=1&bar=2",
472463
add_query_arg(
@@ -482,15 +473,7 @@ public function test_add_query_arg() {
482473

483474
$this->assertSame( "$url?foo=1", add_query_arg( 'foo', '1' ) );
484475
$this->assertSame( "$url?foo=1", add_query_arg( array( 'foo' => '1' ) ) );
485-
$this->assertSame(
486-
"$url?foo=2",
487-
add_query_arg(
488-
array(
489-
'foo' => '1',
490-
'foo' => '2',
491-
)
492-
)
493-
);
476+
$this->assertSame( "$url?foo=2", add_query_arg( array( 'foo' => '2' ) ) );
494477
$this->assertSame(
495478
"$url?foo=1&bar=2",
496479
add_query_arg(
@@ -508,16 +491,7 @@ public function test_add_query_arg() {
508491

509492
$this->assertSame( "$url?foo=1#frag", add_query_arg( 'foo', '1', $frag_url ) );
510493
$this->assertSame( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ), $frag_url ) );
511-
$this->assertSame(
512-
"$url?foo=2#frag",
513-
add_query_arg(
514-
array(
515-
'foo' => '1',
516-
'foo' => '2',
517-
),
518-
$frag_url
519-
)
520-
);
494+
$this->assertSame( "$url?foo=2#frag", add_query_arg( array( 'foo' => '2' ), $frag_url ) );
521495
$this->assertSame(
522496
"$url?foo=1&bar=2#frag",
523497
add_query_arg(
@@ -533,15 +507,7 @@ public function test_add_query_arg() {
533507

534508
$this->assertSame( "$url?foo=1#frag", add_query_arg( 'foo', '1' ) );
535509
$this->assertSame( "$url?foo=1#frag", add_query_arg( array( 'foo' => '1' ) ) );
536-
$this->assertSame(
537-
"$url?foo=2#frag",
538-
add_query_arg(
539-
array(
540-
'foo' => '1',
541-
'foo' => '2',
542-
)
543-
)
544-
);
510+
$this->assertSame( "$url?foo=2#frag", add_query_arg( array( 'foo' => '2' ) ) );
545511
$this->assertSame(
546512
"$url?foo=1&bar=2#frag",
547513
add_query_arg(
@@ -570,16 +536,7 @@ public function test_add_query_arg() {
570536

571537
$this->assertSame( "$url&foo=1", add_query_arg( 'foo', '1', $url ) );
572538
$this->assertSame( "$url&foo=1", add_query_arg( array( 'foo' => '1' ), $url ) );
573-
$this->assertSame(
574-
"$url&foo=2",
575-
add_query_arg(
576-
array(
577-
'foo' => '1',
578-
'foo' => '2',
579-
),
580-
$url
581-
)
582-
);
539+
$this->assertSame( "$url&foo=2", add_query_arg( array( 'foo' => '2' ), $url ) );
583540
$this->assertSame(
584541
"$url&foo=1&bar=2",
585542
add_query_arg(
@@ -595,15 +552,7 @@ public function test_add_query_arg() {
595552

596553
$this->assertSame( "$url&foo=1", add_query_arg( 'foo', '1' ) );
597554
$this->assertSame( "$url&foo=1", add_query_arg( array( 'foo' => '1' ) ) );
598-
$this->assertSame(
599-
"$url&foo=2",
600-
add_query_arg(
601-
array(
602-
'foo' => '1',
603-
'foo' => '2',
604-
)
605-
)
606-
);
555+
$this->assertSame( "$url&foo=2", add_query_arg( array( 'foo' => '2' ) ) );
607556
$this->assertSame(
608557
"$url&foo=1&bar=2",
609558
add_query_arg(

tests/phpunit/tests/query/cacheResults.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@ public function test_query_cache_different_args() {
12161216
'cache_results' => true,
12171217
'fields' => 'ids',
12181218
'suppress_filters' => true,
1219-
'cache_results' => true,
12201219
'update_post_meta_cache' => false,
12211220
'update_post_term_cache' => false,
12221221
'lazy_load_term_meta' => false,

0 commit comments

Comments
 (0)