Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (11 years ago)
Author:
wonderboymusic
Message:

Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop.

Props nerrad, wonderboymusic.
See #30017, #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/query.php

    r35225 r35242  
    976976         */
    977977        public function test_validate_date_values_should_process_array_value_for_year() {
    978                 $p1 = self::$factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
    979                 $p2 = self::$factory->post->create( array( 'post_date' => '2013-01-12 00:00:00' ) );
     978                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     979                $p2 = self::factory()->post->create( array( 'post_date' => '2013-01-12 00:00:00' ) );
    980980
    981981                $q = new WP_Query( array(
     
    996996         */
    997997        public function test_validate_date_values_should_process_array_value_for_day() {
    998                 $p1 = self::$factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
    999                 $p2 = self::$factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
     998                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     999                $p2 = self::factory()->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
    10001000
    10011001                $q = new WP_Query( array(
     
    10171017         */
    10181018        public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() {
    1019                 $p1 = self::$factory->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
    1020                 $p2 = self::$factory->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
     1019                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     1020                $p2 = self::factory()->post->create( array( 'post_date' => '2015-01-10 00:00:00' ) );
    10211021
    10221022                $q = new WP_Query( array(
Note: See TracChangeset for help on using the changeset viewer.