Make WordPress Core


Ignore:
Timestamp:
10/17/2015 06:02:16 PM (9 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/oembed/discovery.php

    r35225 r35242  
    1313
    1414    function test_add_oembed_discovery_links_to_post() {
    15         $post_id = self::$factory->post->create();
     15        $post_id = self::factory()->post->create();
    1616        $this->go_to( get_permalink( $post_id ) );
    1717
     
    2929
    3030    function test_add_oembed_discovery_links_to_page() {
    31         $post_id = self::$factory->post->create( array(
     31        $post_id = self::factory()->post->create( array(
    3232            'post_type' => 'page'
    3333        ));
     
    4747
    4848    function test_add_oembed_discovery_links_to_attachment() {
    49         $post_id       = self::$factory->post->create();
     49        $post_id       = self::factory()->post->create();
    5050        $file          = DIR_TESTDATA . '/images/canola.jpg';
    51         $attachment_id = self::$factory->attachment->create_object( $file, $post_id, array(
     51        $attachment_id = self::factory()->attachment->create_object( $file, $post_id, array(
    5252            'post_mime_type' => 'image/jpeg',
    5353        ) );
Note: See TracChangeset for help on using the changeset viewer.