Changeset 48937 for trunk/tests/phpunit/tests/query/results.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/results.php
r47122 r48937 319 319 ); 320 320 321 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );321 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 322 322 } 323 323 … … 327 327 // There are 4 posts with Tag A. 328 328 $this->assertCount( 4, $posts ); 329 $this->assert Equals( 'tags-a-and-c', $posts[0]->post_name );330 $this->assert Equals( 'tags-a-and-b', $posts[1]->post_name );331 $this->assert Equals( 'tag-a', $posts[2]->post_name );332 $this->assert Equals( 'tags-a-b-c', $posts[3]->post_name );329 $this->assertSame( 'tags-a-and-c', $posts[0]->post_name ); 330 $this->assertSame( 'tags-a-and-b', $posts[1]->post_name ); 331 $this->assertSame( 'tag-a', $posts[2]->post_name ); 332 $this->assertSame( 'tags-a-b-c', $posts[3]->post_name ); 333 333 } 334 334 … … 338 338 // There are 4 posts with Tag A. 339 339 $this->assertCount( 4, $posts ); 340 $this->assert Equals( 'tags-b-and-c', $posts[0]->post_name );341 $this->assert Equals( 'tags-a-and-b', $posts[1]->post_name );342 $this->assert Equals( 'tag-b', $posts[2]->post_name );343 $this->assert Equals( 'tags-a-b-c', $posts[3]->post_name );340 $this->assertSame( 'tags-b-and-c', $posts[0]->post_name ); 341 $this->assertSame( 'tags-a-and-b', $posts[1]->post_name ); 342 $this->assertSame( 'tag-b', $posts[2]->post_name ); 343 $this->assertSame( 'tags-a-b-c', $posts[3]->post_name ); 344 344 } 345 345 … … 352 352 // There is 1 post with Tag נ. 353 353 $this->assertCount( 1, $posts ); 354 $this->assert Equals( 'tag-%d7%a0', $posts[0]->post_name );354 $this->assertSame( 'tag-%d7%a0', $posts[0]->post_name ); 355 355 } 356 356 … … 361 361 // There are 4 posts with Tag A. 362 362 $this->assertCount( 4, $posts ); 363 $this->assert Equals( 'tags-a-and-c', $posts[0]->post_name );364 $this->assert Equals( 'tags-a-and-b', $posts[1]->post_name );365 $this->assert Equals( 'tag-a', $posts[2]->post_name );366 $this->assert Equals( 'tags-a-b-c', $posts[3]->post_name );363 $this->assertSame( 'tags-a-and-c', $posts[0]->post_name ); 364 $this->assertSame( 'tags-a-and-b', $posts[1]->post_name ); 365 $this->assertSame( 'tag-a', $posts[2]->post_name ); 366 $this->assertSame( 'tags-a-b-c', $posts[3]->post_name ); 367 367 } 368 368 … … 372 372 // There are 4 posts with either Tag B or Tag C. 373 373 $this->assertCount( 6, $posts ); 374 $this->assert Equals( 'tags-a-and-c', $posts[0]->post_name );375 $this->assert Equals( 'tags-b-and-c', $posts[1]->post_name );376 $this->assert Equals( 'tags-a-and-b', $posts[2]->post_name );377 $this->assert Equals( 'tag-c', $posts[3]->post_name );378 $this->assert Equals( 'tag-b', $posts[4]->post_name );379 $this->assert Equals( 'tags-a-b-c', $posts[5]->post_name );374 $this->assertSame( 'tags-a-and-c', $posts[0]->post_name ); 375 $this->assertSame( 'tags-b-and-c', $posts[1]->post_name ); 376 $this->assertSame( 'tags-a-and-b', $posts[2]->post_name ); 377 $this->assertSame( 'tag-c', $posts[3]->post_name ); 378 $this->assertSame( 'tag-b', $posts[4]->post_name ); 379 $this->assertSame( 'tags-a-b-c', $posts[5]->post_name ); 380 380 } 381 381 … … 388 388 // There are 6 posts with either Tag A or Tag B. 389 389 $this->assertCount( 6, $posts ); 390 $this->assert Equals( 'tags-a-and-c', $posts[0]->post_name );391 $this->assert Equals( 'tags-b-and-c', $posts[1]->post_name );392 $this->assert Equals( 'tags-a-and-b', $posts[2]->post_name );393 $this->assert Equals( 'tag-b', $posts[3]->post_name );394 $this->assert Equals( 'tag-a', $posts[4]->post_name );395 $this->assert Equals( 'tags-a-b-c', $posts[5]->post_name );390 $this->assertSame( 'tags-a-and-c', $posts[0]->post_name ); 391 $this->assertSame( 'tags-b-and-c', $posts[1]->post_name ); 392 $this->assertSame( 'tags-a-and-b', $posts[2]->post_name ); 393 $this->assertSame( 'tag-b', $posts[3]->post_name ); 394 $this->assertSame( 'tag-a', $posts[4]->post_name ); 395 $this->assertSame( 'tags-a-b-c', $posts[5]->post_name ); 396 396 } 397 397 … … 415 415 ); 416 416 417 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );417 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 418 418 } 419 419 … … 425 425 // There are 4 posts with Tag A, only 2 when we exclude Tag B. 426 426 $this->assertCount( 2, $posts ); 427 $this->assert Equals( 'tags-a-and-c', $posts[0]->post_name );428 $this->assert Equals( 'tag-a', $posts[1]->post_name );427 $this->assertSame( 'tags-a-and-c', $posts[0]->post_name ); 428 $this->assertSame( 'tag-a', $posts[1]->post_name ); 429 429 } 430 430 … … 436 436 // There are 4 posts with Cat A, we'll check for them by name. 437 437 $this->assertCount( 4, $posts ); 438 $this->assert Equals( 'cat-a', $posts[0]->post_name );439 $this->assert Equals( 'cats-a-and-c', $posts[1]->post_name );440 $this->assert Equals( 'cats-a-and-b', $posts[2]->post_name );441 $this->assert Equals( 'cats-a-b-c', $posts[3]->post_name );438 $this->assertSame( 'cat-a', $posts[0]->post_name ); 439 $this->assertSame( 'cats-a-and-c', $posts[1]->post_name ); 440 $this->assertSame( 'cats-a-and-b', $posts[2]->post_name ); 441 $this->assertSame( 'cats-a-b-c', $posts[3]->post_name ); 442 442 } 443 443 … … 448 448 // There are 4 posts with Cat B. 449 449 $this->assertCount( 4, $posts ); 450 $this->assert Equals( 'cat-b', $posts[0]->post_name );451 $this->assert Equals( 'cats-b-and-c', $posts[1]->post_name );452 $this->assert Equals( 'cats-a-and-b', $posts[2]->post_name );453 $this->assert Equals( 'cats-a-b-c', $posts[3]->post_name );450 $this->assertSame( 'cat-b', $posts[0]->post_name ); 451 $this->assertSame( 'cats-b-and-c', $posts[1]->post_name ); 452 $this->assertSame( 'cats-a-and-b', $posts[2]->post_name ); 453 $this->assertSame( 'cats-a-b-c', $posts[3]->post_name ); 454 454 } 455 455 … … 466 466 467 467 $this->assertCount( 5, $posts ); 468 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );468 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 469 469 } 470 470 … … 486 486 487 487 $this->assertCount( 10, $posts ); 488 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );488 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 489 489 } 490 490 … … 507 507 $this->assertCount( 10, $posts ); 508 508 $this->assertTrue( $this->q->is_paged() ); 509 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );509 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 510 510 } 511 511 … … 522 522 $this->assertCount( 4, $posts ); 523 523 $this->assertTrue( $this->q->is_paged() ); 524 $this->assert Equals( $expected, wp_list_pluck( $posts, 'post_name' ) );524 $this->assertSame( $expected, wp_list_pluck( $posts, 'post_name' ) ); 525 525 } 526 526 … … 538 538 ); 539 539 540 $this->assert Equals(540 $this->assertSame( 541 541 array( 542 542 'child-one', … … 555 555 ); 556 556 557 $this->assert Equals(557 $this->assertSame( 558 558 array( 559 559 'child-three', … … 572 572 ); 573 573 574 $this->assert Equals(574 $this->assertSame( 575 575 array( 576 576 'child-one', … … 589 589 ); 590 590 591 $this->assert Equals( array(), wp_list_pluck( $posts, 'post_title' ) );591 $this->assertSame( array(), wp_list_pluck( $posts, 'post_title' ) ); 592 592 } 593 593 … … 604 604 ); 605 605 606 $this->assert Equals(606 $this->assertSame( 607 607 array( 608 608 'child-three', … … 631 631 632 632 // 'order=desc' does not influence the order of returned results (returns same order as 'order=asc'). 633 $this->assert Equals( $expected_returned_array, wp_list_pluck( $posts, 'post_title' ) );633 $this->assertSame( $expected_returned_array, wp_list_pluck( $posts, 'post_title' ) ); 634 634 } 635 635
Note: See TracChangeset
for help on using the changeset viewer.