Changeset 62247
- Timestamp:
- 04/20/2026 11:11:32 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/link/getAdjacentPost.php
r61424 r62247 478 478 // Should find post_one (previous post that shares term1). 479 479 $this->assertInstanceOf( WP_Post::class, $result ); 480 $this->assert Equals( $post1_id, $result->ID );480 $this->assertSame( $post1_id, $result->ID ); 481 481 482 482 // Test next post. … … 485 485 // Should find post_three (next post that shares term1). 486 486 $this->assertInstanceOf( WP_Post::class, $result ); 487 $this->assert Equals( $post3_id, $result->ID );487 $this->assertSame( $post3_id, $result->ID ); 488 488 } 489 489 … … 615 615 $previous = get_adjacent_post( false, '', true ); 616 616 $this->assertInstanceOf( 'WP_Post', $previous ); 617 $this->assert Equals( $post_ids[1], $previous->ID );617 $this->assertSame( $post_ids[1], $previous->ID ); 618 618 619 619 // Next post should be the 4th post (higher ID, same date). 620 620 $next = get_adjacent_post( false, '', false ); 621 621 $this->assertInstanceOf( 'WP_Post', $next ); 622 $this->assert Equals( $post_ids[3], $next->ID );622 $this->assertSame( $post_ids[3], $next->ID ); 623 623 } 624 624 … … 662 662 $previous = get_adjacent_post( false, '', true ); 663 663 $this->assertInstanceOf( 'WP_Post', $previous ); 664 $this->assert Equals( $post_early, $previous->ID );664 $this->assertSame( $post_early, $previous->ID ); 665 665 666 666 // Next should be the second identical post (same date, higher ID). 667 667 $next = get_adjacent_post( false, '', false ); 668 668 $this->assertInstanceOf( 'WP_Post', $next ); 669 $this->assert Equals( $post_ids[1], $next->ID );669 $this->assertSame( $post_ids[1], $next->ID ); 670 670 671 671 // Test from middle identical post. … … 675 675 $previous = get_adjacent_post( false, '', true ); 676 676 $this->assertInstanceOf( 'WP_Post', $previous ); 677 $this->assert Equals( $post_ids[0], $previous->ID );677 $this->assertSame( $post_ids[0], $previous->ID ); 678 678 679 679 // Next should be the third identical post (same date, higher ID). 680 680 $next = get_adjacent_post( false, '', false ); 681 681 $this->assertInstanceOf( 'WP_Post', $next ); 682 $this->assert Equals( $post_ids[2], $next->ID );682 $this->assertSame( $post_ids[2], $next->ID ); 683 683 684 684 // Test from last identical post. … … 688 688 $previous = get_adjacent_post( false, '', true ); 689 689 $this->assertInstanceOf( 'WP_Post', $previous ); 690 $this->assert Equals( $post_ids[1], $previous->ID );690 $this->assertSame( $post_ids[1], $previous->ID ); 691 691 692 692 // Next should be the late post (different date). 693 693 $next = get_adjacent_post( false, '', false ); 694 694 $this->assertInstanceOf( 'WP_Post', $next ); 695 $this->assert Equals( $post_late, $next->ID );695 $this->assertSame( $post_late, $next->ID ); 696 696 } 697 697 … … 720 720 // From post 1, next should be post 2. 721 721 $next = get_adjacent_post( false, '', false ); 722 $this->assert Equals( $post_ids[1], $next->ID );722 $this->assertSame( $post_ids[1], $next->ID ); 723 723 724 724 // From post 2, previous should be post 1, next should be post 3. 725 725 $this->go_to( get_permalink( $post_ids[1] ) ); 726 726 $previous = get_adjacent_post( false, '', true ); 727 $this->assert Equals( $post_ids[0], $previous->ID );727 $this->assertSame( $post_ids[0], $previous->ID ); 728 728 $next = get_adjacent_post( false, '', false ); 729 $this->assert Equals( $post_ids[2], $next->ID );729 $this->assertSame( $post_ids[2], $next->ID ); 730 730 731 731 // From post 3, previous should be post 2, next should be post 4. 732 732 $this->go_to( get_permalink( $post_ids[2] ) ); 733 733 $previous = get_adjacent_post( false, '', true ); 734 $this->assert Equals( $post_ids[1], $previous->ID );734 $this->assertSame( $post_ids[1], $previous->ID ); 735 735 $next = get_adjacent_post( false, '', false ); 736 $this->assert Equals( $post_ids[3], $next->ID );736 $this->assertSame( $post_ids[3], $next->ID ); 737 737 738 738 // From post 4, previous should be post 3. 739 739 $this->go_to( get_permalink( $post_ids[3] ) ); 740 740 $previous = get_adjacent_post( false, '', true ); 741 $this->assert Equals( $post_ids[2], $previous->ID );741 $this->assertSame( $post_ids[2], $previous->ID ); 742 742 } 743 743 … … 778 778 $next = get_adjacent_post( true, '', false, 'category' ); 779 779 $this->assertInstanceOf( 'WP_Post', $next ); 780 $this->assert Equals( $post_ids[3], $next->ID ); // Post 4 (in category)780 $this->assertSame( $post_ids[3], $next->ID ); // Post 4 (in category) 781 781 } 782 782 }
Note: See TracChangeset
for help on using the changeset viewer.