Skip to:
Content

bbPress.org

Changeset 5883


Ignore:
Timestamp:
07/28/2015 10:27:08 AM (11 years ago)
Author:
netweb
Message:

Installation: When creating initial content, use different times for forum, topic, and reply post times.

This changeset builds on r5843 to allow improved tests in test_bbp_create_initial_content() of forum and topic last active times.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/update.php

    r5843 r5883  
    193193
    194194        // Use the same time for each post
    195         $current_time = current_time( 'mysql' );
     195        $current_time = time();
     196        $forum_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 80 );
     197        $topic_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 60 );
     198        $reply_time = date( 'Y-m-d H:i:s', $current_time - 60 * 60 * 40 );
    196199
    197200        // Create the initial forum
     
    201204                'post_title'   => $r['forum_title'],
    202205                'post_content' => $r['forum_content'],
    203                 'post_date'    => $current_time
     206                'post_date'    => $forum_time
    204207        ) );
    205208
     
    210213                        'post_title'   => $r['topic_title'],
    211214                        'post_content' => $r['topic_content'],
    212                         'post_date'    => $current_time
     215                        'post_date'    => $topic_time
    213216                ),
    214217                array(
     
    222225                        'post_parent'  => $topic_id,
    223226                        'post_content' => $r['reply_content'],
    224                         'post_date'    => $current_time
     227                        'post_date'    => $reply_time
    225228                ),
    226229                array(
  • trunk/tests/phpunit/testcases/core/update.php

    r5801 r5883  
    8888                $topic_id = bbp_get_forum_last_topic_id( $forum_id );
    8989                $reply_id = bbp_get_forum_last_reply_id( $forum_id );
    90                 $now = 'right now';
    9190
    9291                // Forum post
     
    130129                $this->assertSame( 'Reply To: Hello World!', bbp_get_forum_last_reply_title( $forum_id ) );
    131130                $this->assertSame( $reply_id, bbp_get_forum_last_active_id( $forum_id ) );
    132                 $this->assertSame( $now, bbp_get_forum_last_active_time( $forum_id ) );
     131                $this->assertSame( '1 day, 16 hours ago', bbp_get_forum_last_active_time( $forum_id ) );
    133132
    134133                // Topic meta
     
    140139                $this->assertSame( $reply_id, bbp_get_topic_last_reply_id( $topic_id ) );
    141140                $this->assertSame( $reply_id, bbp_get_topic_last_active_id( $topic_id ) );
    142                 $this->assertSame( $now, bbp_get_topic_last_active_time( $topic_id ) );
     141                $this->assertSame( '1 day, 16 hours ago', bbp_get_topic_last_active_time( $topic_id ) );
    143142
    144143                // Reply Meta
Note: See TracChangeset for help on using the changeset viewer.