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/formatting/WpTrimExcerpt.php

    r35225 r35242  
    1010     */
    1111    public function test_secondary_loop_respect_more() {
    12         $post1 = self::$factory->post->create( array(
     12        $post1 = self::factory()->post->create( array(
    1313            'post_content' => 'Post 1 Page 1<!--more-->Post 1 Page 2',
    1414        ) );
    15         $post2 = self::$factory->post->create( array(
     15        $post2 = self::factory()->post->create( array(
    1616            'post_content' => 'Post 2 Page 1<!--more-->Post 2 Page 2',
    1717        ) );
     
    3535     */
    3636    public function test_secondary_loop_respect_nextpage() {
    37         $post1 = self::$factory->post->create( array(
     37        $post1 = self::factory()->post->create( array(
    3838            'post_content' => 'Post 1 Page 1<!--nextpage-->Post 1 Page 2',
    3939        ) );
    40         $post2 = self::$factory->post->create( array(
     40        $post2 = self::factory()->post->create( array(
    4141            'post_content' => 'Post 2 Page 1<!--nextpage-->Post 2 Page 2',
    4242        ) );
Note: See TracChangeset for help on using the changeset viewer.