Changeset 53778 for trunk/tests/phpunit/tests/post/revisions.php
- Timestamp:
- 07/25/2022 07:18:41 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/revisions.php
r53769 r53778 657 657 658 658 /** 659 * Tests that wp_get_last_revision_id_and_total_count() returns the last revision ID and total count. 660 * 659 * Tests that wp_get_latest_revision_id_and_total_count() returns the latest revision ID and total count. 660 * 661 * @covers ::wp_get_latest_revision_id_and_total_count 661 662 * @ticket 55857 662 663 * @dataProvider data_wp_get_post_revisions_url 663 664 */ 664 public function test_wp_get_la st_revision_id_and_total_count( $revisions ) {665 public function test_wp_get_latest_revision_id_and_total_count( $revisions ) { 665 666 $post_id = self::factory()->post->create(); 666 667 for ( $i = 0; $i < $revisions; ++$i ) { … … 673 674 } 674 675 675 $post_revisions = wp_get_post_revisions( $post_id );676 $la st_post_revision = current( $post_revisions );677 $revision = wp_get_last_revision_id_and_total_count( $post_id );676 $post_revisions = wp_get_post_revisions( $post_id ); 677 $latest_post_revision = current( $post_revisions ); 678 $revision = wp_get_latest_revision_id_and_total_count( $post_id ); 678 679 679 680 $this->assertSame( 680 $la st_post_revision->ID,681 $latest_post_revision->ID, 681 682 $revision['revision'], 682 'The la st revision ID does not match.'683 'The latest revision ID does not match.' 683 684 ); 684 685 … … 691 692 692 693 /** 693 * Tests that wp_get_last_revision_id_and_total_count() returns a WP_Error when no revisions exist. 694 * 694 * Tests that wp_get_latest_revision_id_and_total_count() returns a WP_Error when no revisions exist. 695 * 696 * @covers ::wp_get_latest_revision_id_and_total_count 695 697 * @ticket 55857 696 698 */ 697 public function test_wp_get_la st_revision_id_and_total_count_no_revisions() {698 $revision = wp_get_la st_revision_id_and_total_count( null );699 public function test_wp_get_latest_revision_id_and_total_count_no_revisions() { 700 $revision = wp_get_latest_revision_id_and_total_count( null ); 699 701 700 702 $this->assertWPError( $revision, 'Invalid post, no revisions should exist.' ); … … 703 705 add_filter( 'wp_revisions_to_keep', '__return_zero' ); 704 706 $post_id = self::factory()->post->create(); 705 $revision = wp_get_la st_revision_id_and_total_count( $post_id );707 $revision = wp_get_latest_revision_id_and_total_count( $post_id ); 706 708 707 709 $this->assertWPError( $revision, 'Revisions should not be enabled.' );
Note: See TracChangeset
for help on using the changeset viewer.