Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/09/2018 07:53:28 PM (6 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/forums/functions/counts.php

    r6036 r6848  
    415415        $f1 = $this->factory->forum->create();
    416416
     417        $count = bbp_get_forum_subforum_count( $f1, true );
     418        $this->assertSame( 0, $count );
     419
    417420        $f2 = $this->factory->forum->create_many( 3, array(
    418421            'post_parent' => $f1,
     
    420423
    421424        $count = bbp_get_forum_subforum_count( $f1, true );
    422         $this->assertSame( 0, $count );
     425        $this->assertSame( 3, $count );
     426
     427        bbp_update_forum_subforum_count( $f1, 10 );
     428
     429        $count = bbp_get_forum_subforum_count( $f1, true );
     430        $this->assertSame( 10, $count );
    423431
    424432        bbp_update_forum_subforum_count( $f1 );
Note: See TracChangeset for help on using the changeset viewer.