Make WordPress Core


Ignore:
Timestamp:
11/07/2022 05:45:29 PM (18 months ago)
Author:
SergeyBiryukov
Message:

Tests: Combine duplicate update_posts_count() tests.

This combines the newer test for update_posts_count() located in its own file with the pre-existing one from tests/multisite/site.php, which was essentially testing the same thing in a similar way.

Includes:

  • Renaming the test class per the naming conventions.
  • Adjusting comments per the documentation standards.
  • Updating @covers tags for accuracy.
  • Removing unnecessary blog switching.
  • Using assertSame() to check the value type.

Follow-up to [28835], [29667], [52207].

See #57023, #56793.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/site.php

    r54757 r54760  
    442442
    443443        /**
    444          * @ticket 27952
    445          */
    446         public function test_posts_count() {
    447             self::factory()->post->create();
    448             $post2 = self::factory()->post->create();
    449             $this->assertSame( 2, get_site()->post_count );
    450 
    451             wp_delete_post( $post2 );
    452             $this->assertSame( 1, get_site()->post_count );
    453         }
    454 
    455         /**
    456444         * @ticket 26410
    457445         */
Note: See TracChangeset for help on using the changeset viewer.