WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (6 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/comment/getCommentLink.php

    r35225 r35242  
    1212
    1313        $now = time();
    14         $this->p = self::$factory->post->create();
    15         $this->comments[] = self::$factory->comment->create( array(
     14        $this->p = self::factory()->post->create();
     15        $this->comments[] = self::factory()->comment->create( array(
    1616            'comment_post_ID' => $this->p,
    1717            'comment_content' => '1',
    1818            'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    1919        ) );
    20         $this->comments[] = self::$factory->comment->create( array(
     20        $this->comments[] = self::factory()->comment->create( array(
    2121            'comment_post_ID' => $this->p,
    2222            'comment_content' => '2',
    2323            'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    2424        ) );
    25         $this->comments[] = self::$factory->comment->create( array(
     25        $this->comments[] = self::factory()->comment->create( array(
    2626            'comment_post_ID' => $this->p,
    2727            'comment_content' => '3',
    2828            'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
    2929        ) );
    30         $this->comments[] = self::$factory->comment->create( array(
     30        $this->comments[] = self::factory()->comment->create( array(
    3131            'comment_post_ID' => $this->p,
    3232            'comment_content' => '4',
    3333            'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
    3434        ) );
    35         $this->comments[] = self::$factory->comment->create( array(
     35        $this->comments[] = self::factory()->comment->create( array(
    3636            'comment_post_ID' => $this->p,
    3737            'comment_content' => '4',
    3838            'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ),
    3939        ) );
    40         $this->comments[] = self::$factory->comment->create( array(
     40        $this->comments[] = self::factory()->comment->create( array(
    4141            'comment_post_ID' => $this->p,
    4242            'comment_content' => '4',
Note: See TracChangeset for help on using the changeset viewer.