Changeset 52235
- Timestamp:
- 11/23/2021 06:55:23 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpcs.xml.dist
r52179 r52235 250 250 <element value="WP_Image_Editor_Mock"/> 251 251 <element value="WP_Filesystem_MockFS"/> 252 <element value="Mock_Invokable"/> 252 253 <element value="MockPHPMailer"/> 253 254 <element value="MockAction"/> -
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( -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r52080 r52235 34 34 35 35 parent::tear_down(); 36 } 37 38 /** 39 * Called before setting up all tests. 40 */ 41 public static function set_up_before_class() { 42 parent::set_up_before_class(); 43 44 // Require files that need to load once. 45 require_once DIR_TESTROOT . '/includes/mock-invokable.php'; 36 46 } 37 47 … … 1631 1641 */ 1632 1642 public function test_callbacks_are_not_executed_if_request_validation_fails() { 1633 $callback = $this->createPartialMock( ' stdClass', array( '__invoke' ) );1643 $callback = $this->createPartialMock( 'Mock_Invokable', array( '__invoke' ) ); 1634 1644 $callback->expects( self::never() )->method( '__invoke' ); 1635 $permission_callback = $this->createPartialMock( ' stdClass', array( '__invoke' ) );1645 $permission_callback = $this->createPartialMock( 'Mock_Invokable', array( '__invoke' ) ); 1636 1646 $permission_callback->expects( self::never() )->method( '__invoke' ); 1637 1647
Note: See TracChangeset
for help on using the changeset viewer.