Changeset 52235 for trunk/tests/phpunit/tests/rest-api/rest-request.php
- Timestamp:
- 11/23/2021 06:55:23 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-request.php
r51657 r52235 17 17 18 18 $this->request = new WP_REST_Request(); 19 } 20 21 /** 22 * Called before setting up all tests. 23 */ 24 public static function set_up_before_class() { 25 parent::set_up_before_class(); 26 27 // Require files that need to load once. 28 require_once DIR_TESTROOT . '/includes/mock-invokable.php'; 19 29 } 20 30 … … 1015 1025 1016 1026 $error = new WP_Error( 'error_code', __( 'Error Message' ), array( 'status' => 400 ) ); 1017 $callback = $this->createPartialMock( ' stdClass', array( '__invoke' ) );1027 $callback = $this->createPartialMock( 'Mock_Invokable', array( '__invoke' ) ); 1018 1028 $callback->expects( self::once() )->method( '__invoke' )->with( self::identicalTo( $request ) )->willReturn( $error ); 1019 1029 $request->set_attributes( … … 1039 1049 1040 1050 $error = new WP_Error( 'error_code', __( 'Error Message' ), array( 'status' => 400 ) ); 1041 $callback = $this->createPartialMock( ' stdClass', array( '__invoke' ) );1051 $callback = $this->createPartialMock( 'Mock_Invokable', array( '__invoke' ) ); 1042 1052 $callback->expects( self::once() )->method( '__invoke' )->with( self::identicalTo( $request ) )->willReturn( $error ); 1043 1053 $request->set_attributes( … … 1057 1067 $request->set_query_params( array( 'test' => 'value' ) ); 1058 1068 1059 $callback = $this->createPartialMock( ' stdClass', array( '__invoke' ) );1069 $callback = $this->createPartialMock( 'Mock_Invokable', array( '__invoke' ) ); 1060 1070 $callback->expects( self::never() )->method( '__invoke' ); 1061 1071 $request->set_attributes(
Note: See TracChangeset
for help on using the changeset viewer.