Skip to:
Content

bbPress.org

Changeset 6846


Ignore:
Timestamp:
08/08/2018 06:24:20 PM (22 months ago)
Author:
johnjamesjacoby
Message:

Tests: use correct post type and factory in test_bbp_clean_post_cache().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/cache.php

    r6585 r6846  
    88
    99    /**
     10     * @group counts
    1011     * @covers ::bbp_clean_post_cache
    1112     */
    1213    public function test_bbp_clean_post_cache() {
    1314
    14         // Get the topic post type.
     15        // Get the post types.
    1516        $tpt = bbp_get_topic_post_type();
    16         $rpt = bbp_get_topic_post_type();
     17        $rpt = bbp_get_reply_post_type();
    1718
    1819        // Set up a forum with 1 topic and 1 reply to that topic.
     
    2425            ),
    2526        ) );
    26         $r = $this->factory->topic->create( array(
     27        $r = $this->factory->reply->create( array(
    2728            'post_parent' => $t,
    2829            'reply_meta' => array(
     
    4041        $t_key        = md5( serialize( array( 'parent_id' => $t, 'post_type' => $rpt ) ) );
    4142        $last_changed = wp_cache_get_last_changed( 'bbpress_posts' );
    42        
     43
    4344        // Keys
    4445        $f_key = "bbp_child_ids:{$f_key}:{$last_changed}";
     
    4849        $this->assertEquals( array( $r ), wp_cache_get( $t_key, 'bbpress_posts' ) );
    4950
    50         // Clean the cache.
     51        // Clean the reply cache.
    5152        clean_post_cache( $r );
    5253
    5354        // Setup
    5455        $last_changed = wp_cache_get_last_changed( 'bbpress_posts' );
    55        
     56
    5657        // Keys
    5758        $f_key = "bbp_child_ids:{$f_key}:{$last_changed}";
Note: See TracChangeset for help on using the changeset viewer.