WordPress.org

Make WordPress Core

Changeset 44234


Ignore:
Timestamp:
12/16/2018 06:53:58 PM (2 years ago)
Author:
jeremyfelt
Message:

Tests: Replace uses of $this->server with rest_get_server().

In [42724], $this->server was replaced with rest_get_server() for better memory recycling.

[43862], from the 5.0 branch, was merged into trunk in [44225] and used the now unavailable $this->server.

This updates the new tests from the 5.0 branch to use the expected rest_get_server().

See #45269, #41641.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r44225 r44234  
    16721672
    16731673        $request->set_body( file_get_contents( $this->test_file ) );
    1674         $response = $this->server->dispatch( $request );
     1674        $response = rest_get_server()->dispatch( $request );
    16751675        $data     = $response->get_data();
    16761676        $this->assertEquals( 201, $response->get_status() );
     
    17041704        $request       = new WP_REST_Request( 'POST', '/wp/v2/media/' . $attachment_id );
    17051705        $request->set_param( 'title', 'My title is very cool' );
    1706         $response = $this->server->dispatch( $request );
     1706        $response = rest_get_server()->dispatch( $request );
    17071707
    17081708        $this->assertSame( 1, self::$rest_insert_attachment_count );
Note: See TracChangeset for help on using the changeset viewer.