Skip to:
Content

bbPress.org

Changeset 5865


Ignore:
Timestamp:
07/17/2015 08:24:17 AM (8 years ago)
Author:
netweb
Message:

Tests: In test_bbp_get_forum_freshness_link() create posts using a concise post date/time.
This changeset prevents the related unit test from incorrectly failing by ensuring that no content is created 1 second after any other.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/forums/template/forum.php

    r5721 r5865  
    9797        }
    9898
     99        $now = time();
     100        $post_date = date( 'Y-m-d H:i:s', $now - 60*60*100 );
     101
    99102        $f = $this->factory->forum->create();
    100103
     
    104107        $t = $this->factory->topic->create( array(
    105108            'post_parent' => $f,
     109            'post_date' => $post_date,
    106110        ) );
    107111
     
    111115
    112116        $fresh_link = bbp_get_forum_freshness_link( $f );
    113         $this->assertSame( '<a href="http://example.org/?topic=topic-1" title="Topic 1">right now</a>', $fresh_link );
     117        $this->assertSame( '<a href="http://example.org/?topic=topic-1" title="Topic 1">4 days, 4 hours ago</a>', $fresh_link );
    114118    }
    115119
Note: See TracChangeset for help on using the changeset viewer.