Skip to:
Content

BuddyPress.org

Changeset 8789


Ignore:
Timestamp:
08/11/2014 04:36:58 PM (12 years ago)
Author:
r-a-y
Message:

Split up activity 'date_query' unit tests.

Attempts to fix issues with the 'zend_mm_heap corrupted' message outputting
on PHP 5.2 and WP master:
https://travis-ci.org/buddypress/BuddyPress/jobs/32239701

See #5803.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/activity/class.BP_Activity_Activity.php

    r8787 r8789  
    148148         * @group date_query
    149149         */
    150         public function test_get_with_date_query() {
     150        public function test_get_with_date_query_before() {
    151151                if ( ! class_exists( 'WP_Date_Query' ) ) {
    152152                        return;
     
    172172                ) );
    173173                $this->assertEquals( array( $a2 ), wp_list_pluck( $query['activities'], 'id' ) );
     174        }
     175
     176        /**
     177         * @group get
     178         * @group date_query
     179         */
     180        public function test_get_with_date_query_range() {
     181                if ( ! class_exists( 'WP_Date_Query' ) ) {
     182                        return;
     183                }
     184
     185                $a1 = $this->factory->activity->create();
     186                $a2 = $this->factory->activity->create( array(
     187                        'recorded_time' => '2001-01-01 12:00'
     188                ) );
     189                $a3 = $this->factory->activity->create( array(
     190                        'recorded_time' => '2005-01-01 12:00'
     191                ) );
    174192
    175193                // 'date_query' range test
     
    186204                ) );
    187205                $this->assertEquals( array( $a3 ), wp_list_pluck( $query['activities'], 'id' ) );
     206        }
     207
     208        /**
     209         * @group get
     210         * @group date_query
     211         */
     212        public function test_get_with_date_query_after() {
     213                if ( ! class_exists( 'WP_Date_Query' ) ) {
     214                        return;
     215                }
     216
     217                $a1 = $this->factory->activity->create();
     218                $a2 = $this->factory->activity->create( array(
     219                        'recorded_time' => '2001-01-01 12:00'
     220                ) );
     221                $a3 = $this->factory->activity->create( array(
     222                        'recorded_time' => '2005-01-01 12:00'
     223                ) );
    188224
    189225                // 'date_query' after and relative test
Note: See TracChangeset for help on using the changeset viewer.