Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/09/2018 07:53:28 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Tests: get all post type/status counts using bbp_get_child_counts().

  • Fix a broken test, and improve a few others
  • Update several count() instances that were doing expensive _ids() counts
  • Strategically bust the bbpress_posts query cache group on updates

This change improves general performance and count reliability by ensuring the accuracy of forum/topic/reply relationship totals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/common/query.php

    r5954 r6848  
    5050
    5151    /**
    52      * @group  counts
     52     * @group  jjj
    5353     * @covers ::bbp_get_public_child_count
    5454     */
    5555    public function test_bbp_get_public_child_count() {
     56
     57        /* Empty Forum ********************************************************/
     58
    5659        $f = $this->factory->forum->create();
    5760
    58         // Test initial forum public child counts
     61        // Test initial zero forum public child counts
    5962        $count = bbp_get_public_child_count( $f, bbp_get_forum_post_type() );
    6063        $this->assertSame( 0, $count );
     
    6568        /* Sub-Forums *********************************************************/
    6669
     70        // 3 public sub-forums
    6771        $this->factory->forum->create_many( 3, array(
    6872            'post_parent' => $f,
    6973        ) );
    7074
     75        // 1 private sub-forum
    7176        $this->factory->forum->create( array(
    7277            'post_parent' => $f,
Note: See TracChangeset for help on using the changeset viewer.