Changeset 42863
- Timestamp:
- 03/20/2018 10:34:11 PM (7 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php
r42343 r42863 201 201 202 202 protected function check_get_posts_response( $response, $context = 'view' ) { 203 $this->assertNot InstanceOf( 'WP_Error',$response );203 $this->assertNotWPError( $response ); 204 204 $response = rest_ensure_response( $response ); 205 205 $this->assertEquals( 200, $response->get_status() ); … … 233 233 234 234 protected function check_get_post_response( $response, $context = 'view' ) { 235 $this->assertNot InstanceOf( 'WP_Error',$response );235 $this->assertNotWPError( $response ); 236 236 $response = rest_ensure_response( $response ); 237 237 $this->assertEquals( 200, $response->get_status() ); … … 244 244 245 245 protected function check_create_post_response( $response ) { 246 $this->assertNot InstanceOf( 'WP_Error',$response );246 $this->assertNotWPError( $response ); 247 247 $response = rest_ensure_response( $response ); 248 248 … … 257 257 258 258 protected function check_update_post_response( $response ) { 259 $this->assertNot InstanceOf( 'WP_Error',$response );259 $this->assertNotWPError( $response ); 260 260 $response = rest_ensure_response( $response ); 261 261 -
trunk/tests/phpunit/tests/admin/includesPost.php
r42343 r42863 33 33 34 34 $_results = _wp_translate_postdata( false, $_post_data ); 35 $this->assertNot InstanceOf( 'WP_Error',$_results );35 $this->assertNotWPError( $_results ); 36 36 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 37 37 $this->assertEquals( 'draft', $_results['post_status'] ); … … 44 44 45 45 $_results = _wp_translate_postdata( false, $_post_data ); 46 $this->assertNot InstanceOf( 'WP_Error',$_results );46 $this->assertNotWPError( $_results ); 47 47 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 48 48 $this->assertEquals( 'pending', $_results['post_status'] ); … … 83 83 84 84 $_results = _wp_translate_postdata( false, $_post_data ); 85 $this->assertNot InstanceOf( 'WP_Error',$_results );85 $this->assertNotWPError( $_results ); 86 86 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 87 87 $this->assertEquals( 'draft', $_results['post_status'] ); … … 94 94 95 95 $_results = _wp_translate_postdata( false, $_post_data ); 96 $this->assertNot InstanceOf( 'WP_Error',$_results );96 $this->assertNotWPError( $_results ); 97 97 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 98 98 $this->assertEquals( 'publish', $_results['post_status'] ); … … 105 105 106 106 $_results = _wp_translate_postdata( false, $_post_data ); 107 $this->assertNot InstanceOf( 'WP_Error',$_results );107 $this->assertNotWPError( $_results ); 108 108 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 109 109 $this->assertEquals( 'draft', $_results['post_status'] ); … … 118 118 119 119 $_results = _wp_translate_postdata( true, $_post_data ); 120 $this->assertNot InstanceOf( 'WP_Error',$_results );120 $this->assertNotWPError( $_results ); 121 121 $this->assertEquals( $_post_data['post_author'], $_results['post_author'] ); 122 122 $this->assertEquals( 'draft', $_results['post_status'] ); -
trunk/tests/phpunit/tests/ajax/CustomizeManager.php
r42615 r42863 646 646 647 647 $_POST['dismiss_autosave'] = $_GET['dismiss_autosave'] = $_REQUEST['dismiss_autosave'] = true; 648 $this->assertNot InstanceOf( 'WP_Error',$r );648 $this->assertNotWPError( $r ); 649 649 $this->assertFalse( wp_get_post_autosave( $wp_customize->changeset_post_id() ) ); 650 650 $this->assertContains( 'Foo', get_post( $wp_customize->changeset_post_id() )->post_content ); … … 666 666 ) 667 667 ); 668 $this->assertNot InstanceOf( 'WP_Error',$r );668 $this->assertNotWPError( $r ); 669 669 $autosave_revision = wp_get_post_autosave( $wp_customize->changeset_post_id() ); 670 670 $this->assertInstanceOf( 'WP_Post', $autosave_revision ); -
trunk/tests/phpunit/tests/customize/manager.php
r42636 r42863 496 496 ) 497 497 ); 498 $this->assertNot InstanceOf( 'WP_Error',$r );498 $this->assertNotWPError( $r ); 499 499 500 500 // No change to data if not requesting autosave. -
trunk/tests/phpunit/tests/customize/nav-menu-setting.php
r42343 r42863 254 254 $term = (array) wp_get_nav_menu_object( $menu_id ); 255 255 $this->assertNotEmpty( $term ); 256 $this->assertNot InstanceOf( 'WP_Error',$term );256 $this->assertNotWPError( $term ); 257 257 $this->assertEqualSets( $post_value, wp_array_slice_assoc( $term, array_keys( $value ) ) ); 258 258 $this->assertEquals( $menu_id, $term['term_id'] ); -
trunk/tests/phpunit/tests/image/editorGd.php
r42343 r42863 477 477 $editor = wp_get_image_editor( $file ); 478 478 479 $this->assertNot InstanceOf( 'WP_Error',$editor );479 $this->assertNotWPError( $editor ); 480 480 481 481 $editor->load(); … … 504 504 $editor = wp_get_image_editor( $file ); 505 505 506 $this->assertNot InstanceOf( 'WP_Error',$editor );506 $this->assertNotWPError( $editor ); 507 507 508 508 $editor->load(); … … 532 532 533 533 $editor = new WP_Image_Editor_GD( $file ); 534 $this->assertNot InstanceOf( 'WP_Error',$editor );534 $this->assertNotWPError( $editor ); 535 535 $editor->load(); 536 536 $editor->rotate( 180 ); -
trunk/tests/phpunit/tests/image/editorImagick.php
r42431 r42863 466 466 $editor = new WP_Image_Editor_Imagick( $file ); 467 467 468 $this->assertNot InstanceOf( 'WP_Error',$editor );468 $this->assertNotWPError( $editor ); 469 469 470 470 $editor->load(); … … 493 493 $editor = new WP_Image_Editor_Imagick( $file ); 494 494 495 $this->assertNot InstanceOf( 'WP_Error',$editor );495 $this->assertNotWPError( $editor ); 496 496 497 497 $editor->load(); … … 525 525 $image_editor = new WP_Image_Editor_Imagick( $save_to_file ); 526 526 $image_editor->load(); 527 $this->assertNot InstanceOf( 'WP_Error',$image_editor );527 $this->assertNotWPError( $image_editor ); 528 528 $image_editor->rotate( 180 ); 529 529 $image_editor->save( $save_to_file ); -
trunk/tests/phpunit/tests/image/functions.php
r42792 r42863 164 164 $ret = wp_save_image_file( $file, $img, $mime_type, 1 ); 165 165 $this->assertNotEmpty( $ret ); 166 $this->assertNot InstanceOf( 'WP_Error',$ret );166 $this->assertNotWPError( $ret ); 167 167 $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) ); 168 168 … … 206 206 // Make assertions 207 207 $this->assertNotEmpty( $ret ); 208 $this->assertNot InstanceOf( 'WP_Error',$ret );208 $this->assertNotWPError( $ret ); 209 209 $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) ); 210 210 … … 250 250 // Save the image as each file extension, check the mime type 251 251 $img = wp_get_image_editor( DIR_TESTDATA . '/images/canola.jpg' ); 252 $this->assertNot InstanceOf( 'WP_Error',$img );252 $this->assertNotWPError( $img ); 253 253 254 254 $temp = get_temp_dir(); … … 261 261 $ret = $img->save( trailingslashit( $temp ) . $file ); 262 262 $this->assertNotEmpty( $ret ); 263 $this->assertNot InstanceOf( 'WP_Error',$ret );263 $this->assertNotWPError( $ret ); 264 264 $this->assertEquals( $mime_type, $this->get_mime_type( $ret['path'] ) ); 265 265 unlink( $ret['path'] ); … … 311 311 0, 0, 100, 100, 100, 100 312 312 ); 313 $this->assertNot InstanceOf( 'WP_Error',$file );313 $this->assertNotWPError( $file ); 314 314 $this->assertFileExists( $file ); 315 315 $image = wp_get_image_editor( $file ); … … 335 335 DIR_TESTDATA . '/images/' . __FUNCTION__ . '.jpg' 336 336 ); 337 $this->assertNot InstanceOf( 'WP_Error',$file );337 $this->assertNotWPError( $file ); 338 338 $this->assertFileExists( $file ); 339 339 $image = wp_get_image_editor( $file ); -
trunk/tests/phpunit/tests/post/formats.php
r42343 r42863 16 16 17 17 $result = set_post_format( $post_id, 'aside' ); 18 $this->assertNot InstanceOf( 'WP_Error',$result );18 $this->assertNotWPError( $result ); 19 19 $this->assertInternalType( 'array', $result ); 20 20 $this->assertEquals( 1, count( $result ) ); … … 24 24 25 25 $result = set_post_format( $post_id, 'standard' ); 26 $this->assertNot InstanceOf( 'WP_Error',$result );26 $this->assertNotWPError( $result ); 27 27 $this->assertInternalType( 'array', $result ); 28 28 $this->assertEquals( 0, count( $result ) ); 29 29 30 30 $result = set_post_format( $post_id, '' ); 31 $this->assertNot InstanceOf( 'WP_Error',$result );31 $this->assertNotWPError( $result ); 32 32 $this->assertInternalType( 'array', $result ); 33 33 $this->assertEquals( 0, count( $result ) ); … … 44 44 45 45 $result = set_post_format( $post_id, 'aside' ); 46 $this->assertNot InstanceOf( 'WP_Error',$result );46 $this->assertNotWPError( $result ); 47 47 $this->assertInternalType( 'array', $result ); 48 48 $this->assertEquals( 1, count( $result ) ); … … 57 57 58 58 $result = set_post_format( $post_id, 'standard' ); 59 $this->assertNot InstanceOf( 'WP_Error',$result );59 $this->assertNotWPError( $result ); 60 60 $this->assertInternalType( 'array', $result ); 61 61 $this->assertEquals( 0, count( $result ) ); 62 62 63 63 $result = set_post_format( $post_id, '' ); 64 $this->assertNot InstanceOf( 'WP_Error',$result );64 $this->assertNotWPError( $result ); 65 65 $this->assertInternalType( 'array', $result ); 66 66 $this->assertEquals( 0, count( $result ) ); … … 76 76 77 77 $result = set_post_format( $post_id, 'aside' ); 78 $this->assertNot InstanceOf( 'WP_Error',$result );78 $this->assertNotWPError( $result ); 79 79 $this->assertInternalType( 'array', $result ); 80 80 $this->assertEquals( 1, count( $result ) ); … … 82 82 83 83 $result = set_post_format( $post_id, 'standard' ); 84 $this->assertNot InstanceOf( 'WP_Error',$result );84 $this->assertNotWPError( $result ); 85 85 $this->assertInternalType( 'array', $result ); 86 86 $this->assertEquals( 0, count( $result ) );
Note: See TracChangeset
for help on using the changeset viewer.