Ticket #53491: 53491.diff
File 53491.diff, 155.0 KB (added by , 3 years ago) |
---|
-
tests/phpunit/includes/testcase.php
32 32 public static function assertEqualsWithDelta( $expected, $actual, $delta, $message = '' ) { 33 33 static::assertEquals( $expected, $actual, $message, $delta ); 34 34 } 35 36 /** 37 * Asserts that a variable is of type array. 38 * 39 * This method has been backported from a more recent PHPUnit version, 40 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 41 * 42 * @since 5.9.0 43 * 44 * @param mixed $actual The value to check. 45 * @param string $message Optional. Message to display when the assertion fails. 46 */ 47 public static function assertIsArray( $actual, $message = '' ) { 48 static::assertInternalType( 'array', $actual, $message ); 49 } 50 51 /** 52 * Asserts that a variable is of type bool. 53 * 54 * This method has been backported from a more recent PHPUnit version, 55 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 56 * 57 * @since 5.9.0 58 * 59 * @param mixed $actual The value to check. 60 * @param string $message Optional. Message to display when the assertion fails. 61 */ 62 public static function assertIsBool( $actual, $message = '' ) { 63 static::assertInternalType( 'bool', $actual, $message ); 64 } 65 66 /** 67 * Asserts that a variable is of type float. 68 * 69 * This method has been backported from a more recent PHPUnit version, 70 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 71 * 72 * @since 5.9.0 73 * 74 * @param mixed $actual The value to check. 75 * @param string $message Optional. Message to display when the assertion fails. 76 */ 77 public static function assertIsFloat( $actual, $message = '' ) { 78 static::assertInternalType( 'float', $actual, $message ); 79 } 80 81 /** 82 * Asserts that a variable is of type int. 83 * 84 * This method has been backported from a more recent PHPUnit version, 85 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 86 * 87 * @since 5.9.0 88 * 89 * @param mixed $actual The value to check. 90 * @param string $message Optional. Message to display when the assertion fails. 91 */ 92 public static function assertIsInt( $actual, $message = '' ) { 93 static::assertInternalType( 'int', $actual, $message ); 94 } 95 96 /** 97 * Asserts that a variable is of type numeric. 98 * 99 * This method has been backported from a more recent PHPUnit version, 100 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 101 * 102 * @since 5.9.0 103 * 104 * @param mixed $actual The value to check. 105 * @param string $message Optional. Message to display when the assertion fails. 106 */ 107 public static function assertIsNumeric( $actual, $message = '' ) { 108 static::assertInternalType( 'numeric', $actual, $message ); 109 } 110 111 /** 112 * Asserts that a variable is of type object. 113 * 114 * This method has been backported from a more recent PHPUnit version, 115 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 116 * 117 * @since 5.9.0 118 * 119 * @param mixed $actual The value to check. 120 * @param string $message Optional. Message to display when the assertion fails. 121 */ 122 public static function assertIsObject( $actual, $message = '' ) { 123 static::assertInternalType( 'object', $actual, $message ); 124 } 125 126 /** 127 * Asserts that a variable is of type resource. 128 * 129 * This method has been backported from a more recent PHPUnit version, 130 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 131 * 132 * @since 5.9.0 133 * 134 * @param mixed $actual The value to check. 135 * @param string $message Optional. Message to display when the assertion fails. 136 */ 137 public static function assertIsResource( $actual, $message = '' ) { 138 static::assertInternalType( 'resource', $actual, $message ); 139 } 140 141 /** 142 * Asserts that a variable is of type string. 143 * 144 * This method has been backported from a more recent PHPUnit version, 145 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 146 * 147 * @since 5.9.0 148 * 149 * @param mixed $actual The value to check. 150 * @param string $message Optional. Message to display when the assertion fails. 151 */ 152 public static function assertIsString( $actual, $message = '' ) { 153 static::assertInternalType( 'string', $actual, $message ); 154 } 155 156 /** 157 * Asserts that a variable is of type scalar. 158 * 159 * This method has been backported from a more recent PHPUnit version, 160 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 161 * 162 * @since 5.9.0 163 * 164 * @param mixed $actual The value to check. 165 * @param string $message Optional. Message to display when the assertion fails. 166 */ 167 public static function assertIsScalar( $actual, $message = '' ) { 168 static::assertInternalType( 'scalar', $actual, $message ); 169 } 170 171 /** 172 * Asserts that a variable is of type callable. 173 * 174 * This method has been backported from a more recent PHPUnit version, 175 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 176 * 177 * @since 5.9.0 178 * 179 * @param mixed $actual The value to check. 180 * @param string $message Optional. Message to display when the assertion fails. 181 */ 182 public static function assertIsCallable( $actual, $message = '' ) { 183 static::assertInternalType( 'callable', $actual, $message ); 184 } 185 186 /** 187 * Asserts that a variable is of type iterable. 188 * 189 * This method has been backported from a more recent PHPUnit version, 190 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 191 * 192 * @since 5.9.0 193 * 194 * @param mixed $actual The value to check. 195 * @param string $message Optional. Message to display when the assertion fails. 196 */ 197 public static function assertIsIterable( $actual, $message = '' ) { 198 static::assertInternalType( 'iterable', $actual, $message ); 199 } 35 200 } -
tests/phpunit/tests/adminbar.php
166 166 167 167 // Get primary blog. 168 168 $primary = get_active_blog_for_user( self::$editor_id ); 169 $this->assertI nternalType( 'object',$primary );169 $this->assertIsObject( $primary ); 170 170 171 171 // No Site menu as the user isn't a member of this blog. 172 172 $this->assertNull( $node_site_name ); -
tests/phpunit/tests/ajax/CustomizeManager.php
286 286 ); 287 287 $this->make_ajax_call( 'customize_save' ); 288 288 $this->assertTrue( $this->_last_response_parsed['success'] ); 289 $this->assertI nternalType( 'array',$this->_last_response_parsed['data'] );289 $this->assertIsArray( $this->_last_response_parsed['data'] ); 290 290 291 291 $this->assertSame( 'publish', $this->_last_response_parsed['data']['changeset_status'] ); 292 292 $this->assertArrayHasKey( 'next_changeset_uuid', $this->_last_response_parsed['data'] ); … … 325 325 $_POST['customize_changeset_title'] = 'Published'; 326 326 $this->make_ajax_call( 'customize_save' ); 327 327 $this->assertTrue( $this->_last_response_parsed['success'] ); 328 $this->assertI nternalType( 'array',$this->_last_response_parsed['data'] );328 $this->assertIsArray( $this->_last_response_parsed['data'] ); 329 329 330 330 $this->assertSame( 'publish', $this->_last_response_parsed['data']['changeset_status'] ); 331 331 $this->assertArrayHasKey( 'next_changeset_uuid', $this->_last_response_parsed['data'] ); -
tests/phpunit/tests/blocks/block-editor.php
172 172 173 173 $this->assertCount( 16, $settings ); 174 174 $this->assertFalse( $settings['alignWide'] ); 175 $this->assertI nternalType( 'array',$settings['allowedMimeTypes'] );175 $this->assertIsArray( $settings['allowedMimeTypes'] ); 176 176 $this->assertTrue( $settings['allowedBlockTypes'] ); 177 177 $this->assertSameSets( 178 178 array( … … 264 264 ), 265 265 $settings['imageSizes'] 266 266 ); 267 $this->assertI nternalType( 'int',$settings['maxUploadFileSize'] );267 $this->assertIsInt( $settings['maxUploadFileSize'] ); 268 268 } 269 269 270 270 /** -
tests/phpunit/tests/blocks/render.php
324 324 $rendered = $block_type->render(); 325 325 326 326 $this->assertSame( '10', $rendered ); 327 $this->assertI nternalType( 'string',$rendered );327 $this->assertIsString( $rendered ); 328 328 } 329 329 330 330 public function test_dynamic_block_gets_inner_html() { -
tests/phpunit/tests/bookmark/getBookmark.php
349 349 foreach ( $contexts as $context ) { 350 350 $bookmark = get_bookmark( self::$bookmark->link_id, OBJECT, $context ); 351 351 352 $this->assertI nternalType( 'int',$bookmark->link_id );353 $this->assertI nternalType( 'int',$bookmark->link_rating );352 $this->assertIsInt( $bookmark->link_id ); 353 $this->assertIsInt( $bookmark->link_rating ); 354 354 } 355 355 } 356 356 -
tests/phpunit/tests/comment/metaCache.php
233 233 234 234 wp_cache_delete( 'last_changed', 'comment' ); 235 235 236 $this->assertI nternalType( 'integer',add_metadata( 'comment', $comment_id, 'foo', 'bar' ) );236 $this->assertIsInt( add_metadata( 'comment', $comment_id, 'foo', 'bar' ) ); 237 237 $this->assertNotFalse( wp_cache_get_last_changed( 'comment' ) ); 238 238 } 239 239 … … 245 245 246 246 wp_cache_delete( 'last_changed', 'comment' ); 247 247 248 $this->assertI nternalType( 'integer',update_metadata( 'comment', $comment_id, 'foo', 'bar' ) );248 $this->assertIsInt( update_metadata( 'comment', $comment_id, 'foo', 'bar' ) ); 249 249 $this->assertNotFalse( wp_cache_get_last_changed( 'comment' ) ); 250 250 } 251 251 -
tests/phpunit/tests/comment/query.php
1713 1713 ); 1714 1714 1715 1715 // Ensure we are dealing with integers, and not objects. 1716 $this->assertI nternalType( 'integer',$comment_1 );1717 $this->assertI nternalType( 'integer',$comment_2 );1718 $this->assertI nternalType( 'integer',$comment_3 );1716 $this->assertIsInt( $comment_1 ); 1717 $this->assertIsInt( $comment_2 ); 1718 $this->assertIsInt( $comment_3 ); 1719 1719 1720 1720 $comment_ids = get_comments( array( 'fields' => 'ids' ) ); 1721 1721 $this->assertCount( 3, $comment_ids ); … … 3331 3331 $this->assertNull( $query1->query_vars ); 3332 3332 $this->assertEmpty( $query1->comments ); 3333 3333 $comments = $query1->query( array( 'status' => 'all' ) ); 3334 $this->assertI nternalType( 'array',$query1->query_vars );3334 $this->assertIsArray( $query1->query_vars ); 3335 3335 $this->assertNotEmpty( $query1->comments ); 3336 $this->assertI nternalType( 'array',$query1->comments );3336 $this->assertIsArray( $query1->comments ); 3337 3337 3338 3338 $query2 = new WP_Comment_Query( array( 'status' => 'all' ) ); 3339 3339 $this->assertNotEmpty( $query2->query_vars ); -
tests/phpunit/tests/customize/custom-css-setting.php
344 344 * @return array Data. 345 345 */ 346 346 function filter_update_custom_css_data( $data, $args ) { 347 $this->assertI nternalType( 'array',$data );347 $this->assertIsArray( $data ); 348 348 $this->assertSameSets( array( 'css', 'preprocessed' ), array_keys( $data ) ); 349 349 $this->assertSame( '', $data['preprocessed'] ); 350 $this->assertI nternalType( 'array',$args );350 $this->assertIsArray( $args ); 351 351 $this->assertSameSets( array( 'css', 'preprocessed', 'stylesheet' ), array_keys( $args ) ); 352 352 $this->assertSame( $args['css'], $data['css'] ); 353 353 $this->assertSame( $args['preprocessed'], $data['preprocessed'] ); -
tests/phpunit/tests/customize/manager.php
677 677 $this->assertSameSets( $expected_setting_ids, array_keys( $changeset_values ) ); 678 678 679 679 foreach ( array( 'widget_text[2]', 'widget_meta[2]' ) as $setting_id ) { 680 $this->assertI nternalType( 'array',$changeset_values[ $setting_id ] );680 $this->assertIsArray( $changeset_values[ $setting_id ] ); 681 681 $instance_data = $wp_customize->widgets->sanitize_widget_instance( $changeset_values[ $setting_id ] ); 682 $this->assertI nternalType( 'array',$instance_data );682 $this->assertIsArray( $instance_data ); 683 683 $this->assertArrayHasKey( 'title', $instance_data ); 684 684 } 685 685 … … 731 731 $this->assertNull( $wp_customize->changeset_post_id() ); 732 732 $this->assertSame( 1000, has_action( 'customize_register', array( $wp_customize, '_save_starter_content_changeset' ) ) ); 733 733 do_action( 'customize_register', $wp_customize ); // This will trigger the changeset save. 734 $this->assertI nternalType( 'int',$wp_customize->changeset_post_id() );734 $this->assertIsInt( $wp_customize->changeset_post_id() ); 735 735 $this->assertNotEmpty( $wp_customize->changeset_data() ); 736 736 foreach ( $wp_customize->changeset_data() as $setting_id => $setting_params ) { 737 737 $this->assertArrayHasKey( 'starter_content', $setting_params ); … … 787 787 $this->assertSame( 'auto-draft', get_post( $posts_by_name['waffles'] )->post_status ); 788 788 $this->assertNotEquals( $changeset_data['blogname']['value'], get_option( 'blogname' ) ); 789 789 $r = $wp_customize->save_changeset_post( array( 'status' => 'publish' ) ); 790 $this->assertI nternalType( 'array',$r );790 $this->assertIsArray( $r ); 791 791 $this->assertSame( 'publish', get_post( $posts_by_name['about'] )->post_status ); 792 792 $this->assertSame( 'inherit', get_post( $posts_by_name['waffles'] )->post_status ); 793 793 $this->assertSame( $changeset_data['blogname']['value'], get_option( 'blogname' ) ); … … 1041 1041 'data' => $pre_saved_data, 1042 1042 ) 1043 1043 ); 1044 $this->assertI nternalType( 'array',$r );1044 $this->assertIsArray( $r ); 1045 1045 1046 1046 $this->assertSame( $did_action['customize_save_validation_before'] + 1, did_action( 'customize_save_validation_before' ) ); 1047 1047 … … 1098 1098 ); 1099 1099 $this->assertInstanceOf( 'WP_Error', $r ); 1100 1100 $this->assertSame( 'transaction_fail', $r->get_error_code() ); 1101 $this->assertI nternalType( 'array',$r->get_error_data() );1101 $this->assertIsArray( $r->get_error_data() ); 1102 1102 $this->assertArrayHasKey( 'setting_validities', $r->get_error_data() ); 1103 1103 $error_data = $r->get_error_data(); 1104 1104 $this->assertArrayHasKey( 'blogname', $error_data['setting_validities'] ); … … 1137 1137 ), 1138 1138 ) 1139 1139 ); 1140 $this->assertI nternalType( 'array',$r );1140 $this->assertIsArray( $r ); 1141 1141 $this->assertArrayHasKey( 'setting_validities', $r ); 1142 1142 $this->assertTrue( $r['setting_validities']['blogname'] ); 1143 1143 $this->assertInstanceOf( 'WP_Error', $r['setting_validities']['bar_unknown'] ); … … 1205 1205 ), 1206 1206 ) 1207 1207 ); 1208 $this->assertI nternalType( 'array',$r );1208 $this->assertIsArray( $r ); 1209 1209 $this->assertSame( 'Do it live \o/', get_option( 'blogname' ) ); 1210 1210 $this->assertSame( 'trash', get_post_status( $post_id ) ); // Auto-trashed. 1211 1211 $this->assertSame( $original_capabilities, wp_list_pluck( $manager->settings(), 'capability' ) ); … … 1422 1422 */ 1423 1423 function filter_customize_changeset_save_data( $data, $context ) { 1424 1424 $this->customize_changeset_save_data_call_count += 1; 1425 $this->assertI nternalType( 'array',$data );1426 $this->assertI nternalType( 'array',$context );1425 $this->assertIsArray( $data ); 1426 $this->assertIsArray( $context ); 1427 1427 $this->assertArrayHasKey( 'uuid', $context ); 1428 1428 $this->assertArrayHasKey( 'title', $context ); 1429 1429 $this->assertArrayHasKey( 'status', $context ); … … 1513 1513 ), 1514 1514 ) 1515 1515 ); 1516 $this->assertI nternalType( 'array',$r );1516 $this->assertIsArray( $r ); 1517 1517 $this->assertSame( 1518 1518 array_fill_keys( array( 'blogname', 'scratchpad', 'background_color' ), true ), 1519 1519 $r['setting_validities'] … … 1540 1540 ), 1541 1541 ) 1542 1542 ); 1543 $this->assertI nternalType( 'array',$r );1543 $this->assertIsArray( $r ); 1544 1544 $this->assertSame( 1545 1545 array_fill_keys( array( 'blogname', 'background_color' ), true ), 1546 1546 $r['setting_validities'] … … 1569 1569 'user_id' => self::$subscriber_user_id, 1570 1570 ) 1571 1571 ); 1572 $this->assertI nternalType( 'array',$r );1572 $this->assertIsArray( $r ); 1573 1573 $this->assertSame( 1574 1574 array_fill_keys( array( 'blogname', 'scratchpad' ), true ), 1575 1575 $r['setting_validities'] … … 1888 1888 'autosave' => true, 1889 1889 ) 1890 1890 ); 1891 $this->assertI nternalType( 'array',$r );1891 $this->assertIsArray( $r ); 1892 1892 1893 1893 // Verify that autosave happened. 1894 1894 $autosave_revision = wp_get_post_autosave( $changeset_post_id, get_current_user_id() ); … … 2715 2715 $error->add( 'bad_letter', 'Bad letra', 123 ); 2716 2716 $error->add( 'bad_number', 'Bad number', array( 'number' => 123 ) ); 2717 2717 $validity = $this->manager->prepare_setting_validity_for_js( $error ); 2718 $this->assertI nternalType( 'array',$validity );2718 $this->assertIsArray( $validity ); 2719 2719 foreach ( $error->errors as $code => $messages ) { 2720 2720 $this->assertArrayHasKey( $code, $validity ); 2721 $this->assertI nternalType( 'array',$validity[ $code ] );2721 $this->assertIsArray( $validity[ $code ] ); 2722 2722 $this->assertSame( implode( ' ', $messages ), $validity[ $code ]['message'] ); 2723 2723 $this->assertArrayHasKey( 'data', $validity[ $code ] ); 2724 2724 $this->assertSame( $validity[ $code ]['data'], $error->get_error_data( $code ) ); … … 2910 2910 * @return array 2911 2911 */ 2912 2912 function filter_customize_dynamic_setting_args_for_test_dynamic_settings( $setting_args, $setting_id ) { 2913 $this->assertI nternalType( 'string',$setting_id );2913 $this->assertIsString( $setting_id ); 2914 2914 if ( in_array( $setting_id, array( 'foo', 'bar' ), true ) ) { 2915 2915 $setting_args = array( 'default' => "dynamic_{$setting_id}_default" ); 2916 2916 } … … 2927 2927 */ 2928 2928 function filter_customize_dynamic_setting_class_for_test_dynamic_settings( $setting_class, $setting_id, $setting_args ) { 2929 2929 $this->assertSame( 'WP_Customize_Setting', $setting_class ); 2930 $this->assertI nternalType( 'string',$setting_id );2931 $this->assertI nternalType( 'array',$setting_args );2930 $this->assertIsString( $setting_id ); 2931 $this->assertIsArray( $setting_args ); 2932 2932 return $setting_class; 2933 2933 } 2934 2934 … … 3039 3039 */ 3040 3040 function test_nonces() { 3041 3041 $nonces = $this->manager->get_nonces(); 3042 $this->assertI nternalType( 'array',$nonces );3042 $this->assertIsArray( $nonces ); 3043 3043 $this->assertArrayHasKey( 'save', $nonces ); 3044 3044 $this->assertArrayHasKey( 'preview', $nonces ); 3045 3045 … … 3203 3203 * @return array Components. 3204 3204 */ 3205 3205 function return_array_containing_widgets( $components, $customize_manager ) { 3206 $this->assertI nternalType( 'array',$components );3206 $this->assertIsArray( $components ); 3207 3207 $this->assertContains( 'widgets', $components ); 3208 3208 $this->assertContains( 'nav_menus', $components ); 3209 $this->assertI nternalType( 'array',$components );3209 $this->assertIsArray( $components ); 3210 3210 $this->assertInstanceOf( 'WP_Customize_Manager', $customize_manager ); 3211 3211 return array( 'widgets' ); 3212 3212 } … … 3220 3220 * @return array Components. 3221 3221 */ 3222 3222 function return_array_containing_nav_menus( $components, $customize_manager ) { 3223 $this->assertI nternalType( 'array',$components );3223 $this->assertIsArray( $components ); 3224 3224 $this->assertContains( 'widgets', $components ); 3225 3225 $this->assertContains( 'nav_menus', $components ); 3226 $this->assertI nternalType( 'array',$components );3226 $this->assertIsArray( $components ); 3227 3227 $this->assertInstanceOf( 'WP_Customize_Manager', $customize_manager ); 3228 3228 return array( 'nav_menus' ); 3229 3229 } -
tests/phpunit/tests/customize/nav-menu-item-setting.php
73 73 $this->assertNull( $setting->previous_post_id ); 74 74 $this->assertNull( $setting->update_status ); 75 75 $this->assertNull( $setting->update_error ); 76 $this->assertI nternalType( 'array',$setting->default );76 $this->assertIsArray( $setting->default ); 77 77 78 78 $default = array( 79 79 'object_id' => 0, … … 533 533 ); 534 534 foreach ( $valid_urls as $valid_url ) { 535 535 $url_setting = $setting->sanitize( array( 'url' => $valid_url ) ); 536 $this->assertI nternalType( 'array',$url_setting );536 $this->assertIsArray( $url_setting ); 537 537 $this->assertSame( $valid_url, $url_setting['url'] ); 538 538 } 539 539 -
tests/phpunit/tests/customize/nav-menu-setting.php
70 70 $this->assertNull( $setting->previous_term_id ); 71 71 $this->assertNull( $setting->update_status ); 72 72 $this->assertNull( $setting->update_error ); 73 $this->assertI nternalType( 'array',$setting->default );73 $this->assertIsArray( $setting->default ); 74 74 foreach ( array( 'name', 'description', 'parent' ) as $key ) { 75 75 $this->assertArrayHasKey( $key, $setting->default ); 76 76 } … … 149 149 $setting = new WP_Customize_Nav_Menu_Setting( $this->wp_customize, $setting_id ); 150 150 151 151 $value = $setting->value(); 152 $this->assertI nternalType( 'array',$value );152 $this->assertIsArray( $value ); 153 153 foreach ( array( 'name', 'description', 'parent' ) as $key ) { 154 154 $this->assertArrayHasKey( $key, $value ); 155 155 } … … 225 225 $menus = wp_get_nav_menus(); 226 226 $menus_ids = wp_list_pluck( $menus, 'term_id' ); 227 227 $i = array_search( $menu_id, $menus_ids, true ); 228 $this->assertI nternalType( 'int',$i, 'Update-previewed menu does not appear in wp_get_nav_menus()' );228 $this->assertIsInt( $i, 'Update-previewed menu does not appear in wp_get_nav_menus()' ); 229 229 $filtered_menu = $menus[ $i ]; 230 230 $this->assertSame( 'Name 2 \\o/', $filtered_menu->name ); 231 231 } … … 270 270 $menus = wp_get_nav_menus(); 271 271 $menus_ids = wp_list_pluck( $menus, 'term_id' ); 272 272 $i = array_search( $menu_id, $menus_ids, true ); 273 $this->assertI nternalType( 'int',$i, 'Insert-previewed menu was not injected into wp_get_nav_menus()' );273 $this->assertIsInt( $i, 'Insert-previewed menu was not injected into wp_get_nav_menus()' ); 274 274 $filtered_menu = $menus[ $i ]; 275 275 $this->assertSame( 'New Menu Name 1 \\o/', $filtered_menu->name ); 276 276 } … … 304 304 305 305 $this->wp_customize->set_post_value( $setting_id, false ); 306 306 307 $this->assertI nternalType( 'array',$setting->value() );308 $this->assertI nternalType( 'object',wp_get_nav_menu_object( $menu_id ) );307 $this->assertIsArray( $setting->value() ); 308 $this->assertIsObject( wp_get_nav_menu_object( $menu_id ) ); 309 309 $setting->preview(); 310 310 $this->assertFalse( $setting->value() ); 311 311 $this->assertFalse( wp_get_nav_menu_object( $menu_id ) ); -
tests/phpunit/tests/customize/nav-menus.php
381 381 ) 382 382 ); 383 383 $this->assertSame( $count + 1, $this->filter_count_customize_nav_menu_searched_items ); 384 $this->assertI nternalType( 'array',$results );384 $this->assertIsArray( $results ); 385 385 $this->assertCount( 3, $results ); 386 386 remove_filter( 'customize_nav_menu_searched_items', array( $this, 'filter_search' ), 10 ); 387 387 … … 465 465 * @return array Items. 466 466 */ 467 467 function filter_search( $items, $args ) { 468 $this->assertI nternalType( 'array',$items );469 $this->assertI nternalType( 'array',$args );468 $this->assertIsArray( $items ); 469 $this->assertIsArray( $args ); 470 470 $this->assertArrayHasKey( 's', $args ); 471 471 $this->assertArrayHasKey( 'pagenum', $args ); 472 472 $this->filter_count_customize_nav_menu_searched_items += 1; … … 804 804 do_action( 'customize_register', $this->wp_customize ); 805 805 806 806 $args = apply_filters( 'customize_dynamic_partial_args', false, 'nav_menu_instance[68b329da9893e34099c7d8ad5cb9c940]' ); 807 $this->assertI nternalType( 'array',$args );807 $this->assertIsArray( $args ); 808 808 $this->assertSame( 'nav_menu_instance', $args['type'] ); 809 809 $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] ); 810 810 $this->assertTrue( $args['container_inclusive'] ); 811 811 812 812 $args = apply_filters( 'customize_dynamic_partial_args', array( 'fallback_refresh' => false ), 'nav_menu_instance[4099c7d8ad5cb9c94068b329da9893e3]' ); 813 $this->assertI nternalType( 'array',$args );813 $this->assertIsArray( $args ); 814 814 $this->assertSame( 'nav_menu_instance', $args['type'] ); 815 815 $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] ); 816 816 $this->assertTrue( $args['container_inclusive'] ); -
tests/phpunit/tests/customize/panel.php
31 31 */ 32 32 function test_construct_default_args() { 33 33 $panel = new WP_Customize_Panel( $this->manager, 'foo' ); 34 $this->assertI nternalType( 'int',$panel->instance_number );34 $this->assertIsInt( $panel->instance_number ); 35 35 $this->assertSame( $this->manager, $panel->manager ); 36 36 $this->assertSame( 'foo', $panel->id ); 37 37 $this->assertSame( 160, $panel->priority ); … … 125 125 } 126 126 $this->assertEmpty( $data['content'] ); 127 127 $this->assertTrue( $data['active'] ); 128 $this->assertI nternalType( 'int',$data['instanceNumber'] );128 $this->assertIsInt( $data['instanceNumber'] ); 129 129 } 130 130 131 131 /** -
tests/phpunit/tests/customize/partial.php
166 166 function filter_customize_partial_render( $rendered, $partial, $container_context ) { 167 167 $this->assertTrue( false === $rendered || is_string( $rendered ) ); 168 168 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); 169 $this->assertI nternalType( 'array',$container_context );169 $this->assertIsArray( $container_context ); 170 170 $this->count_filter_customize_partial_render += 1; 171 171 return $rendered; 172 172 } … … 183 183 $this->assertSame( sprintf( 'customize_partial_render_%s', $partial->id ), current_filter() ); 184 184 $this->assertTrue( false === $rendered || is_string( $rendered ) ); 185 185 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); 186 $this->assertI nternalType( 'array',$container_context );186 $this->assertIsArray( $container_context ); 187 187 $this->count_filter_customize_partial_render_with_id += 1; 188 188 return $rendered; 189 189 } -
tests/phpunit/tests/customize/section.php
38 38 */ 39 39 function test_construct_default_args() { 40 40 $section = new WP_Customize_Section( $this->manager, 'foo' ); 41 $this->assertI nternalType( 'int',$section->instance_number );41 $this->assertIsInt( $section->instance_number ); 42 42 $this->assertSame( $this->manager, $section->manager ); 43 43 $this->assertSame( 'foo', $section->id ); 44 44 $this->assertSame( 160, $section->priority ); … … 139 139 } 140 140 $this->assertEmpty( $data['content'] ); 141 141 $this->assertTrue( $data['active'] ); 142 $this->assertI nternalType( 'int',$data['instanceNumber'] );142 $this->assertIsInt( $data['instanceNumber'] ); 143 143 } 144 144 145 145 /** -
tests/phpunit/tests/customize/selective-refresh-ajax.php
160 160 } 161 161 $output = json_decode( ob_get_clean(), true ); 162 162 $this->assertTrue( $output['success'] ); 163 $this->assertI nternalType( 'array',$output['data'] );163 $this->assertIsArray( $output['data'] ); 164 164 $this->assertArrayHasKey( 'contents', $output['data'] ); 165 165 $this->assertArrayHasKey( 'errors', $output['data'] ); 166 166 $this->assertArrayHasKey( 'foo', $output['data']['contents'] ); … … 280 280 * @return string 281 281 */ 282 282 function render_callback_blogname( $partial, $context ) { 283 $this->assertI nternalType( 'array',$context );283 $this->assertIsArray( $context ); 284 284 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); 285 285 return get_bloginfo( 'name', 'display' ); 286 286 } … … 293 293 * @return string 294 294 */ 295 295 function render_callback_blogdescription( $partial, $context ) { 296 $this->assertI nternalType( 'array',$context );296 $this->assertIsArray( $context ); 297 297 $this->assertInstanceOf( 'WP_Customize_Partial', $partial ); 298 298 $x = get_bloginfo( 'description', 'display' ); 299 299 return $x; … … 374 374 * @return array Response. 375 375 */ 376 376 function filter_customize_render_partials_response( $response, $component, $partial_placements ) { 377 $this->assertI nternalType( 'array',$response );377 $this->assertIsArray( $response ); 378 378 $this->assertInstanceOf( 'WP_Customize_Selective_Refresh', $component ); 379 379 if ( isset( $this->expected_partial_ids ) ) { 380 380 $this->assertSameSets( $this->expected_partial_ids, array_keys( $partial_placements ) ); -
tests/phpunit/tests/customize/selective-refresh.php
71 71 * @see WP_Customize_Selective_Refresh::partials() 72 72 */ 73 73 function test_partials() { 74 $this->assertI nternalType( 'array',$this->selective_refresh->partials() );74 $this->assertIsArray( $this->selective_refresh->partials() ); 75 75 } 76 76 77 77 /** … … 163 163 $html = ob_get_clean(); 164 164 $this->assertTrue( (bool) preg_match( '/_customizePartialRefreshExports = ({.+})/s', $html, $matches ) ); 165 165 $exported_data = json_decode( $matches[1], true ); 166 $this->assertI nternalType( 'array',$exported_data );166 $this->assertIsArray( $exported_data ); 167 167 $this->assertArrayHasKey( 'partials', $exported_data ); 168 $this->assertI nternalType( 'array',$exported_data['partials'] );168 $this->assertIsArray( $exported_data['partials'] ); 169 169 $this->assertArrayHasKey( 'blogname', $exported_data['partials'] ); 170 170 $this->assertArrayNotHasKey( 'top_secret_message', $exported_data['partials'] ); 171 171 $this->assertSame( '#site-title', $exported_data['partials']['blogname']['selector'] ); … … 208 208 */ 209 209 function filter_customize_dynamic_partial_args( $partial_args, $partial_id ) { 210 210 $this->assertTrue( false === $partial_args || is_array( $partial_args ) ); 211 $this->assertI nternalType( 'string',$partial_id );211 $this->assertIsString( $partial_id ); 212 212 213 213 if ( preg_match( '/^recognized/', $partial_id ) ) { 214 214 $partial_args = array( … … 230 230 * @return string 231 231 */ 232 232 function filter_customize_dynamic_partial_class( $partial_class, $partial_id, $partial_args ) { 233 $this->assertI nternalType( 'array',$partial_args );234 $this->assertI nternalType( 'string',$partial_id );235 $this->assertI nternalType( 'string',$partial_class );233 $this->assertIsArray( $partial_args ); 234 $this->assertIsString( $partial_id ); 235 $this->assertIsString( $partial_class ); 236 236 237 237 if ( 'recognized-class' === $partial_id ) { 238 238 $partial_class = 'Tested_Custom_Partial'; -
tests/phpunit/tests/customize/setting.php
730 730 */ 731 731 public function filter_validate_for_test_validate( $validity, $value ) { 732 732 $this->assertInstanceOf( 'WP_Error', $validity ); 733 $this->assertI nternalType( 'string',$value );733 $this->assertIsString( $value ); 734 734 if ( sanitize_key( $value ) !== $value ) { 735 735 $validity->add( 'invalid_key', 'Invalid key' ); 736 736 } -
tests/phpunit/tests/customize/widgets.php
235 235 $this->do_customize_boot_actions(); 236 236 237 237 $selective_refreshable_widgets = $this->manager->widgets->get_selective_refreshable_widgets(); 238 $this->assertI nternalType( 'array',$selective_refreshable_widgets );238 $this->assertIsArray( $selective_refreshable_widgets ); 239 239 $this->assertSame( count( $wp_widget_factory->widgets ), count( $selective_refreshable_widgets ) ); 240 240 $this->assertArrayHasKey( 'text', $selective_refreshable_widgets ); 241 241 $this->assertTrue( $selective_refreshable_widgets['text'] ); … … 620 620 $this->assertArrayHasKey( 'sidebar_id', $params ); 621 621 $this->assertArrayHasKey( 'width', $params ); 622 622 $this->assertArrayHasKey( 'height', $params ); 623 $this->assertI nternalType( 'bool',$params['is_wide'] );623 $this->assertIsBool( $params['is_wide'] ); 624 624 } 625 625 626 626 /** … … 677 677 $this->assertArrayNotHasKey( $setting_id, $this->manager->unsanitized_post_values() ); 678 678 $result = $this->manager->widgets->call_widget_update( $widget_id ); 679 679 680 $this->assertI nternalType( 'array',$result );680 $this->assertIsArray( $result ); 681 681 $this->assertArrayHasKey( 'instance', $result ); 682 682 $this->assertArrayHasKey( 'form', $result ); 683 683 $this->assertSame( $instance, $result['instance'] ); … … 686 686 $post_values = $this->manager->unsanitized_post_values(); 687 687 $this->assertArrayHasKey( $setting_id, $post_values ); 688 688 $post_value = $post_values[ $setting_id ]; 689 $this->assertI nternalType( 'array',$post_value );689 $this->assertIsArray( $post_value ); 690 690 $this->assertArrayHasKey( 'title', $post_value ); 691 691 $this->assertArrayHasKey( 'encoded_serialized_instance', $post_value ); 692 692 $this->assertArrayHasKey( 'instance_hash_key', $post_value ); … … 703 703 do_action( 'customize_register', $this->manager ); 704 704 705 705 $args = apply_filters( 'customize_dynamic_partial_args', false, 'widget[search-2]' ); 706 $this->assertI nternalType( 'array',$args );706 $this->assertIsArray( $args ); 707 707 $this->assertSame( 'widget', $args['type'] ); 708 708 $this->assertSame( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] ); 709 709 $this->assertTrue( $args['container_inclusive'] ); 710 710 711 711 $args = apply_filters( 'customize_dynamic_partial_args', array( 'fallback_refresh' => false ), 'widget[search-2]' ); 712 $this->assertI nternalType( 'array',$args );712 $this->assertIsArray( $args ); 713 713 $this->assertSame( 'widget', $args['type'] ); 714 714 $this->assertSame( array( $this->manager->widgets, 'render_widget_partial' ), $args['render_callback'] ); 715 715 $this->assertTrue( $args['container_inclusive'] ); -
tests/phpunit/tests/date/currentTime.php
99 99 $this->assertEqualsWithDelta( $wp_timestamp, current_time( 'U' ), 2, 'The dates should be equal' ); 100 100 101 101 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested 102 $this->assertI nternalType( 'int',current_time( 'timestamp' ) );102 $this->assertIsInt( current_time( 'timestamp' ) ); 103 103 } 104 104 105 105 /** -
tests/phpunit/tests/db.php
560 560 $this->assertNotEmpty( $wpdb->insert_id ); 561 561 562 562 $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d", $wpdb->insert_id ) ); 563 $this->assertI nternalType( 'object',$row );563 $this->assertIsObject( $row ); 564 564 $this->assertSame( 'Walter Sobchak', $row->display_name ); 565 565 } 566 566 … … 1682 1682 if ( $expect_bail ) { 1683 1683 $this->assertFalse( $data ); 1684 1684 } else { 1685 $this->assertI nternalType( 'array',$data );1685 $this->assertIsArray( $data ); 1686 1686 1687 1687 list( $parsed_host, $parsed_port, $parsed_socket, $parsed_is_ipv6 ) = $data; 1688 1688 -
tests/phpunit/tests/formatting/SanitizePost.php
19 19 ); 20 20 21 21 foreach ( $int_fields as $field => $type ) { 22 $this->assertInternalType( $type, $post->$field, "field $field" ); 22 switch ( $type ) { 23 case 'integer': 24 $this->assertIsInt( $post->$field, "field $field" ); 25 break; 26 case 'string': 27 $this->assertIsString( $post->$field, "field $field" ); 28 break; 29 } 23 30 } 24 31 } 25 32 } -
tests/phpunit/tests/functions.php
80 80 */ 81 81 function test_wp_parse_args_boolean_strings() { 82 82 $args = wp_parse_args( 'foo=false&bar=true' ); 83 $this->assertI nternalType( 'string',$args['foo'] );84 $this->assertI nternalType( 'string',$args['bar'] );83 $this->assertIsString( $args['foo'] ); 84 $this->assertIsString( $args['bar'] ); 85 85 } 86 86 87 87 /** … … 581 581 function test_get_allowed_mime_types() { 582 582 $mimes = get_allowed_mime_types(); 583 583 584 $this->assertI nternalType( 'array',$mimes );584 $this->assertIsArray( $mimes ); 585 585 $this->assertNotEmpty( $mimes ); 586 586 587 587 add_filter( 'upload_mimes', '__return_empty_array' ); 588 588 $mimes = get_allowed_mime_types(); 589 $this->assertI nternalType( 'array',$mimes );589 $this->assertIsArray( $mimes ); 590 590 $this->assertEmpty( $mimes ); 591 591 592 592 remove_filter( 'upload_mimes', '__return_empty_array' ); 593 593 $mimes = get_allowed_mime_types(); 594 $this->assertI nternalType( 'array',$mimes );594 $this->assertIsArray( $mimes ); 595 595 $this->assertNotEmpty( $mimes ); 596 596 } 597 597 … … 601 601 function test_wp_get_mime_types() { 602 602 $mimes = wp_get_mime_types(); 603 603 604 $this->assertI nternalType( 'array',$mimes );604 $this->assertIsArray( $mimes ); 605 605 $this->assertNotEmpty( $mimes ); 606 606 607 607 add_filter( 'mime_types', '__return_empty_array' ); 608 608 $mimes = wp_get_mime_types(); 609 $this->assertI nternalType( 'array',$mimes );609 $this->assertIsArray( $mimes ); 610 610 $this->assertEmpty( $mimes ); 611 611 612 612 remove_filter( 'mime_types', '__return_empty_array' ); 613 613 $mimes = wp_get_mime_types(); 614 $this->assertI nternalType( 'array',$mimes );614 $this->assertIsArray( $mimes ); 615 615 $this->assertNotEmpty( $mimes ); 616 616 617 617 // 'upload_mimes' should not affect wp_get_mime_types(). 618 618 add_filter( 'upload_mimes', '__return_empty_array' ); 619 619 $mimes = wp_get_mime_types(); 620 $this->assertI nternalType( 'array',$mimes );620 $this->assertIsArray( $mimes ); 621 621 $this->assertNotEmpty( $mimes ); 622 622 623 623 remove_filter( 'upload_mimes', '__return_empty_array' ); 624 624 $mimes2 = wp_get_mime_types(); 625 $this->assertI nternalType( 'array',$mimes2 );625 $this->assertIsArray( $mimes2 ); 626 626 $this->assertNotEmpty( $mimes2 ); 627 627 $this->assertSame( $mimes2, $mimes ); 628 628 } … … 910 910 911 911 $urls = wp_extract_urls( $blob ); 912 912 $this->assertNotEmpty( $urls ); 913 $this->assertI nternalType( 'array',$urls );913 $this->assertIsArray( $urls ); 914 914 $this->assertCount( count( $original_urls ), $urls ); 915 915 $this->assertSame( $original_urls, $urls ); 916 916 … … 931 931 932 932 $urls = wp_extract_urls( $blob ); 933 933 $this->assertNotEmpty( $urls ); 934 $this->assertI nternalType( 'array',$urls );934 $this->assertIsArray( $urls ); 935 935 $this->assertCount( 8, $urls ); 936 936 $this->assertSame( array_slice( $original_urls, 0, 8 ), $urls ); 937 937 … … 945 945 946 946 $urls = wp_extract_urls( $blob ); 947 947 $this->assertNotEmpty( $urls ); 948 $this->assertI nternalType( 'array',$urls );948 $this->assertIsArray( $urls ); 949 949 $this->assertCount( 8, $urls ); 950 950 $this->assertSame( array_slice( $original_urls, 0, 8 ), $urls ); 951 951 } … … 1066 1066 public function test_wp_get_ext_types() { 1067 1067 $extensions = wp_get_ext_types(); 1068 1068 1069 $this->assertI nternalType( 'array',$extensions );1069 $this->assertIsArray( $extensions ); 1070 1070 $this->assertNotEmpty( $extensions ); 1071 1071 1072 1072 add_filter( 'ext2type', '__return_empty_array' ); … … 1075 1075 1076 1076 remove_filter( 'ext2type', '__return_empty_array' ); 1077 1077 $extensions = wp_get_ext_types(); 1078 $this->assertI nternalType( 'array',$extensions );1078 $this->assertIsArray( $extensions ); 1079 1079 $this->assertNotEmpty( $extensions ); 1080 1080 } 1081 1081 … … 1197 1197 $ids = array(); 1198 1198 for ( $i = 0; $i < 20; $i += 1 ) { 1199 1199 $id = wp_unique_id(); 1200 $this->assertI nternalType( 'string',$id );1200 $this->assertIsString( $id ); 1201 1201 $this->assertTrue( is_numeric( $id ) ); 1202 1202 $ids[] = $id; 1203 1203 } -
tests/phpunit/tests/functions/listFiles.php
10 10 11 11 public function test_list_files_returns_a_list_of_files() { 12 12 $admin_files = list_files( ABSPATH . 'wp-admin/' ); 13 $this->assertI nternalType( 'array',$admin_files );13 $this->assertIsArray( $admin_files ); 14 14 $this->assertNotEmpty( $admin_files ); 15 15 $this->assertContains( ABSPATH . 'wp-admin/index.php', $admin_files ); 16 16 } -
tests/phpunit/tests/functions/wpGetMimeTypes.php
14 14 public function test_all_mime_match() { 15 15 $mime_types_start = wp_get_mime_types(); 16 16 17 $this->assertI nternalType( 'array',$mime_types_start );17 $this->assertIsArray( $mime_types_start ); 18 18 $this->assertNotEmpty( $mime_types_start ); 19 19 20 20 add_filter( 'mime_types', '__return_empty_array' ); … … 23 23 24 24 remove_filter( 'mime_types', '__return_empty_array' ); 25 25 $mime_types = wp_get_mime_types(); 26 $this->assertI nternalType( 'array',$mime_types );26 $this->assertIsArray( $mime_types ); 27 27 $this->assertNotEmpty( $mime_types ); 28 28 // Did it revert to the original after filter remove? 29 29 $this->assertSame( $mime_types_start, $mime_types ); -
tests/phpunit/tests/functions/wpRemoteFopen.php
29 29 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg'; 30 30 $response = wp_remote_fopen( $url ); 31 31 32 $this->assertI nternalType( 'string',$response );32 $this->assertIsString( $response ); 33 33 $this->assertSame( 40148, strlen( $response ) ); 34 34 } 35 35 } -
tests/phpunit/tests/general/template.php
304 304 $this->_set_custom_logo(); 305 305 $custom_logo = get_custom_logo(); 306 306 $this->assertNotEmpty( $custom_logo ); 307 $this->assertI nternalType( 'string',$custom_logo );307 $this->assertIsString( $custom_logo ); 308 308 309 309 $this->_remove_custom_logo(); 310 310 $this->assertEmpty( get_custom_logo() ); -
tests/phpunit/tests/general/wpGetArchives.php
31 31 'echo' => false, 32 32 ) 33 33 ); 34 $this->assertI nternalType( 'string',$result );34 $this->assertIsString( $result ); 35 35 $time1 = wp_cache_get( 'last_changed', 'posts' ); 36 36 $this->assertNotEmpty( $time1 ); 37 37 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 45 45 'echo' => false, 46 46 ) 47 47 ); 48 $this->assertI nternalType( 'string',$result );48 $this->assertIsString( $result ); 49 49 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 50 50 $this->assertSame( $num_queries, $wpdb->num_queries ); 51 51 … … 57 57 'order' => 'ASC', 58 58 ) 59 59 ); 60 $this->assertI nternalType( 'string',$result );60 $this->assertIsString( $result ); 61 61 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 62 62 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 63 63 … … 71 71 'order' => 'ASC', 72 72 ) 73 73 ); 74 $this->assertI nternalType( 'string',$result );74 $this->assertIsString( $result ); 75 75 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 76 76 $this->assertSame( $num_queries, $wpdb->num_queries ); 77 77 … … 84 84 'echo' => false, 85 85 ) 86 86 ); 87 $this->assertI nternalType( 'string',$result );87 $this->assertIsString( $result ); 88 88 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 89 89 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 90 90 … … 97 97 'echo' => false, 98 98 ) 99 99 ); 100 $this->assertI nternalType( 'string',$result );100 $this->assertIsString( $result ); 101 101 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 102 102 $this->assertSame( $num_queries, $wpdb->num_queries ); 103 103 … … 108 108 'echo' => false, 109 109 ) 110 110 ); 111 $this->assertI nternalType( 'string',$result );111 $this->assertIsString( $result ); 112 112 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 113 113 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 114 114 … … 121 121 'echo' => false, 122 122 ) 123 123 ); 124 $this->assertI nternalType( 'string',$result );124 $this->assertIsString( $result ); 125 125 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 126 126 $this->assertSame( $num_queries, $wpdb->num_queries ); 127 127 … … 132 132 'echo' => false, 133 133 ) 134 134 ); 135 $this->assertI nternalType( 'string',$result );135 $this->assertIsString( $result ); 136 136 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 137 137 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 138 138 … … 145 145 'echo' => false, 146 146 ) 147 147 ); 148 $this->assertI nternalType( 'string',$result );148 $this->assertIsString( $result ); 149 149 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 150 150 $this->assertSame( $num_queries, $wpdb->num_queries ); 151 151 … … 156 156 'echo' => false, 157 157 ) 158 158 ); 159 $this->assertI nternalType( 'string',$result );159 $this->assertIsString( $result ); 160 160 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 161 161 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 162 162 … … 169 169 'echo' => false, 170 170 ) 171 171 ); 172 $this->assertI nternalType( 'string',$result );172 $this->assertIsString( $result ); 173 173 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 174 174 $this->assertSame( $num_queries, $wpdb->num_queries ); 175 175 } -
tests/phpunit/tests/http/base.php
452 452 $res = wp_remote_head( $url, array( 'timeout' => 30 ) ); 453 453 454 454 $this->skipTestOnTimeout( $res ); 455 $this->assertI nternalType( 'array',wp_remote_retrieve_header( $res, 'location' ) );455 $this->assertIsArray( wp_remote_retrieve_header( $res, 'location' ) ); 456 456 $this->assertCount( 2, wp_remote_retrieve_header( $res, 'location' ) ); 457 457 458 458 $res = wp_remote_get( $url, array( 'timeout' => 30 ) ); -
tests/phpunit/tests/http/functions.php
19 19 20 20 $headers = wp_remote_retrieve_headers( $response ); 21 21 22 $this->assertI nternalType( 'array',$response );22 $this->assertIsArray( $response ); 23 23 24 24 $this->assertSame( 'image/jpeg', $headers['content-type'] ); 25 25 $this->assertSame( '40148', $headers['content-length'] ); … … 63 63 64 64 $headers = wp_remote_retrieve_headers( $response ); 65 65 66 $this->assertI nternalType( 'array',$response );66 $this->assertIsArray( $response ); 67 67 68 68 // Should return the same headers as a HEAD request. 69 69 $this->assertSame( 'image/jpeg', $headers['content-type'] ); -
tests/phpunit/tests/image/functions.php
337 337 338 338 // First, test with deprecated wp_load_image function. 339 339 $editor1 = wp_load_image( DIR_TESTDATA ); 340 $this->assertI nternalType( 'string',$editor1 );340 $this->assertIsString( $editor1 ); 341 341 342 342 $editor2 = wp_get_image_editor( DIR_TESTDATA ); 343 343 $this->assertInstanceOf( 'WP_Error', $editor2 ); -
tests/phpunit/tests/image/header.php
147 147 148 148 $cropped_id = $this->custom_image_header->insert_attachment( $object, $cropped ); 149 149 150 $this->assertI nternalType( 'int',$cropped_id );150 $this->assertIsInt( $cropped_id ); 151 151 $this->assertGreaterThan( 0, $cropped_id ); 152 152 } 153 153 -
tests/phpunit/tests/image/intermediateSize.php
34 34 function test_make_intermediate_size_width() { 35 35 $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 100, 0, false ); 36 36 37 $this->assertI nternalType( 'array',$image );37 $this->assertIsArray( $image ); 38 38 } 39 39 40 40 /** … … 43 43 function test_make_intermediate_size_height() { 44 44 $image = image_make_intermediate_size( DIR_TESTDATA . '/images/a2-small.jpg', 0, 75, false ); 45 45 46 $this->assertI nternalType( 'array',$image );46 $this->assertIsArray( $image ); 47 47 } 48 48 49 49 /** … … 54 54 55 55 unlink( DIR_TESTDATA . '/images/a2-small-100x75.jpg' ); 56 56 57 $this->assertI nternalType( 'array',$image );57 $this->assertIsArray( $image ); 58 58 $this->assertSame( 100, $image['width'] ); 59 59 $this->assertSame( 75, $image['height'] ); 60 60 $this->assertSame( 'image/jpeg', $image['mime-type'] ); -
tests/phpunit/tests/image/siteIcon.php
120 120 $object = $this->wp_site_icon->create_attachment_object( $cropped, $attachment_id ); 121 121 $cropped_id = $this->wp_site_icon->insert_attachment( $object, $cropped ); 122 122 123 $this->assertI nternalType( 'int',$cropped_id );123 $this->assertIsInt( $cropped_id ); 124 124 $this->assertGreaterThan( 0, $cropped_id ); 125 125 } 126 126 -
tests/phpunit/tests/includes/factory.php
35 35 public function test_term_factory_create_and_get_should_return_term_object() { 36 36 register_taxonomy( 'wptests_tax', 'post' ); 37 37 $term = self::factory()->term->create_and_get( array( 'taxonomy' => 'wptests_tax' ) ); 38 $this->assertI nternalType( 'object',$term );38 $this->assertIsObject( $term ); 39 39 $this->assertNotEmpty( $term->term_id ); 40 40 } 41 41 } -
tests/phpunit/tests/l10n.php
56 56 */ 57 57 function test_get_available_languages() { 58 58 $array = get_available_languages(); 59 $this->assertI nternalType( 'array',$array );59 $this->assertIsArray( $array ); 60 60 61 61 $array = get_available_languages( '.' ); 62 62 $this->assertEmpty( $array ); … … 70 70 */ 71 71 function test_wp_get_installed_translations_for_core() { 72 72 $installed_translations = wp_get_installed_translations( 'core' ); 73 $this->assertI nternalType( 'array',$installed_translations );73 $this->assertIsArray( $installed_translations ); 74 74 $textdomains_expected = array( 'admin', 'admin-network', 'continents-cities', 'default' ); 75 75 $this->assertSameSets( $textdomains_expected, array_keys( $installed_translations ) ); 76 76 -
tests/phpunit/tests/media.php
381 381 $post = get_post( $id ); 382 382 383 383 $prepped = wp_prepare_attachment_for_js( $post ); 384 $this->assertI nternalType( 'array',$prepped );384 $this->assertIsArray( $prepped ); 385 385 $this->assertSame( 0, $prepped['uploadedTo'] ); 386 386 $this->assertSame( '', $prepped['mime'] ); 387 387 $this->assertSame( '', $prepped['type'] ); … … 1164 1164 */ 1165 1165 function test_attachment_url_to_postid_with_empty_url() { 1166 1166 $post_id = attachment_url_to_postid( '' ); 1167 $this->assertI nternalType( 'int',$post_id );1167 $this->assertIsInt( $post_id ); 1168 1168 $this->assertSame( 0, $post_id ); 1169 1169 } 1170 1170 -
tests/phpunit/tests/media/getAttachmentTaxonomies.php
119 119 $found = get_attachment_taxonomies( $attachment, 'objects' ); 120 120 121 121 $this->assertSame( array( 'wptests_tax2' ), array_keys( $found ) ); 122 $this->assertI nternalType( 'object',$found['wptests_tax2'] );122 $this->assertIsObject( $found['wptests_tax2'] ); 123 123 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 124 124 } 125 125 … … 143 143 $found = get_attachment_taxonomies( $attachment, 'objects' ); 144 144 145 145 $this->assertSame( array( 'wptests_tax2' ), array_keys( $found ) ); 146 $this->assertI nternalType( 'object',$found['wptests_tax2'] );146 $this->assertIsObject( $found['wptests_tax2'] ); 147 147 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 148 148 } 149 149 } -
tests/phpunit/tests/meta.php
207 207 $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 208 208 $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) ); 209 209 $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 210 $this->assertI nternalType( 'int',add_metadata( 'user', $this->author->ID, $key, $value ) );210 $this->assertIsInt( add_metadata( 'user', $this->author->ID, $key, $value ) ); 211 211 $this->assertSame( $expected, get_metadata( 'user', $this->author->ID, $key, true ) ); 212 212 $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 213 213 $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 214 $this->assertI nternalType( 'int',update_metadata( 'user', $this->author->ID, $key, $value ) );214 $this->assertIsInt( update_metadata( 'user', $this->author->ID, $key, $value ) ); 215 215 $this->assertSame( $expected, get_metadata( 'user', $this->author->ID, $key, true ) ); 216 216 $this->assertTrue( update_metadata( 'user', $this->author->ID, $key, 'blah' ) ); 217 217 $this->assertSame( 'blah', get_metadata( 'user', $this->author->ID, $key, true ) ); … … 220 220 $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 221 221 222 222 // Test overslashing. 223 $this->assertI nternalType( 'int',add_metadata( 'user', $this->author->ID, $key, $value2 ) );223 $this->assertIsInt( add_metadata( 'user', $this->author->ID, $key, $value2 ) ); 224 224 $this->assertSame( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) ); 225 225 $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 226 226 $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 227 $this->assertI nternalType( 'int',update_metadata( 'user', $this->author->ID, $key, $value2 ) );227 $this->assertIsInt( update_metadata( 'user', $this->author->ID, $key, $value2 ) ); 228 228 $this->assertSame( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) ); 229 229 } 230 230 -
tests/phpunit/tests/multisite/cleanDirsizeCache.php
206 206 207 207 // `dirsize_cache` should now be filled after upload and recurse_dirsize() call. 208 208 $cache_path = untrailingslashit( $upload_dir['path'] ); 209 $this->assertI nternalType( 'array',get_transient( 'dirsize_cache' ) );209 $this->assertIsArray( get_transient( 'dirsize_cache' ) ); 210 210 $this->assertSame( $size, get_transient( 'dirsize_cache' )[ $cache_path ] ); 211 211 212 212 // Cleanup. -
tests/phpunit/tests/multisite/network.php
352 352 // We can't use wp_schedule_update_network_counts() because WP_INSTALLING is set. 353 353 wp_schedule_event( time(), 'twicedaily', 'update_network_counts' ); 354 354 355 $this->assertI nternalType( 'int',wp_next_scheduled( 'update_network_counts' ) );355 $this->assertIsInt( wp_next_scheduled( 'update_network_counts' ) ); 356 356 } 357 357 358 358 /** … … 365 365 366 366 $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); 367 367 $blog_id = self::factory()->blog->create( array( 'user_id' => $user_id ) ); 368 $this->assertI nternalType( 'int',$blog_id );368 $this->assertIsInt( $blog_id ); 369 369 370 370 // Set the dashboard blog to another one. 371 371 update_site_option( 'dashboard_blog', $blog_id ); -
tests/phpunit/tests/multisite/site.php
94 94 $this->assertSame( array(), $_wp_switched_stack ); 95 95 $this->assertFalse( ms_is_switched() ); 96 96 $current_blog_id = get_current_blog_id(); 97 $this->assertI nternalType( 'integer',$current_blog_id );97 $this->assertIsInt( $current_blog_id ); 98 98 99 99 wp_cache_set( 'switch-test', $current_blog_id, 'switch-test' ); 100 100 $this->assertSame( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) ); … … 141 141 142 142 $blog_id = self::factory()->blog->create(); 143 143 144 $this->assertI nternalType( 'int',$blog_id );144 $this->assertIsInt( $blog_id ); 145 145 $prefix = $wpdb->get_blog_prefix( $blog_id ); 146 146 147 147 // $get_all = false, only retrieve details from the blogs table. … … 1328 1328 remove_action( 'wp_initialize_site', 'wp_initialize_site', 10 ); 1329 1329 $site_id = wp_insert_site( $site_data ); 1330 1330 1331 $this->assertI nternalType( 'integer',$site_id );1331 $this->assertIsInt( $site_id ); 1332 1332 1333 1333 $site = get_site( $site_id ); 1334 1334 foreach ( $expected_data as $key => $value ) { … … 1434 1434 1435 1435 remove_action( 'clean_site_cache', array( $this, 'action_database_insert_on_clean_site_cache' ) ); 1436 1436 1437 $this->assertI nternalType( 'integer',$site_id );1437 $this->assertIsInt( $site_id ); 1438 1438 1439 1439 } 1440 1440 … … 1819 1819 'network_id' => 1, 1820 1820 ) 1821 1821 ); 1822 $this->assertI nternalType( 'integer',$site_id );1822 $this->assertIsInt( $site_id ); 1823 1823 1824 1824 $site = get_site( $site_id ); 1825 1825 $this->assertEqualsWithDelta( strtotime( $first_date ), strtotime( $site->registered ), 2, 'The dates should be equal' ); … … 1827 1827 1828 1828 $second_date = current_time( 'mysql', true ); 1829 1829 $site_id = wp_update_site( $site_id, array() ); 1830 $this->assertI nternalType( 'integer',$site_id );1830 $this->assertIsInt( $site_id ); 1831 1831 1832 1832 $site = get_site( $site_id ); 1833 1833 $this->assertEqualsWithDelta( strtotime( $first_date ), strtotime( $site->registered ), 2, 'The dates should be equal' ); -
tests/phpunit/tests/multisite/siteMeta.php
157 157 } 158 158 159 159 $actual = update_site_meta( self::$site_id, 'foo', 'bar' ); 160 $this->assertI nternalType( 'int',$actual );160 $this->assertIsInt( $actual ); 161 161 $this->assertNotEmpty( $actual ); 162 162 163 163 $meta = get_site_meta( self::$site_id, 'foo', true ); -
tests/phpunit/tests/oembed/controller.php
169 169 if ( ! is_string( $data ) && false !== $data ) { 170 170 $this->fail( 'Unexpected type for $data.' ); 171 171 } 172 $this->assertI nternalType( 'string',$url );173 $this->assertI nternalType( 'array',$args );172 $this->assertIsString( $url ); 173 $this->assertIsArray( $args ); 174 174 $this->oembed_result_filter_count++; 175 175 return $data; 176 176 } … … 299 299 $response = rest_get_server()->dispatch( $request ); 300 300 $data = $response->get_data(); 301 301 302 $this->assertI nternalType( 'array',$data );302 $this->assertIsArray( $data ); 303 303 $this->assertNotEmpty( $data ); 304 304 } 305 305 … … 323 323 $response = rest_get_server()->dispatch( $request ); 324 324 $data = $response->get_data(); 325 325 326 $this->assertI nternalType( 'array',$data );326 $this->assertIsArray( $data ); 327 327 $this->assertNotEmpty( $data ); 328 328 329 329 $this->assertArrayHasKey( 'version', $data ); … … 366 366 $response = rest_get_server()->dispatch( $request ); 367 367 $data = $response->get_data(); 368 368 369 $this->assertI nternalType( 'array',$data );369 $this->assertIsArray( $data ); 370 370 $this->assertNotEmpty( $data ); 371 371 372 372 $this->assertArrayHasKey( 'version', $data ); … … 411 411 $response = rest_get_server()->dispatch( $request ); 412 412 $data = $response->get_data(); 413 413 414 $this->assertI nternalType( 'array',$data );414 $this->assertIsArray( $data ); 415 415 $this->assertNotEmpty( $data ); 416 416 417 417 $this->assertArrayHasKey( 'version', $data ); … … 454 454 $response = rest_get_server()->dispatch( $request ); 455 455 $data = $response->get_data(); 456 456 457 $this->assertI nternalType( 'array',$data );457 $this->assertIsArray( $data ); 458 458 $this->assertNotEmpty( $data ); 459 459 460 460 restore_current_blog(); … … 603 603 $data = $response->get_data(); 604 604 605 605 $this->assertNotEmpty( $data ); 606 $this->assertI nternalType( 'object',$data );606 $this->assertIsObject( $data ); 607 607 $this->assertSame( 'YouTube', $data->provider_name ); 608 608 $this->assertSame( 'https://i.ytimg.com/vi/' . self::YOUTUBE_VIDEO_ID . '/hqdefault.jpg', $data->thumbnail_url ); 609 609 $this->assertEquals( $data->width, $request['maxwidth'] ); … … 630 630 $data = $response->get_data(); 631 631 632 632 $this->assertNotEmpty( $data ); 633 $this->assertI nternalType( 'object',$data );634 $this->assertI nternalType( 'string',$data->html );635 $this->assertI nternalType( 'array',$data->scripts );633 $this->assertIsObject( $data ); 634 $this->assertIsString( $data->html ); 635 $this->assertIsArray( $data->scripts ); 636 636 } 637 637 638 638 public function test_proxy_with_invalid_oembed_provider_no_discovery() { … … 743 743 $response = rest_get_server()->dispatch( $request ); 744 744 $data = $response->get_data(); 745 745 746 $this->assertI nternalType( 'object',$data );746 $this->assertIsObject( $data ); 747 747 748 748 $data = (array) $data; 749 749 … … 786 786 $data = $response->get_data(); 787 787 788 788 $this->assertSame( 1, $this->oembed_result_filter_count ); 789 $this->assertI nternalType( 'object',$data );789 $this->assertIsObject( $data ); 790 790 $this->assertSame( 'Untrusted', $data->provider_name ); 791 791 $this->assertSame( self::UNTRUSTED_PROVIDER_URL, $data->provider_url ); 792 792 $this->assertSame( 'rich', $data->type ); … … 809 809 $data = $response->get_data(); 810 810 811 811 $this->assertSame( 1, $this->oembed_result_filter_count ); 812 $this->assertI nternalType( 'object',$data );812 $this->assertIsObject( $data ); 813 813 814 814 $this->assertStringStartsWith( '<b>Unfiltered</b>', $data->html ); 815 815 } -
tests/phpunit/tests/option/multisite.php
99 99 100 100 function test_with_another_site() { 101 101 $user_id = self::factory()->user->create(); 102 $this->assertI nternalType( 'integer',$user_id );102 $this->assertIsInt( $user_id ); 103 103 104 104 $blog_id = self::factory()->blog->create( 105 105 array( … … 107 107 'public' => 1, 108 108 ) 109 109 ); 110 $this->assertI nternalType( 'integer',$blog_id );110 $this->assertIsInt( $blog_id ); 111 111 112 112 $key = __FUNCTION__ . '_key1'; 113 113 $key2 = __FUNCTION__ . '_key2'; -
tests/phpunit/tests/post.php
97 97 98 98 update_object_term_cache( $id, $post_type ); 99 99 $tcache = wp_cache_get( $id, 'post_tag_relationships' ); 100 $this->assertI nternalType( 'array',$tcache );100 $this->assertIsArray( $tcache ); 101 101 $this->assertSame( 2, count( $tcache ) ); 102 102 103 103 $tcache = wp_cache_get( $id, 'ctax_relationships' ); 104 104 if ( 'cpt' === $post_type ) { 105 $this->assertI nternalType( 'array',$tcache );105 $this->assertIsArray( $tcache ); 106 106 $this->assertSame( 2, count( $tcache ) ); 107 107 } else { 108 108 $this->assertFalse( $tcache ); -
tests/phpunit/tests/post/formats.php
12 12 13 13 $result = set_post_format( $post_id, 'aside' ); 14 14 $this->assertNotWPError( $result ); 15 $this->assertI nternalType( 'array',$result );15 $this->assertIsArray( $result ); 16 16 $this->assertSame( 1, count( $result ) ); 17 17 18 18 $format = get_post_format( $post_id ); … … 20 20 21 21 $result = set_post_format( $post_id, 'standard' ); 22 22 $this->assertNotWPError( $result ); 23 $this->assertI nternalType( 'array',$result );23 $this->assertIsArray( $result ); 24 24 $this->assertSame( 0, count( $result ) ); 25 25 26 26 $result = set_post_format( $post_id, '' ); 27 27 $this->assertNotWPError( $result ); 28 $this->assertI nternalType( 'array',$result );28 $this->assertIsArray( $result ); 29 29 $this->assertSame( 0, count( $result ) ); 30 30 } 31 31 … … 40 40 41 41 $result = set_post_format( $post_id, 'aside' ); 42 42 $this->assertNotWPError( $result ); 43 $this->assertI nternalType( 'array',$result );43 $this->assertIsArray( $result ); 44 44 $this->assertSame( 1, count( $result ) ); 45 45 // The format can be set but not retrieved until it is registered. 46 46 $format = get_post_format( $post_id ); … … 53 53 54 54 $result = set_post_format( $post_id, 'standard' ); 55 55 $this->assertNotWPError( $result ); 56 $this->assertI nternalType( 'array',$result );56 $this->assertIsArray( $result ); 57 57 $this->assertSame( 0, count( $result ) ); 58 58 59 59 $result = set_post_format( $post_id, '' ); 60 60 $this->assertNotWPError( $result ); 61 $this->assertI nternalType( 'array',$result );61 $this->assertIsArray( $result ); 62 62 $this->assertSame( 0, count( $result ) ); 63 63 64 64 remove_post_type_support( 'page', 'post-formats' ); … … 72 72 73 73 $result = set_post_format( $post_id, 'aside' ); 74 74 $this->assertNotWPError( $result ); 75 $this->assertI nternalType( 'array',$result );75 $this->assertIsArray( $result ); 76 76 $this->assertSame( 1, count( $result ) ); 77 77 $this->assertTrue( has_post_format( 'aside', $post_id ) ); 78 78 79 79 $result = set_post_format( $post_id, 'standard' ); 80 80 $this->assertNotWPError( $result ); 81 $this->assertI nternalType( 'array',$result );81 $this->assertIsArray( $result ); 82 82 $this->assertSame( 0, count( $result ) ); 83 83 // Standard is a special case. It shows as false when set. 84 84 $this->assertFalse( has_post_format( 'standard', $post_id ) ); -
tests/phpunit/tests/post/getPageByPath.php
306 306 $this->assertSame( $page, $found->ID ); 307 307 308 308 $object = get_page_by_path( 'foo', OBJECT ); 309 $this->assertI nternalType( 'object',$object );309 $this->assertIsObject( $object ); 310 310 $this->assertSame( $page, $object->ID ); 311 311 312 312 $array_n = get_page_by_path( 'foo', ARRAY_N ); 313 $this->assertI nternalType( 'array',$array_n );313 $this->assertIsArray( $array_n ); 314 314 $this->assertSame( $page, $array_n[0] ); 315 315 316 316 $array_a = get_page_by_path( 'foo', ARRAY_A ); 317 $this->assertI nternalType( 'array',$array_a );317 $this->assertIsArray( $array_a ); 318 318 $this->assertSame( $page, $array_a['ID'] ); 319 319 } 320 320 } -
tests/phpunit/tests/post/getPostTypeLabels.php
5 5 */ 6 6 class Tests_Post_GetPostTypeLabels extends WP_UnitTestCase { 7 7 public function test_returns_an_object() { 8 $this->assertInternalType( 9 'object', 8 $this->assertIsObject( 10 9 get_post_type_labels( 11 10 (object) array( 12 11 'name' => 'foo', -
tests/phpunit/tests/post/meta.php
46 46 47 47 function test_unique_postmeta() { 48 48 // Add a unique post meta item. 49 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique', 'value', true ) );49 $this->assertIsInt( add_post_meta( self::$post_id, 'unique', 'value', true ) ); 50 50 51 51 // Check unique is enforced. 52 52 $this->assertFalse( add_post_meta( self::$post_id, 'unique', 'another value', true ) ); … … 69 69 70 70 function test_nonunique_postmeta() { 71 71 // Add two non-unique post meta items. 72 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'value' ) );73 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'another value' ) );72 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'value' ) ); 73 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'another value' ) ); 74 74 75 75 // Check they exist. 76 76 $this->assertSame( 'value', get_post_meta( self::$post_id, 'nonunique', true ) ); … … 87 87 $this->assertSame( array( 'another value' ), get_post_meta( self::$post_id, 'nonunique', false ) ); 88 88 89 89 // Add a third one. 90 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique', 'someother value' ) );90 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique', 'someother value' ) ); 91 91 92 92 // Check they exist. 93 93 $expected = array( … … 106 106 107 107 function test_update_post_meta() { 108 108 // Add a unique post meta item. 109 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_update', 'value', true ) );109 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_update', 'value', true ) ); 110 110 111 111 // Add two non-unique post meta items. 112 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique_update', 'value' ) );113 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) );112 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique_update', 'value' ) ); 113 $this->assertIsInt( add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) ); 114 114 115 115 // Check they exist. 116 116 $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_update', true ) ); … … 133 133 134 134 function test_delete_post_meta() { 135 135 // Add two unique post meta items. 136 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_delete', 'value', true ) );137 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id_2, 'unique_delete', 'value', true ) );136 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete', 'value', true ) ); 137 $this->assertIsInt( add_post_meta( self::$post_id_2, 'unique_delete', 'value', true ) ); 138 138 139 139 // Check they exist. 140 140 $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_delete', true ) ); … … 150 150 151 151 function test_delete_post_meta_by_key() { 152 152 // Add two unique post meta items. 153 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'unique_delete_by_key', 'value', true ) );154 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id_2, 'unique_delete_by_key', 'value', true ) );153 $this->assertIsInt( add_post_meta( self::$post_id, 'unique_delete_by_key', 'value', true ) ); 154 $this->assertIsInt( add_post_meta( self::$post_id_2, 'unique_delete_by_key', 'value', true ) ); 155 155 156 156 // Check they exist. 157 157 $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_delete_by_key', true ) ); … … 167 167 168 168 function test_get_post_meta_by_id() { 169 169 $mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', 'get_post_meta_by_key_value', true ); 170 $this->assertI nternalType( 'integer',$mid );170 $this->assertIsInt( $mid ); 171 171 172 172 $mobj = new stdClass; 173 173 $mobj->meta_id = $mid; … … 178 178 delete_metadata_by_mid( 'post', $mid ); 179 179 180 180 $mid = add_post_meta( self::$post_id, 'get_post_meta_by_key', array( 'foo', 'bar' ), true ); 181 $this->assertI nternalType( 'integer',$mid );181 $this->assertIsInt( $mid ); 182 182 $mobj->meta_id = $mid; 183 183 $mobj->meta_value = array( 'foo', 'bar' ); 184 184 $this->assertEquals( $mobj, get_post_meta_by_id( $mid ) ); … … 187 187 188 188 function test_delete_meta() { 189 189 $mid = add_post_meta( self::$post_id, 'delete_meta', 'delete_meta_value', true ); 190 $this->assertI nternalType( 'integer',$mid );190 $this->assertIsInt( $mid ); 191 191 192 192 $this->assertTrue( delete_meta( $mid ) ); 193 193 $this->assertFalse( get_metadata_by_mid( 'post', $mid ) ); … … 197 197 198 198 function test_update_meta() { 199 199 // Add a unique post meta item. 200 $this->assertInternalType( 'integer', $mid1 = add_post_meta( self::$post_id, 'unique_update', 'value', true ) ); 200 $mid1 = add_post_meta( self::$post_id, 'unique_update', 'value', true ); 201 $this->assertIsInt( $mid1 ); 201 202 202 203 // Add two non-unique post meta items. 203 $this->assertInternalType( 'integer', $mid2 = add_post_meta( self::$post_id, 'nonunique_update', 'value' ) ); 204 $this->assertInternalType( 'integer', $mid3 = add_post_meta( self::$post_id, 'nonunique_update', 'another value' ) ); 204 $mid2 = add_post_meta( self::$post_id, 'nonunique_update', 'value' ); 205 $this->assertIsInt( $mid2 ); 206 $mid3 = add_post_meta( self::$post_id, 'nonunique_update', 'another value' ); 207 $this->assertIsInt( $mid3 ); 205 208 206 209 // Check they exist. 207 210 $this->assertSame( 'value', get_post_meta( self::$post_id, 'unique_update', true ) ); … … 242 245 $funky_meta[] = $classy; 243 246 244 247 // Add a post meta item. 245 $this->assertI nternalType( 'integer',add_post_meta( self::$post_id, 'test_funky_post_meta', $funky_meta, true ) );248 $this->assertIsInt( add_post_meta( self::$post_id, 'test_funky_post_meta', $funky_meta, true ) ); 246 249 247 250 // Check it exists. 248 251 $this->assertEquals( $funky_meta, get_post_meta( self::$post_id, 'test_funky_post_meta', true ) ); … … 318 321 319 322 wp_cache_delete( 'last_changed', 'posts' ); 320 323 321 $this->assertI nternalType( 'integer',add_metadata( 'post', $post_id, 'foo', 'bar' ) );324 $this->assertIsInt( add_metadata( 'post', $post_id, 'foo', 'bar' ) ); 322 325 $this->assertNotFalse( wp_cache_get_last_changed( 'posts' ) ); 323 326 } 324 327 … … 330 333 331 334 wp_cache_delete( 'last_changed', 'posts' ); 332 335 333 $this->assertI nternalType( 'integer',update_metadata( 'post', $post_id, 'foo', 'bar' ) );336 $this->assertIsInt( update_metadata( 'post', $post_id, 'foo', 'bar' ) ); 334 337 $this->assertNotFalse( wp_cache_get_last_changed( 'posts' ) ); 335 338 } 336 339 -
tests/phpunit/tests/post/objects.php
30 30 31 31 // Excercise the output argument. 32 32 $post = get_post( $id, ARRAY_A ); 33 $this->assertI nternalType( 'array',$post );33 $this->assertIsArray( $post ); 34 34 $this->assertSame( 'post', $post['post_type'] ); 35 35 36 36 $post = get_post( $id, ARRAY_N ); 37 $this->assertI nternalType( 'array',$post );37 $this->assertIsArray( $post ); 38 38 $this->assertFalse( isset( $post['post_type'] ) ); 39 39 $this->assertTrue( in_array( 'post', $post, true ) ); 40 40 41 41 $post = get_post( $id ); 42 42 $post = get_post( $post, ARRAY_A ); 43 $this->assertI nternalType( 'array',$post );43 $this->assertIsArray( $post ); 44 44 $this->assertSame( 'post', $post['post_type'] ); 45 45 $this->assertSame( $id, $post['ID'] ); 46 46 … … 51 51 52 52 // Make sure stdClass in $GLOBALS['post'] is handled. 53 53 $post_std = $post->to_array(); 54 $this->assertI nternalType( 'array',$post_std );54 $this->assertIsArray( $post_std ); 55 55 $post_std = (object) $post_std; 56 56 $GLOBALS['post'] = $post_std; 57 57 $post = get_post( null ); … … 103 103 */ 104 104 function test_get_post_ancestors_with_falsey_values() { 105 105 foreach ( array( null, 0, false, '0', '' ) as $post_id ) { 106 $this->assertI nternalType( 'array',get_post_ancestors( $post_id ) );106 $this->assertIsArray( get_post_ancestors( $post_id ) ); 107 107 $this->assertSame( array(), get_post_ancestors( $post_id ) ); 108 108 } 109 109 } … … 112 112 $post_id = self::factory()->post->create(); 113 113 $post = get_post( $post_id ); 114 114 115 $this->assertI nternalType( 'array',$post->post_category );115 $this->assertIsArray( $post->post_category ); 116 116 $this->assertSame( 1, count( $post->post_category ) ); 117 117 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 118 118 $term1 = wp_insert_term( 'Foo', 'category' ); … … 131 131 $post_id = self::factory()->post->create(); 132 132 $post = get_post( $post_id ); 133 133 134 $this->assertI nternalType( 'array',$post->tags_input );134 $this->assertIsArray( $post->tags_input ); 135 135 $this->assertEmpty( $post->tags_input ); 136 136 wp_set_post_tags( $post_id, 'Foo, Bar, Baz' ); 137 $this->assertI nternalType( 'array',$post->tags_input );137 $this->assertIsArray( $post->tags_input ); 138 138 $this->assertSame( 3, count( $post->tags_input ) ); 139 139 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input ); 140 140 141 141 $post = get_post( $post_id, ARRAY_A ); 142 $this->assertI nternalType( 'array',$post['tags_input'] );142 $this->assertIsArray( $post['tags_input'] ); 143 143 $this->assertSame( 3, count( $post['tags_input'] ) ); 144 144 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] ); 145 145 } … … 148 148 $post_id = self::factory()->post->create(); 149 149 $post = get_post( $post_id ); 150 150 151 $this->assertI nternalType( 'string',$post->page_template );151 $this->assertIsString( $post->page_template ); 152 152 $template = get_post_meta( $post->ID, '_wp_page_template', true ); 153 153 $this->assertSame( $template, $post->page_template ); 154 154 update_post_meta( $post_id, '_wp_page_template', 'foo.php' ); … … 167 167 ); 168 168 169 169 $this->assertSame( 'raw', $post->filter ); 170 $this->assertI nternalType( 'int',$post->post_parent );170 $this->assertIsInt( $post->post_parent ); 171 171 172 172 $display_post = get_post( $post, OBJECT, 'js' ); 173 173 $this->assertSame( 'js', $display_post->filter ); … … 194 194 foreach ( $contexts as $context ) { 195 195 $post = get_post( $post_id, OBJECT, $context ); 196 196 197 $this->assertI nternalType( 'int',$post->ID );198 $this->assertI nternalType( 'int',$post->post_parent );199 $this->assertI nternalType( 'int',$post->menu_order );197 $this->assertIsInt( $post->ID ); 198 $this->assertIsInt( $post->post_parent ); 199 $this->assertIsInt( $post->menu_order ); 200 200 } 201 201 } 202 202 … … 215 215 $post = get_post( $id, ARRAY_A ); 216 216 217 217 $this->assertSame( $id, $post['ID'] ); 218 $this->assertI nternalType( 'array',$post['ancestors'] );218 $this->assertIsArray( $post['ancestors'] ); 219 219 $this->assertSame( 'raw', $post['filter'] ); 220 220 } 221 221 -
tests/phpunit/tests/post/query.php
737 737 ) 738 738 ); 739 739 740 $this->assertI nternalType( 'int',$q->found_posts );740 $this->assertIsInt( $q->found_posts ); 741 741 } 742 742 743 743 /** … … 756 756 757 757 remove_filter( 'found_posts', '__return_empty_string' ); 758 758 759 $this->assertI nternalType( 'int',$q->found_posts );759 $this->assertIsInt( $q->found_posts ); 760 760 } 761 761 } -
tests/phpunit/tests/post/types.php
321 321 ) 322 322 ); 323 323 324 $this->assertI nternalType( 'int',array_search( 'bar', $wp->public_query_vars, true ) );324 $this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) ); 325 325 $this->assertTrue( unregister_post_type( 'foo' ) ); 326 326 $this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) ); 327 327 } … … 439 439 ) 440 440 ); 441 441 442 $this->assertI nternalType( 'int',array_search( 'foo', $wp_taxonomies['category']->object_type, true ) );443 $this->assertI nternalType( 'int',array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) );442 $this->assertIsInt( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) ); 443 $this->assertIsInt( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) ); 444 444 $this->assertTrue( unregister_post_type( 'foo' ) ); 445 445 $this->assertFalse( array_search( 'foo', $wp_taxonomies['category']->object_type, true ) ); 446 446 $this->assertFalse( array_search( 'foo', $wp_taxonomies['post_tag']->object_type, true ) ); … … 499 499 ) 500 500 ); 501 501 502 $this->assertI nternalType( 'object',$wp_post_types['foo'] );503 $this->assertI nternalType( 'object',get_post_type_object( 'foo' ) );502 $this->assertIsObject( $wp_post_types['foo'] ); 503 $this->assertIsObject( get_post_type_object( 'foo' ) ); 504 504 505 505 $this->assertTrue( unregister_post_type( 'foo' ) ); 506 506 -
tests/phpunit/tests/query/results.php
765 765 $this->assertSame( $children, $posts2 ); 766 766 767 767 foreach ( $this->q->posts as $post ) { 768 $this->assertI nternalType( 'int',$post->ID );769 $this->assertI nternalType( 'int',$post->post_parent );768 $this->assertIsInt( $post->ID ); 769 $this->assertIsInt( $post->post_parent ); 770 770 } 771 771 772 772 } -
tests/phpunit/tests/rest-api/rest-attachments-controller.php
658 658 $original_image_src = wp_get_attachment_image_src( $attachment_id, 'full' ); 659 659 remove_image_size( 'rest-api-test' ); 660 660 661 $this->assertI nternalType( 'array',$data['media_details']['sizes'], 'Could not retrieve the sizes data.' );661 $this->assertIsArray( $data['media_details']['sizes'], 'Could not retrieve the sizes data.' ); 662 662 $this->assertSame( $image_src[0], $data['media_details']['sizes']['rest-api-test']['source_url'] ); 663 663 $this->assertSame( 'image/jpeg', $data['media_details']['sizes']['rest-api-test']['mime_type'] ); 664 664 $this->assertSame( $original_image_src[0], $data['media_details']['sizes']['full']['source_url'] ); … … 690 690 remove_filter( 'wp_get_attachment_image_src', '__return_false' ); 691 691 remove_image_size( 'rest-api-test' ); 692 692 693 $this->assertI nternalType( 'array',$data['media_details']['sizes'], 'Could not retrieve the sizes data.' );693 $this->assertIsArray( $data['media_details']['sizes'], 'Could not retrieve the sizes data.' ); 694 694 $this->assertFalse( isset( $data['media_details']['sizes']['rest-api-test']['source_url'] ) ); 695 695 } 696 696 -
tests/phpunit/tests/rest-api/rest-comments-controller.php
2903 2903 $actual_output = $response->get_data(); 2904 2904 2905 2905 // Compare expected API output to actual API output. 2906 $this->assertI nternalType( 'array',$actual_output['content'] );2906 $this->assertIsArray( $actual_output['content'] ); 2907 2907 $this->assertArrayHasKey( 'raw', $actual_output['content'] ); 2908 2908 $this->assertSame( $expected_output['content']['raw'], $actual_output['content']['raw'] ); 2909 2909 $this->assertSame( $expected_output['content']['rendered'], trim( $actual_output['content']['rendered'] ) ); -
tests/phpunit/tests/rest-api/rest-post-meta-fields.php
290 290 $data = $response->get_data(); 291 291 $meta = (array) $data['meta']; 292 292 $this->assertArrayHasKey( 'test_multi', $meta ); 293 $this->assertI nternalType( 'array',$meta['test_multi'] );293 $this->assertIsArray( $meta['test_multi'] ); 294 294 $this->assertContains( 'value1', $meta['test_multi'] ); 295 295 296 296 // Check after an update. … … 395 395 $meta = (array) $data['meta']; 396 396 397 397 $this->assertArrayHasKey( 'test_string', $meta ); 398 $this->assertI nternalType( 'string',$meta['test_string'] );398 $this->assertIsString( $meta['test_string'] ); 399 399 $this->assertSame( '42', $meta['test_string'] ); 400 400 401 401 $this->assertArrayHasKey( 'test_number', $meta ); 402 $this->assertI nternalType( 'float',$meta['test_number'] );402 $this->assertIsFloat( $meta['test_number'] ); 403 403 $this->assertSame( 42.0, $meta['test_number'] ); 404 404 405 405 $this->assertArrayHasKey( 'test_bool', $meta ); 406 $this->assertI nternalType( 'boolean',$meta['test_bool'] );406 $this->assertIsBool( $meta['test_bool'] ); 407 407 $this->assertTrue( $meta['test_bool'] ); 408 408 } 409 409 … … 1272 1272 $data = $response->get_data(); 1273 1273 1274 1274 $this->assertArrayHasKey( 'meta', $data ); 1275 $this->assertI nternalType( 'array',$data['meta'] );1275 $this->assertIsArray( $data['meta'] ); 1276 1276 1277 1277 if ( $in_post_type ) { 1278 1278 $expected_value = $meta_value; … … 1338 1338 1339 1339 $data = $response->get_data(); 1340 1340 $this->assertArrayHasKey( 'meta', $data ); 1341 $this->assertI nternalType( 'array',$data['meta'] );1341 $this->assertIsArray( $data['meta'] ); 1342 1342 1343 1343 if ( $in_post_type ) { 1344 1344 $expected_value = $meta_value; -
tests/phpunit/tests/rest-api/rest-request.php
491 491 $this->assertWPError( $valid ); 492 492 $data = $valid->get_error_data(); 493 493 494 $this->assertI nternalType( 'array',$data );494 $this->assertIsArray( $data ); 495 495 $this->assertArrayHasKey( 'params', $data ); 496 496 $this->assertArrayHasKey( 'failparam', $data['params'] ); 497 497 $this->assertSame( 'Invalid. Super Invalid. Broken.', $data['params']['failparam'] ); … … 754 754 $this->assertWPError( $valid ); 755 755 $data = $valid->get_error_data(); 756 756 757 $this->assertI nternalType( 'array',$data );757 $this->assertIsArray( $data ); 758 758 $this->assertArrayHasKey( 'params', $data ); 759 759 $this->assertArrayHasKey( 'failparam', $data['params'] ); 760 760 $this->assertSame( 'Invalid. Super Invalid. Broken.', $data['params']['failparam'] ); -
tests/phpunit/tests/rest-api/rest-server.php
545 545 $this->assertCount( 2, $alternate ); 546 546 $this->assertEmpty( $alternate[0] ); 547 547 548 $this->assertI nternalType( 'array',$alternate[1] );548 $this->assertIsArray( $alternate[1] ); 549 549 $this->assertArrayNotHasKey( 'code', $alternate[1] ); 550 550 $this->assertTrue( $alternate[1]['hello'] ); 551 551 -
tests/phpunit/tests/rest-api/rest-term-meta-fields.php
237 237 $data = $response->get_data(); 238 238 $meta = (array) $data['meta']; 239 239 $this->assertArrayHasKey( 'test_multi', $meta ); 240 $this->assertI nternalType( 'array',$meta['test_multi'] );240 $this->assertIsArray( $meta['test_multi'] ); 241 241 $this->assertContains( 'value1', $meta['test_multi'] ); 242 242 243 243 // Check after an update. … … 342 342 $meta = (array) $data['meta']; 343 343 344 344 $this->assertArrayHasKey( 'test_string', $meta ); 345 $this->assertI nternalType( 'string',$meta['test_string'] );345 $this->assertIsString( $meta['test_string'] ); 346 346 $this->assertSame( '42', $meta['test_string'] ); 347 347 348 348 $this->assertArrayHasKey( 'test_number', $meta ); 349 $this->assertI nternalType( 'float',$meta['test_number'] );349 $this->assertIsFloat( $meta['test_number'] ); 350 350 $this->assertSame( 42.0, $meta['test_number'] ); 351 351 352 352 $this->assertArrayHasKey( 'test_bool', $meta ); 353 $this->assertI nternalType( 'boolean',$meta['test_bool'] );353 $this->assertIsBool( $meta['test_bool'] ); 354 354 $this->assertTrue( $meta['test_bool'] ); 355 355 } 356 356 … … 1157 1157 $data = $response->get_data(); 1158 1158 1159 1159 $this->assertArrayHasKey( 'meta', $data ); 1160 $this->assertI nternalType( 'array',$data['meta'] );1160 $this->assertIsArray( $data['meta'] ); 1161 1161 1162 1162 if ( $in_taxonomy ) { 1163 1163 $expected_value = $meta_value; … … 1221 1221 1222 1222 $data = $response->get_data(); 1223 1223 $this->assertArrayHasKey( 'meta', $data ); 1224 $this->assertI nternalType( 'array',$data['meta'] );1224 $this->assertIsArray( $data['meta'] ); 1225 1225 1226 1226 if ( $in_taxonomy ) { 1227 1227 $expected_value = $meta_value; -
tests/phpunit/tests/rest-api/rest-users-controller.php
1211 1211 $data = $response->get_data(); 1212 1212 1213 1213 if ( is_multisite() ) { 1214 $this->assertI nternalType( 'array',$data['additional_errors'] );1214 $this->assertIsArray( $data['additional_errors'] ); 1215 1215 $this->assertCount( 1, $data['additional_errors'] ); 1216 1216 $error = $data['additional_errors'][0]; 1217 1217 $this->assertSame( 'user_name', $error['code'] ); 1218 1218 $this->assertSame( 'Usernames can only contain lowercase letters (a-z) and numbers.', $error['message'] ); 1219 1219 } else { 1220 $this->assertI nternalType( 'array',$data['data']['params'] );1220 $this->assertIsArray( $data['data']['params'] ); 1221 1221 $errors = $data['data']['params']; 1222 $this->assertI nternalType( 'string',$errors['username'] );1222 $this->assertIsString( $errors['username'] ); 1223 1223 $this->assertSame( 'This username is invalid because it uses illegal characters. Please enter a valid username.', $errors['username'] ); 1224 1224 } 1225 1225 } … … 1257 1257 $this->assertErrorResponse( 'rest_invalid_param', $response, 400 ); 1258 1258 1259 1259 $data = $response->get_data(); 1260 $this->assertI nternalType( 'array',$data['data']['params'] );1260 $this->assertIsArray( $data['data']['params'] ); 1261 1261 $errors = $data['data']['params']; 1262 $this->assertI nternalType( 'string',$errors['username'] );1262 $this->assertIsString( $errors['username'] ); 1263 1263 $this->assertSame( 'Sorry, that username is not allowed.', $errors['username'] ); 1264 1264 } 1265 1265 … … 1381 1381 1382 1382 $this->assertErrorResponse( 'rest_invalid_param', $switched_response, 400 ); 1383 1383 $data = $switched_response->get_data(); 1384 $this->assertI nternalType( 'array',$data['additional_errors'] );1384 $this->assertIsArray( $data['additional_errors'] ); 1385 1385 $this->assertCount( 2, $data['additional_errors'] ); 1386 1386 $errors = $data['additional_errors']; 1387 1387 foreach ( $errors as $error ) { -
tests/phpunit/tests/rewrite.php
482 482 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 483 483 484 484 $rewrite_rules = get_option( 'rewrite_rules' ); 485 $this->assertI nternalType( 'array',$rewrite_rules );485 $this->assertIsArray( $rewrite_rules ); 486 486 $this->assertNotEmpty( $rewrite_rules ); 487 487 } 488 488 } -
tests/phpunit/tests/rewrite/permastructs.php
34 34 global $wp_rewrite; 35 35 36 36 add_permastruct( 'foo', 'bar/%foo%' ); 37 $this->assertI nternalType( 'array',$wp_rewrite->extra_permastructs['foo'] );37 $this->assertIsArray( $wp_rewrite->extra_permastructs['foo'] ); 38 38 $this->assertSame( '/bar/%foo%', $wp_rewrite->extra_permastructs['foo']['struct'] ); 39 39 40 40 remove_permastruct( 'foo' ); -
tests/phpunit/tests/taxonomy.php
818 818 819 819 register_taxonomy( 'foo', 'post', array( 'query_var' => 'bar' ) ); 820 820 821 $this->assertI nternalType( 'int',array_search( 'bar', $wp->public_query_vars, true ) );821 $this->assertIsInt( array_search( 'bar', $wp->public_query_vars, true ) ); 822 822 $this->assertTrue( unregister_taxonomy( 'foo' ) ); 823 823 $this->assertFalse( array_search( 'bar', $wp->public_query_vars, true ) ); 824 824 } … … 840 840 ) 841 841 ); 842 842 843 $this->assertI nternalType( 'array',$wp_rewrite->extra_permastructs['foo'] );843 $this->assertIsArray( $wp_rewrite->extra_permastructs['foo'] ); 844 844 $this->assertTrue( unregister_taxonomy( 'foo' ) ); 845 845 $this->assertFalse( isset( $wp_rewrite->extra_permastructs['foo'] ) ); 846 846 } … … 873 873 874 874 register_taxonomy( 'foo', 'post' ); 875 875 876 $this->assertI nternalType( 'object',$wp_taxonomies['foo'] );877 $this->assertI nternalType( 'object',get_taxonomy( 'foo' ) );876 $this->assertIsObject( $wp_taxonomies['foo'] ); 877 $this->assertIsObject( get_taxonomy( 'foo' ) ); 878 878 879 879 $this->assertTrue( unregister_taxonomy( 'foo' ) ); 880 880 -
tests/phpunit/tests/taxonomy/getObjectTaxonomies.php
36 36 $found = get_object_taxonomies( 'wptests_pt', 'objects' ); 37 37 38 38 $this->assertSame( array( 'wptests_tax' ), array_keys( $found ) ); 39 $this->assertI nternalType( 'object',$found['wptests_tax'] );39 $this->assertIsObject( $found['wptests_tax'] ); 40 40 $this->assertSame( 'wptests_tax', $found['wptests_tax']->name ); 41 41 } 42 42 … … 87 87 $found = get_object_taxonomies( $attachment, 'objects' ); 88 88 89 89 $this->assertSame( array( 'wptests_tax2' ), array_keys( $found ) ); 90 $this->assertI nternalType( 'object',$found['wptests_tax2'] );90 $this->assertIsObject( $found['wptests_tax2'] ); 91 91 $this->assertSame( 'wptests_tax2', $found['wptests_tax2']->name ); 92 92 } 93 93 } -
tests/phpunit/tests/term.php
53 53 // Insert a term. 54 54 $term = rand_str(); 55 55 $t = wp_insert_term( $term, $this->taxonomy ); 56 $this->assertI nternalType( 'array',$t );56 $this->assertIsArray( $t ); 57 57 $term_obj = get_term_by( 'name', $term, $this->taxonomy ); 58 58 $this->assertEquals( $t['term_id'], term_exists( $term_obj->slug ) ); 59 59 … … 132 132 $term2 = rand_str(); 133 133 134 134 $t = wp_insert_term( $term, 'category' ); 135 $this->assertI nternalType( 'array',$t );135 $this->assertIsArray( $t ); 136 136 $t2 = wp_insert_term( $term, 'category', array( 'parent' => $t['term_id'] ) ); 137 $this->assertI nternalType( 'array',$t2 );137 $this->assertIsArray( $t2 ); 138 138 if ( function_exists( 'term_is_ancestor_of' ) ) { 139 139 $this->assertTrue( term_is_ancestor_of( $t['term_id'], $t2['term_id'], 'category' ) ); 140 140 $this->assertFalse( term_is_ancestor_of( $t2['term_id'], $t['term_id'], 'category' ) ); … … 176 176 $post_id = self::$post_ids[0]; 177 177 $post = get_post( $post_id ); 178 178 179 $this->assertI nternalType( 'array',$post->post_category );179 $this->assertIsArray( $post->post_category ); 180 180 $this->assertSame( 1, count( $post->post_category ) ); 181 181 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 182 182 -
tests/phpunit/tests/term/getTerm.php
97 97 98 98 public function test_output_object() { 99 99 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 100 $this->assertI nternalType( 'object',get_term( $t, 'wptests_tax', OBJECT ) );100 $this->assertIsObject( get_term( $t, 'wptests_tax', OBJECT ) ); 101 101 } 102 102 103 103 public function test_output_array_a() { 104 104 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 105 105 $term = get_term( $t, 'wptests_tax', ARRAY_A ); 106 $this->assertI nternalType( 'array',$term );106 $this->assertIsArray( $term ); 107 107 $this->assertTrue( isset( $term['term_id'] ) ); 108 108 } 109 109 … … 110 110 public function test_output_array_n() { 111 111 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 112 112 $term = get_term( $t, 'wptests_tax', ARRAY_N ); 113 $this->assertI nternalType( 'array',$term );113 $this->assertIsArray( $term ); 114 114 $this->assertFalse( isset( $term['term_id'] ) ); 115 115 foreach ( $term as $k => $v ) { 116 $this->assertI nternalType( 'integer',$k );116 $this->assertIsInt( $k ); 117 117 } 118 118 } 119 119 120 120 public function test_output_should_fall_back_to_object_for_invalid_input() { 121 121 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 122 $this->assertI nternalType( 'object',get_term( $t, 'wptests_tax', 'foo' ) );122 $this->assertIsObject( get_term( $t, 'wptests_tax', 'foo' ) ); 123 123 } 124 124 125 125 /** … … 140 140 $found = get_term( $term_data, '', OBJECT, $context ); 141 141 142 142 $this->assertInstanceOf( 'WP_Term', $found ); 143 $this->assertI nternalType( 'int',$found->term_id );144 $this->assertI nternalType( 'int',$found->term_taxonomy_id );145 $this->assertI nternalType( 'int',$found->parent );146 $this->assertI nternalType( 'int',$found->count );147 $this->assertI nternalType( 'int',$found->term_group );143 $this->assertIsInt( $found->term_id ); 144 $this->assertIsInt( $found->term_taxonomy_id ); 145 $this->assertIsInt( $found->parent ); 146 $this->assertIsInt( $found->count ); 147 $this->assertIsInt( $found->term_group ); 148 148 } 149 149 } 150 150 -
tests/phpunit/tests/term/getTerms.php
861 861 $term = get_term( $term['term_id'], 'category' ); 862 862 863 863 $this->assertSame( $term->term_id, $term->parent ); 864 $this->assertI nternalType( 'array',get_term_children( $term->term_id, 'category' ) );864 $this->assertIsArray( get_term_children( $term->term_id, 'category' ) ); 865 865 866 866 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); 867 867 } -
tests/phpunit/tests/term/getTheTerms.php
39 39 // get_the_terms() does prime the cache. 40 40 $terms = get_the_terms( $post_id, $this->taxonomy ); 41 41 $cache = wp_cache_get( $post_id, $this->taxonomy . '_relationships' ); 42 $this->assertI nternalType( 'array',$cache );42 $this->assertIsArray( $cache ); 43 43 44 44 // Cache should be empty after a set. 45 45 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); -
tests/phpunit/tests/term/meta.php
94 94 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 95 95 96 96 $actual = update_term_meta( $t, 'foo', 'bar' ); 97 $this->assertI nternalType( 'int',$actual );97 $this->assertIsInt( $actual ); 98 98 $this->assertNotEmpty( $actual ); 99 99 100 100 $meta = get_term_meta( $t, 'foo', true ); … … 549 549 550 550 wp_cache_delete( 'last_changed', 'terms' ); 551 551 552 $this->assertI nternalType( 'integer',add_metadata( 'term', $term_id, 'foo', 'bar' ) );552 $this->assertIsInt( add_metadata( 'term', $term_id, 'foo', 'bar' ) ); 553 553 $this->assertNotFalse( wp_cache_get_last_changed( 'terms' ) ); 554 554 } 555 555 … … 561 561 562 562 wp_cache_delete( 'last_changed', 'terms' ); 563 563 564 $this->assertI nternalType( 'integer',update_metadata( 'term', $term_id, 'foo', 'bar' ) );564 $this->assertIsInt( update_metadata( 'term', $term_id, 'foo', 'bar' ) ); 565 565 $this->assertNotFalse( wp_cache_get_last_changed( 'terms' ) ); 566 566 } 567 567 -
tests/phpunit/tests/term/termExists.php
116 116 117 117 _unregister_taxonomy( 'foo' ); 118 118 119 $this->assertI nternalType( 'array',$found );119 $this->assertIsArray( $found ); 120 120 $this->assertEquals( $t, $found['term_id'] ); 121 121 } 122 122 … … 180 180 181 181 _unregister_taxonomy( 'foo' ); 182 182 183 $this->assertI nternalType( 'array',$found );183 $this->assertIsArray( $found ); 184 184 $this->assertEquals( $t, $found['term_id'] ); 185 185 } 186 186 … … 198 198 199 199 _unregister_taxonomy( 'foo' ); 200 200 201 $this->assertI nternalType( 'array',$found );201 $this->assertIsArray( $found ); 202 202 $this->assertEquals( $t, $found['term_id'] ); 203 203 } 204 204 … … 216 216 217 217 _unregister_taxonomy( 'foo' ); 218 218 219 $this->assertI nternalType( 'array',$found );219 $this->assertIsArray( $found ); 220 220 $this->assertEquals( $t, $found['term_id'] ); 221 221 } 222 222 … … 234 234 235 235 _unregister_taxonomy( 'foo' ); 236 236 237 $this->assertI nternalType( 'string',$found );237 $this->assertIsString( $found ); 238 238 $this->assertEquals( $t, $found ); 239 239 } 240 240 … … 252 252 253 253 _unregister_taxonomy( 'foo' ); 254 254 255 $this->assertI nternalType( 'string',$found );255 $this->assertIsString( $found ); 256 256 $this->assertEquals( $t, $found ); 257 257 } 258 258 … … 262 262 // Insert a term. 263 263 $term = rand_str(); 264 264 $t = wp_insert_term( $term, 'wptests_tax' ); 265 $this->assertI nternalType( 'array',$t );265 $this->assertIsArray( $t ); 266 266 $this->assertEquals( $t['term_id'], term_exists( $t['term_id'] ) ); 267 267 $this->assertEquals( $t['term_id'], term_exists( $term ) ); 268 268 -
tests/phpunit/tests/term/wpGenerateTagCloud.php
106 106 ) 107 107 ); 108 108 109 $this->assertI nternalType( 'array',$found );109 $this->assertIsArray( $found ); 110 110 $this->assertContains( '>' . $tags[0]->name . '<', $found[0] ); 111 111 } 112 112 -
tests/phpunit/tests/term/wpGetObjectTerms.php
73 73 $term = array_shift( $terms ); 74 74 $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' ); 75 75 foreach ( $int_fields as $field ) { 76 $this->assertI nternalType( 'int',$term->$field, $field );76 $this->assertIsInt( $term->$field, $field ); 77 77 } 78 78 79 79 $terms = wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'ids' ) ); 80 80 $term = array_shift( $terms ); 81 $this->assertI nternalType( 'int',$term, 'term' );81 $this->assertIsInt( $term, 'term' ); 82 82 } 83 83 84 84 /** … … 93 93 $terms = wp_get_object_terms( $post_id, $this->taxonomy ); 94 94 remove_filter( 'wp_get_object_terms', array( $this, 'filter_get_object_terms' ) ); 95 95 foreach ( $terms as $term ) { 96 $this->assertI nternalType( 'object',$term );96 $this->assertIsObject( $term ); 97 97 } 98 98 } 99 99 -
tests/phpunit/tests/term/wpInsertTerm.php
27 27 $initial_count = wp_count_terms( array( 'taxonomy' => $taxonomy ) ); 28 28 29 29 $t = wp_insert_term( $term, $taxonomy ); 30 $this->assertI nternalType( 'array',$t );30 $this->assertIsArray( $t ); 31 31 $this->assertNotWPError( $t ); 32 32 $this->assertTrue( $t['term_id'] > 0 ); 33 33 $this->assertTrue( $t['term_taxonomy_id'] > 0 ); … … 776 776 777 777 _unregister_taxonomy( 'wptests_tax' ); 778 778 779 $this->assertI nternalType( 'array',$found );779 $this->assertIsArray( $found ); 780 780 $this->assertNotEmpty( $found['term_id'] ); 781 781 $this->assertNotEmpty( $found['term_taxonomy_id'] ); 782 782 $this->assertNotEmpty( $term_by_id ); … … 844 844 ) 845 845 ); 846 846 847 $this->assertI nternalType( 'int',$t1 );848 $this->assertI nternalType( 'int',$t2 );847 $this->assertIsInt( $t1 ); 848 $this->assertIsInt( $t2 ); 849 849 $this->assertNotEquals( $t1, $t2 ); 850 850 851 851 $term_2 = get_term( $t2, 'wptests_tax' ); … … 900 900 /** Helpers */ 901 901 902 902 public function deleted_term_cb( $term, $tt_id, $taxonomy, $deleted_term, $object_ids ) { 903 $this->assertI nternalType( 'object',$deleted_term );904 $this->assertI nternalType( 'int',$term );905 $this->assertI nternalType( 'array',$object_ids );906 // Pesky string $this->assertI nternalType( 'int',$tt_id );903 $this->assertIsObject( $deleted_term ); 904 $this->assertIsInt( $term ); 905 $this->assertIsArray( $object_ids ); 906 // Pesky string $this->assertIsInt( $tt_id ); 907 907 $this->assertSame( $term, $deleted_term->term_id ); 908 908 $this->assertSame( $taxonomy, $deleted_term->taxonomy ); 909 909 $this->assertEquals( $tt_id, $deleted_term->term_taxonomy_id ); -
tests/phpunit/tests/term/wpSetObjectTerms.php
106 106 for ( $i = 0; $i < 3; $i++ ) { 107 107 $term = "term_{$i}"; 108 108 $result = wp_insert_term( $term, $this->taxonomy ); 109 $this->assertI nternalType( 'array',$result );109 $this->assertIsArray( $result ); 110 110 $term_id[ $term ] = $result['term_id']; 111 111 } 112 112 … … 254 254 for ( $i = 0; $i < 3; $i++ ) { 255 255 $term = "term_{$i}"; 256 256 $result = wp_insert_term( $term, $this->taxonomy ); 257 $this->assertI nternalType( 'array',$result );257 $this->assertIsArray( $result ); 258 258 $terms_1[ $i ] = $result['term_id']; 259 259 } 260 260 -
tests/phpunit/tests/term/wpUpdateTerm.php
612 612 613 613 _unregister_taxonomy( 'wptests_tax' ); 614 614 615 $this->assertI nternalType( 'array',$found );615 $this->assertIsArray( $found ); 616 616 $this->assertNotEmpty( $found['term_id'] ); 617 617 $this->assertNotEmpty( $found['term_taxonomy_id'] ); 618 618 $this->assertNotEmpty( $term_by_id ); … … 638 638 ) 639 639 ); 640 640 641 $this->assertI nternalType( 'int',$found['term_id'] );642 $this->assertI nternalType( 'int',$found['term_taxonomy_id'] );641 $this->assertIsInt( $found['term_id'] ); 642 $this->assertIsInt( $found['term_taxonomy_id'] ); 643 643 } 644 644 645 645 public function test_wp_update_term_should_clean_term_cache() { -
tests/phpunit/tests/theme/getThemeStarterContent.php
142 142 $this->assertSame( $dehydrated_starter_content['attachments']['featured-image-logo'], $hydrated_starter_content['attachments']['featured-image-logo'] ); 143 143 144 144 foreach ( $hydrated_starter_content['widgets']['sidebar-1'] as $widget ) { 145 $this->assertI nternalType( 'array',$widget );145 $this->assertIsArray( $widget ); 146 146 $this->assertCount( 2, $widget ); 147 $this->assertI nternalType( 'string',$widget[0] );148 $this->assertI nternalType( 'array',$widget[1] );147 $this->assertIsString( $widget[0] ); 148 $this->assertIsArray( $widget[1] ); 149 149 $this->assertArrayHasKey( 'title', $widget[1] ); 150 150 } 151 151 $this->assertSame( 'text', $hydrated_starter_content['widgets']['sidebar-1'][1][0], 'Core content extended' ); … … 152 152 $this->assertSame( 'Our Story', $hydrated_starter_content['widgets']['sidebar-1'][1][1]['title'], 'Core content extended' ); 153 153 154 154 foreach ( $hydrated_starter_content['nav_menus']['top']['items'] as $nav_menu_item ) { 155 $this->assertI nternalType( 'array',$nav_menu_item );155 $this->assertIsArray( $nav_menu_item ); 156 156 $this->assertTrue( ! empty( $nav_menu_item['object_id'] ) || ! empty( $nav_menu_item['url'] ) ); 157 157 } 158 158 $this->assertSame( 'Email Us', $hydrated_starter_content['nav_menus']['top']['items'][4]['title'], 'Core content extended' ); 159 159 160 160 foreach ( $hydrated_starter_content['posts'] as $key => $post ) { 161 $this->assertI nternalType( 'string',$key );161 $this->assertIsString( $key ); 162 162 $this->assertFalse( is_numeric( $key ) ); 163 $this->assertI nternalType( 'array',$post );163 $this->assertIsArray( $post ); 164 164 $this->assertArrayHasKey( 'post_type', $post ); 165 165 $this->assertArrayHasKey( 'post_title', $post ); 166 166 } … … 200 200 * @return array Filtered starter content. 201 201 */ 202 202 public function filter_theme_starter_content( $content, $config ) { 203 $this->assertI nternalType( 'array',$config );203 $this->assertIsArray( $config ); 204 204 $this->assertCount( 1, $config['widgets']['sidebar-1'] ); 205 205 $content['widgets']['sidebar-1'][] = array( 206 206 'text', -
tests/phpunit/tests/user.php
216 216 $user->filter = $context; 217 217 $user->init( $user->data ); 218 218 219 $this->assertI nternalType( 'int',$user->ID );219 $this->assertIsInt( $user->ID ); 220 220 } 221 221 } 222 222 … … 870 870 ) 871 871 ); 872 872 873 $this->assertI nternalType( 'int',$u );873 $this->assertIsInt( $u ); 874 874 $this->assertGreaterThan( 0, $u ); 875 875 876 876 $user = new WP_User( $u ); … … 1493 1493 $user_id = edit_user(); 1494 1494 $user = get_user_by( 'ID', $user_id ); 1495 1495 1496 $this->assertI nternalType( 'int',$user_id );1496 $this->assertIsInt( $user_id ); 1497 1497 $this->assertInstanceOf( 'WP_User', $user ); 1498 1498 $this->assertSame( 'nickname1', $user->nickname ); 1499 1499 … … 1504 1504 1505 1505 $user_id = edit_user( $user_id ); 1506 1506 1507 $this->assertI nternalType( 'int',$user_id );1507 $this->assertIsInt( $user_id ); 1508 1508 $this->assertSame( 'nickname_updated', $user->nickname ); 1509 1509 1510 1510 // Check not to change an old password if a new password contains only spaces. Ticket #42766. … … 1516 1516 $user_id = edit_user( $user_id ); 1517 1517 $user = get_user_by( 'ID', $user_id ); 1518 1518 1519 $this->assertI nternalType( 'int',$user_id );1519 $this->assertIsInt( $user_id ); 1520 1520 $this->assertSame( $old_pass, $user->user_pass ); 1521 1521 1522 1522 // Check updating user with missing second password. … … 1535 1535 $user_id = edit_user( $user_id ); 1536 1536 remove_action( 'check_passwords', array( $this, 'action_check_passwords_blank_password' ) ); 1537 1537 1538 $this->assertI nternalType( 'int',$user_id );1538 $this->assertIsInt( $user_id ); 1539 1539 $this->assertSame( 'nickname_updated2', $user->nickname ); 1540 1540 } 1541 1541 -
tests/phpunit/tests/user/multisite.php
124 124 125 125 $blog_id = self::factory()->blog->create( array( 'user_id' => get_current_user_id() ) ); 126 126 127 $this->assertI nternalType( 'int',$blog_id );127 $this->assertIsInt( $blog_id ); 128 128 $this->assertTrue( is_blog_user( $blog_id ) ); 129 129 $this->assertTrue( remove_user_from_blog( $user1_id, $blog_id ) ); 130 130 $this->assertFalse( is_blog_user( $blog_id ) ); … … 156 156 157 157 $blog_id = self::factory()->blog->create( array( 'user_id' => get_current_user_id() ) ); 158 158 159 $this->assertI nternalType( 'int',$blog_id );159 $this->assertIsInt( $blog_id ); 160 160 161 161 // Current user gets added to new blogs. 162 162 $this->assertTrue( is_user_member_of_blog( $user1_id, $blog_id ) ); -
tests/phpunit/tests/widgets.php
624 624 $this->assertSame( 1, $option_value['_multiwidget'] ); 625 625 $this->assertArrayHasKey( 2, $option_value ); 626 626 $instance = $option_value[2]; 627 $this->assertI nternalType( 'array',$instance );627 $this->assertIsArray( $instance ); 628 628 $this->assertArrayHasKey( 'content', $instance ); 629 629 unset( $option_value['_multiwidget'] ); 630 630 … … 875 875 876 876 $result = retrieve_widgets( true ); 877 877 878 $this->assertI nternalType( 'array',$result );878 $this->assertIsArray( $result ); 879 879 $this->assertSame( $result, $sidebars_widgets ); 880 880 881 881 foreach ( $sidebars_widgets as $widgets ) { 882 $this->assertI nternalType( 'array',$widgets );882 $this->assertIsArray( $widgets ); 883 883 } 884 884 885 885 $this->assertContains( 'tag_cloud-1', $sidebars_widgets['sidebar-1'] ); … … 924 924 $result = retrieve_widgets( true ); 925 925 926 926 // $sidebars_widgets matches registered sidebars. 927 $this->assertI nternalType( 'array',$result );927 $this->assertIsArray( $result ); 928 928 $this->assertSame( $result, $sidebars_widgets ); 929 929 930 930 foreach ( $sidebars_widgets as $widgets ) { 931 $this->assertI nternalType( 'array',$widgets );931 $this->assertIsArray( $widgets ); 932 932 } 933 933 934 934 $this->assertContains( 'tag_cloud-1', $sidebars_widgets['sidebar-1'] ); … … 963 963 $result = retrieve_widgets( true ); 964 964 965 965 $_wp_sidebars_widgets = array(); 966 $this->assertI nternalType( 'array',$result );966 $this->assertIsArray( $result ); 967 967 $this->assertSame( $result, $sidebars_widgets ); 968 968 969 969 foreach ( $sidebars_widgets as $widgets ) { 970 $this->assertI nternalType( 'array',$widgets );970 $this->assertIsArray( $widgets ); 971 971 } 972 972 973 973 // Current theme doesn't have a fantasy-sidebar. … … 1005 1005 $result = retrieve_widgets(); 1006 1006 1007 1007 $_wp_sidebars_widgets = array(); 1008 $this->assertI nternalType( 'array',$result );1008 $this->assertIsArray( $result ); 1009 1009 $this->assertSame( $result, $sidebars_widgets ); 1010 1010 1011 1011 foreach ( $sidebars_widgets as $widgets ) { 1012 $this->assertI nternalType( 'array',$widgets );1012 $this->assertIsArray( $widgets ); 1013 1013 } 1014 1014 1015 1015 // This sidebar is not registered anymore. … … 1056 1056 $result = retrieve_widgets( 'customize' ); 1057 1057 1058 1058 $_wp_sidebars_widgets = array(); 1059 $this->assertI nternalType( 'array',$result );1059 $this->assertIsArray( $result ); 1060 1060 $this->assertSame( $result, $sidebars_widgets ); 1061 1061 1062 1062 foreach ( $sidebars_widgets as $widgets ) { 1063 $this->assertI nternalType( 'array',$widgets );1063 $this->assertIsArray( $widgets ); 1064 1064 } 1065 1065 1066 1066 $this->assertContains( 'tag_cloud-1', $sidebars_widgets['sidebar-1'] ); … … 1124 1124 1125 1125 retrieve_widgets(); 1126 1126 1127 $this->assertI nternalType( 'array',$sidebars_widgets );1127 $this->assertIsArray( $sidebars_widgets ); 1128 1128 1129 1129 foreach ( $sidebars_widgets as $widgets ) { 1130 $this->assertI nternalType( 'array',$widgets );1130 $this->assertIsArray( $widgets ); 1131 1131 } 1132 1132 1133 1133 // 5 default widgets + 1 orphaned calendar widget = 6. … … 1157 1157 1158 1158 $filtered_widgets = _wp_remove_unregistered_widgets( $widgets, $allowed_widgets ); 1159 1159 1160 $this->assertI nternalType( 'array',$filtered_widgets );1160 $this->assertIsArray( $filtered_widgets ); 1161 1161 $this->assertArrayHasKey( 'fantasy', $filtered_widgets ); 1162 1162 $this->assertEmpty( $filtered_widgets['fantasy'] ); 1163 1163 $this->assertArrayHasKey( 'array_version', $filtered_widgets ); 1164 1164 $this->assertSame( 3, $filtered_widgets['array_version'] ); 1165 $this->assertI nternalType( 'integer',$filtered_widgets['array_version'] );1165 $this->assertIsInt( $filtered_widgets['array_version'] ); 1166 1166 } 1167 1167 1168 1168 /** -
tests/phpunit/tests/widgets/media-widget.php
219 219 $this->filter_instance_schema_args = null; 220 220 add_filter( 'widget_mocked_instance_schema', array( $this, 'filter_instance_schema' ), 10, 2 ); 221 221 $schema = $widget->get_instance_schema(); 222 $this->assertI nternalType( 'array',$this->filter_instance_schema_args );222 $this->assertIsArray( $this->filter_instance_schema_args ); 223 223 $this->assertSame( $widget, $this->filter_instance_schema_args['widget'] ); 224 224 $this->assertSameSets( array( 'attachment_id', 'title', 'url' ), array_keys( $this->filter_instance_schema_args['schema'] ) ); 225 225 $this->assertArrayHasKey( 'injected', $schema ); -
tests/phpunit/tests/xmlrpc/mw/getPost.php
52 52 $this->assertNotIXRError( $result ); 53 53 54 54 // Check data types. 55 $this->assertI nternalType( 'string',$result['userid'] );56 $this->assertI nternalType( 'int',$result['postid'] );57 $this->assertI nternalType( 'string',$result['description'] );58 $this->assertI nternalType( 'string',$result['title'] );59 $this->assertI nternalType( 'string',$result['link'] );60 $this->assertI nternalType( 'string',$result['permaLink'] );61 $this->assertI nternalType( 'array',$result['categories'] );62 $this->assertI nternalType( 'string',$result['mt_excerpt'] );63 $this->assertI nternalType( 'string',$result['mt_text_more'] );64 $this->assertI nternalType( 'string',$result['wp_more_text'] );65 $this->assertI nternalType( 'int',$result['mt_allow_comments'] );66 $this->assertI nternalType( 'int',$result['mt_allow_pings'] );67 $this->assertI nternalType( 'string',$result['mt_keywords'] );68 $this->assertI nternalType( 'string',$result['wp_slug'] );69 $this->assertI nternalType( 'string',$result['wp_password'] );70 $this->assertI nternalType( 'string',$result['wp_author_id'] );71 $this->assertI nternalType( 'string',$result['wp_author_display_name'] );72 $this->assertI nternalType( 'string',$result['post_status'] );73 $this->assertI nternalType( 'array',$result['custom_fields'] );74 $this->assertI nternalType( 'string',$result['wp_post_format'] );75 $this->assertI nternalType( 'bool',$result['sticky'] );55 $this->assertIsString( $result['userid'] ); 56 $this->assertIsInt( $result['postid'] ); 57 $this->assertIsString( $result['description'] ); 58 $this->assertIsString( $result['title'] ); 59 $this->assertIsString( $result['link'] ); 60 $this->assertIsString( $result['permaLink'] ); 61 $this->assertIsArray( $result['categories'] ); 62 $this->assertIsString( $result['mt_excerpt'] ); 63 $this->assertIsString( $result['mt_text_more'] ); 64 $this->assertIsString( $result['wp_more_text'] ); 65 $this->assertIsInt( $result['mt_allow_comments'] ); 66 $this->assertIsInt( $result['mt_allow_pings'] ); 67 $this->assertIsString( $result['mt_keywords'] ); 68 $this->assertIsString( $result['wp_slug'] ); 69 $this->assertIsString( $result['wp_password'] ); 70 $this->assertIsString( $result['wp_author_id'] ); 71 $this->assertIsString( $result['wp_author_display_name'] ); 72 $this->assertIsString( $result['post_status'] ); 73 $this->assertIsArray( $result['custom_fields'] ); 74 $this->assertIsString( $result['wp_post_format'] ); 75 $this->assertIsBool( $result['sticky'] ); 76 76 77 77 $post_data = get_post( self::$post_id ); 78 78 … … 102 102 $result = $this->myxmlrpcserver->mw_getPost( array( self::$post_id, 'author', 'author' ) ); 103 103 $this->assertNotIXRError( $result ); 104 104 105 $this->assertI nternalType( 'int',$result['wp_post_thumbnail'] );105 $this->assertIsInt( $result['wp_post_thumbnail'] ); 106 106 $this->assertSame( $attachment_id, $result['wp_post_thumbnail'] ); 107 107 108 108 remove_theme_support( 'post-thumbnails' ); -
tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php
58 58 $post = get_post( $result['postid'] ); 59 59 60 60 // Check data types. 61 $this->assertI nternalType( 'string',$result['userid'] );62 $this->assertI nternalType( 'string',$result['postid'] );63 $this->assertI nternalType( 'string',$result['description'] );64 $this->assertI nternalType( 'string',$result['title'] );65 $this->assertI nternalType( 'string',$result['link'] );66 $this->assertI nternalType( 'string',$result['permaLink'] );67 $this->assertI nternalType( 'array',$result['categories'] );68 $this->assertI nternalType( 'string',$result['mt_excerpt'] );69 $this->assertI nternalType( 'string',$result['mt_text_more'] );70 $this->assertI nternalType( 'string',$result['wp_more_text'] );71 $this->assertI nternalType( 'int',$result['mt_allow_comments'] );72 $this->assertI nternalType( 'int',$result['mt_allow_pings'] );73 $this->assertI nternalType( 'string',$result['mt_keywords'] );74 $this->assertI nternalType( 'string',$result['wp_slug'] );75 $this->assertI nternalType( 'string',$result['wp_password'] );76 $this->assertI nternalType( 'string',$result['wp_author_id'] );77 $this->assertI nternalType( 'string',$result['wp_author_display_name'] );78 $this->assertI nternalType( 'string',$result['post_status'] );79 $this->assertI nternalType( 'array',$result['custom_fields'] );80 $this->assertI nternalType( 'string',$result['wp_post_format'] );61 $this->assertIsString( $result['userid'] ); 62 $this->assertIsString( $result['postid'] ); 63 $this->assertIsString( $result['description'] ); 64 $this->assertIsString( $result['title'] ); 65 $this->assertIsString( $result['link'] ); 66 $this->assertIsString( $result['permaLink'] ); 67 $this->assertIsArray( $result['categories'] ); 68 $this->assertIsString( $result['mt_excerpt'] ); 69 $this->assertIsString( $result['mt_text_more'] ); 70 $this->assertIsString( $result['wp_more_text'] ); 71 $this->assertIsInt( $result['mt_allow_comments'] ); 72 $this->assertIsInt( $result['mt_allow_pings'] ); 73 $this->assertIsString( $result['mt_keywords'] ); 74 $this->assertIsString( $result['wp_slug'] ); 75 $this->assertIsString( $result['wp_password'] ); 76 $this->assertIsString( $result['wp_author_id'] ); 77 $this->assertIsString( $result['wp_author_display_name'] ); 78 $this->assertIsString( $result['post_status'] ); 79 $this->assertIsArray( $result['custom_fields'] ); 80 $this->assertIsString( $result['wp_post_format'] ); 81 81 82 82 // Check expected values. 83 83 $this->assertStringMatchesFormat( '%d', $result['userid'] ); … … 106 106 $this->assertNotIXRError( $results ); 107 107 108 108 foreach ( $results as $result ) { 109 $this->assertI nternalType( 'string',$result['wp_post_thumbnail'] );109 $this->assertIsString( $result['wp_post_thumbnail'] ); 110 110 $this->assertStringMatchesFormat( '%d', $result['wp_post_thumbnail'] ); 111 111 112 112 if ( ! empty( $result['wp_post_thumbnail'] ) || $result['postid'] === self::$post_id ) { -
tests/phpunit/tests/xmlrpc/wp/deleteTerm.php
70 70 71 71 $result = $this->myxmlrpcserver->wp_deleteTerm( array( 1, 'editor', 'editor', 'category', self::$term_id ) ); 72 72 $this->assertNotIXRError( $result ); 73 $this->assertI nternalType( 'boolean',$result );73 $this->assertIsBool( $result ); 74 74 } 75 75 } -
tests/phpunit/tests/xmlrpc/wp/editPost.php
159 159 $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'author', 'author', $post_id ) ); 160 160 $this->assertNotIXRError( $result ); 161 161 $this->assertArrayHasKey( 'post_thumbnail', $result ); 162 $this->assertI nternalType( 'array',$result['post_thumbnail'] );162 $this->assertIsArray( $result['post_thumbnail'] ); 163 163 $this->assertEquals( $attachment_id, $result['post_thumbnail']['attachment_id'] ); 164 164 165 165 // Edit the post without supplying a post_thumbnail and check that it didn't change. -
tests/phpunit/tests/xmlrpc/wp/editTerm.php
155 155 ); 156 156 157 157 $this->assertNotIXRError( $result ); 158 $this->assertI nternalType( 'boolean',$result );158 $this->assertIsBool( $result ); 159 159 160 160 $term = get_term( self::$child_term, 'category' ); 161 161 $this->assertEquals( '0', $term->parent ); … … 236 236 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', self::$child_term, $fields ) ); 237 237 238 238 $this->assertNotIXRError( $result ); 239 $this->assertI nternalType( 'boolean',$result );239 $this->assertIsBool( $result ); 240 240 } 241 241 242 242 /** -
tests/phpunit/tests/xmlrpc/wp/getComment.php
54 54 $this->assertNotIXRError( $result ); 55 55 56 56 // Check data types. 57 $this->assertI nternalType( 'string',$result['user_id'] );58 $this->assertI nternalType( 'string',$result['comment_id'] );57 $this->assertIsString( $result['user_id'] ); 58 $this->assertIsString( $result['comment_id'] ); 59 59 $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] ); 60 $this->assertI nternalType( 'string',$result['parent'] );61 $this->assertI nternalType( 'string',$result['status'] );62 $this->assertI nternalType( 'string',$result['content'] );63 $this->assertI nternalType( 'string',$result['link'] );64 $this->assertI nternalType( 'string',$result['post_id'] );65 $this->assertI nternalType( 'string',$result['post_title'] );66 $this->assertI nternalType( 'string',$result['author'] );67 $this->assertI nternalType( 'string',$result['author_url'] );68 $this->assertI nternalType( 'string',$result['author_email'] );69 $this->assertI nternalType( 'string',$result['author_ip'] );70 $this->assertI nternalType( 'string',$result['type'] );60 $this->assertIsString( $result['parent'] ); 61 $this->assertIsString( $result['status'] ); 62 $this->assertIsString( $result['content'] ); 63 $this->assertIsString( $result['link'] ); 64 $this->assertIsString( $result['post_id'] ); 65 $this->assertIsString( $result['post_title'] ); 66 $this->assertIsString( $result['author'] ); 67 $this->assertIsString( $result['author_url'] ); 68 $this->assertIsString( $result['author_email'] ); 69 $this->assertIsString( $result['author_ip'] ); 70 $this->assertIsString( $result['type'] ); 71 71 72 72 // Check expected values. 73 73 $this->assertStringMatchesFormat( '%d', $result['user_id'] ); -
tests/phpunit/tests/xmlrpc/wp/getComments.php
198 198 ) 199 199 ); 200 200 201 $this->assertI nternalType( 'array',$result2 );201 $this->assertIsArray( $result2 ); 202 202 $this->assertCount( 1, $result2 ); 203 203 204 204 $result3 = $this->myxmlrpcserver->wp_getComments( … … 225 225 ) 226 226 ); 227 227 228 $this->assertI nternalType( 'array',$result4 );228 $this->assertIsArray( $result4 ); 229 229 $this->assertCount( 1, $result4 ); 230 230 } 231 231 … … 276 276 ), 277 277 ) 278 278 ); 279 $this->assertI nternalType( 'array',$result );279 $this->assertIsArray( $result ); 280 280 $this->assertCount( 1, $result ); 281 281 282 282 $result2 = $this->myxmlrpcserver->wp_getComments( … … 291 291 ) 292 292 ); 293 293 294 $this->assertI nternalType( 'array',$result2 );294 $this->assertIsArray( $result2 ); 295 295 $this->assertCount( 1, $result2 ); 296 296 } 297 297 } -
tests/phpunit/tests/xmlrpc/wp/getMediaItem.php
50 50 $this->assertNotIXRError( $result ); 51 51 52 52 // Check data types. 53 $this->assertI nternalType( 'string',$result['attachment_id'] );54 $this->assertI nternalType( 'int',$result['parent'] );55 $this->assertI nternalType( 'string',$result['title'] );53 $this->assertIsString( $result['attachment_id'] ); 54 $this->assertIsInt( $result['parent'] ); 55 $this->assertIsString( $result['title'] ); 56 56 $this->assertInstanceOf( 'IXR_Date', $result['date_created_gmt'] ); 57 $this->assertI nternalType( 'string',$result['caption'] );58 $this->assertI nternalType( 'string',$result['description'] );59 $this->assertI nternalType( 'string',$result['link'] );60 $this->assertI nternalType( 'string',$result['thumbnail'] );61 $this->assertI nternalType( 'array',$result['metadata'] );57 $this->assertIsString( $result['caption'] ); 58 $this->assertIsString( $result['description'] ); 59 $this->assertIsString( $result['link'] ); 60 $this->assertIsString( $result['thumbnail'] ); 61 $this->assertIsArray( $result['metadata'] ); 62 62 63 63 // Check expected values. 64 64 $this->assertStringMatchesFormat( '%d', $result['attachment_id'] ); -
tests/phpunit/tests/xmlrpc/wp/getOptions.php
15 15 $this->make_user_by_role( 'subscriber' ); 16 16 17 17 $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'subscriber', 'subscriber' ) ); 18 $this->assertI nternalType( 'array',$result );18 $this->assertIsArray( $result ); 19 19 $this->assertSame( 'WordPress', $result['software_name']['value'] ); 20 20 } 21 21 … … 23 23 $this->make_user_by_role( 'administrator' ); 24 24 25 25 $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'administrator', 'administrator', 'default_comment_status' ) ); 26 $this->assertI nternalType( 'array',$result );26 $this->assertIsArray( $result ); 27 27 28 28 $this->assertSame( get_option( 'default_comment_status' ), $result['default_comment_status']['value'] ); 29 29 $this->assertFalse( $result['default_comment_status']['readonly'] ); … … 37 37 $this->make_user_by_role( 'subscriber' ); 38 38 39 39 $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'subscriber', 'subscriber' ) ); 40 $this->assertI nternalType( 'array',$result );40 $this->assertIsArray( $result ); 41 41 42 42 // Read-only options. 43 43 $this->assertSame( 'WordPress', $result['software_name']['value'] ); … … 126 126 $this->make_user_by_role( 'administrator' ); 127 127 128 128 $result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'administrator', 'administrator' ) ); 129 $this->assertI nternalType( 'array',$result );129 $this->assertIsArray( $result ); 130 130 131 131 // Read-only options. 132 132 $this->assertSame( 'WordPress', $result['software_name']['value'] ); -
tests/phpunit/tests/xmlrpc/wp/getPage.php
46 46 $this->assertNotIXRError( $result ); 47 47 48 48 // Check data types. 49 $this->assertI nternalType( 'string',$result['userid'] );50 $this->assertI nternalType( 'int',$result['page_id'] );51 $this->assertI nternalType( 'string',$result['page_status'] );52 $this->assertI nternalType( 'string',$result['description'] );53 $this->assertI nternalType( 'string',$result['title'] );54 $this->assertI nternalType( 'string',$result['link'] );55 $this->assertI nternalType( 'string',$result['permaLink'] );56 $this->assertI nternalType( 'array',$result['categories'] );57 $this->assertI nternalType( 'string',$result['excerpt'] );58 $this->assertI nternalType( 'string',$result['text_more'] );59 $this->assertI nternalType( 'int',$result['mt_allow_comments'] );60 $this->assertI nternalType( 'int',$result['mt_allow_pings'] );61 $this->assertI nternalType( 'string',$result['wp_slug'] );62 $this->assertI nternalType( 'string',$result['wp_password'] );63 $this->assertI nternalType( 'string',$result['wp_author'] );64 $this->assertI nternalType( 'int',$result['wp_page_parent_id'] );65 $this->assertI nternalType( 'string',$result['wp_page_parent_title'] );66 $this->assertI nternalType( 'int',$result['wp_page_order'] );67 $this->assertI nternalType( 'string',$result['wp_author_id'] );68 $this->assertI nternalType( 'string',$result['wp_author_display_name'] );69 $this->assertI nternalType( 'array',$result['custom_fields'] );70 $this->assertI nternalType( 'string',$result['wp_page_template'] );49 $this->assertIsString( $result['userid'] ); 50 $this->assertIsInt( $result['page_id'] ); 51 $this->assertIsString( $result['page_status'] ); 52 $this->assertIsString( $result['description'] ); 53 $this->assertIsString( $result['title'] ); 54 $this->assertIsString( $result['link'] ); 55 $this->assertIsString( $result['permaLink'] ); 56 $this->assertIsArray( $result['categories'] ); 57 $this->assertIsString( $result['excerpt'] ); 58 $this->assertIsString( $result['text_more'] ); 59 $this->assertIsInt( $result['mt_allow_comments'] ); 60 $this->assertIsInt( $result['mt_allow_pings'] ); 61 $this->assertIsString( $result['wp_slug'] ); 62 $this->assertIsString( $result['wp_password'] ); 63 $this->assertIsString( $result['wp_author'] ); 64 $this->assertIsInt( $result['wp_page_parent_id'] ); 65 $this->assertIsString( $result['wp_page_parent_title'] ); 66 $this->assertIsInt( $result['wp_page_order'] ); 67 $this->assertIsString( $result['wp_author_id'] ); 68 $this->assertIsString( $result['wp_author_display_name'] ); 69 $this->assertIsArray( $result['custom_fields'] ); 70 $this->assertIsString( $result['wp_page_template'] ); 71 71 72 72 $post_data = get_post( self::$post_id ); 73 73 -
tests/phpunit/tests/xmlrpc/wp/getPost.php
42 42 $this->assertNotIXRError( $result ); 43 43 44 44 // Check data types. 45 $this->assertI nternalType( 'string',$result['post_id'] );46 $this->assertI nternalType( 'string',$result['post_title'] );45 $this->assertIsString( $result['post_id'] ); 46 $this->assertIsString( $result['post_title'] ); 47 47 $this->assertInstanceOf( 'IXR_Date', $result['post_date'] ); 48 48 $this->assertInstanceOf( 'IXR_Date', $result['post_date_gmt'] ); 49 49 $this->assertInstanceOf( 'IXR_Date', $result['post_modified'] ); 50 50 $this->assertInstanceOf( 'IXR_Date', $result['post_modified_gmt'] ); 51 $this->assertI nternalType( 'string',$result['post_status'] );52 $this->assertI nternalType( 'string',$result['post_type'] );53 $this->assertI nternalType( 'string',$result['post_name'] );54 $this->assertI nternalType( 'string',$result['post_author'] );55 $this->assertI nternalType( 'string',$result['post_password'] );56 $this->assertI nternalType( 'string',$result['post_excerpt'] );57 $this->assertI nternalType( 'string',$result['post_content'] );58 $this->assertI nternalType( 'string',$result['link'] );59 $this->assertI nternalType( 'string',$result['comment_status'] );60 $this->assertI nternalType( 'string',$result['ping_status'] );61 $this->assertI nternalType( 'bool',$result['sticky'] );62 $this->assertI nternalType( 'string',$result['post_format'] );63 $this->assertI nternalType( 'array',$result['post_thumbnail'] );64 $this->assertI nternalType( 'array',$result['custom_fields'] );51 $this->assertIsString( $result['post_status'] ); 52 $this->assertIsString( $result['post_type'] ); 53 $this->assertIsString( $result['post_name'] ); 54 $this->assertIsString( $result['post_author'] ); 55 $this->assertIsString( $result['post_password'] ); 56 $this->assertIsString( $result['post_excerpt'] ); 57 $this->assertIsString( $result['post_content'] ); 58 $this->assertIsString( $result['link'] ); 59 $this->assertIsString( $result['comment_status'] ); 60 $this->assertIsString( $result['ping_status'] ); 61 $this->assertIsBool( $result['sticky'] ); 62 $this->assertIsString( $result['post_format'] ); 63 $this->assertIsArray( $result['post_thumbnail'] ); 64 $this->assertIsArray( $result['custom_fields'] ); 65 65 66 66 // Check expected values. 67 67 $this->assertStringMatchesFormat( '%d', $result['post_id'] ); … … 137 137 $result = $this->myxmlrpcserver->wp_getPost( array( 1, 'editor', 'editor', $child_page_id ) ); 138 138 $this->assertNotIXRError( $result ); 139 139 140 $this->assertI nternalType( 'string',$result['post_id'] );141 $this->assertI nternalType( 'string',$result['post_parent'] );142 $this->assertI nternalType( 'int',$result['menu_order'] );143 $this->assertI nternalType( 'string',$result['guid'] );144 $this->assertI nternalType( 'string',$result['post_mime_type'] );140 $this->assertIsString( $result['post_id'] ); 141 $this->assertIsString( $result['post_parent'] ); 142 $this->assertIsInt( $result['menu_order'] ); 143 $this->assertIsString( $result['guid'] ); 144 $this->assertIsString( $result['post_mime_type'] ); 145 145 146 146 $this->assertSame( 'page', $result['post_type'] ); 147 147 $this->assertEquals( $parent_page_id, $result['post_parent'] ); -
tests/phpunit/tests/xmlrpc/wp/getPostType.php
59 59 $this->assertNotIXRError( $result ); 60 60 61 61 // Check data types. 62 $this->assertI nternalType( 'string',$result['name'] );63 $this->assertI nternalType( 'string',$result['label'] );64 $this->assertI nternalType( 'bool',$result['hierarchical'] );65 $this->assertI nternalType( 'bool',$result['public'] );66 $this->assertI nternalType( 'bool',$result['_builtin'] );67 $this->assertI nternalType( 'bool',$result['map_meta_cap'] );68 $this->assertI nternalType( 'bool',$result['has_archive'] );69 $this->assertI nternalType( 'bool',$result['show_ui'] );70 $this->assertI nternalType( 'int',$result['menu_position'] );71 $this->assertI nternalType( 'string',$result['menu_icon'] );72 $this->assertI nternalType( 'array',$result['labels'] );73 $this->assertI nternalType( 'array',$result['cap'] );74 $this->assertI nternalType( 'array',$result['taxonomies'] );75 $this->assertI nternalType( 'array',$result['supports'] );62 $this->assertIsString( $result['name'] ); 63 $this->assertIsString( $result['label'] ); 64 $this->assertIsBool( $result['hierarchical'] ); 65 $this->assertIsBool( $result['public'] ); 66 $this->assertIsBool( $result['_builtin'] ); 67 $this->assertIsBool( $result['map_meta_cap'] ); 68 $this->assertIsBool( $result['has_archive'] ); 69 $this->assertIsBool( $result['show_ui'] ); 70 $this->assertIsInt( $result['menu_position'] ); 71 $this->assertIsString( $result['menu_icon'] ); 72 $this->assertIsArray( $result['labels'] ); 73 $this->assertIsArray( $result['cap'] ); 74 $this->assertIsArray( $result['taxonomies'] ); 75 $this->assertIsArray( $result['supports'] ); 76 76 77 77 // Check label data types. 78 $this->assertI nternalType( 'string',$result['labels']['name'] );79 $this->assertI nternalType( 'string',$result['labels']['singular_name'] );80 $this->assertI nternalType( 'string',$result['labels']['add_new'] );81 $this->assertI nternalType( 'string',$result['labels']['add_new_item'] );82 $this->assertI nternalType( 'string',$result['labels']['edit_item'] );83 $this->assertI nternalType( 'string',$result['labels']['new_item'] );84 $this->assertI nternalType( 'string',$result['labels']['view_item'] );85 $this->assertI nternalType( 'string',$result['labels']['search_items'] );86 $this->assertI nternalType( 'string',$result['labels']['not_found'] );87 $this->assertI nternalType( 'string',$result['labels']['not_found_in_trash'] );88 $this->assertI nternalType( 'string',$result['labels']['parent_item_colon'] );89 $this->assertI nternalType( 'string',$result['labels']['all_items'] );90 $this->assertI nternalType( 'string',$result['labels']['menu_name'] );91 $this->assertI nternalType( 'string',$result['labels']['name_admin_bar'] );78 $this->assertIsString( $result['labels']['name'] ); 79 $this->assertIsString( $result['labels']['singular_name'] ); 80 $this->assertIsString( $result['labels']['add_new'] ); 81 $this->assertIsString( $result['labels']['add_new_item'] ); 82 $this->assertIsString( $result['labels']['edit_item'] ); 83 $this->assertIsString( $result['labels']['new_item'] ); 84 $this->assertIsString( $result['labels']['view_item'] ); 85 $this->assertIsString( $result['labels']['search_items'] ); 86 $this->assertIsString( $result['labels']['not_found'] ); 87 $this->assertIsString( $result['labels']['not_found_in_trash'] ); 88 $this->assertIsString( $result['labels']['parent_item_colon'] ); 89 $this->assertIsString( $result['labels']['all_items'] ); 90 $this->assertIsString( $result['labels']['menu_name'] ); 91 $this->assertIsString( $result['labels']['name_admin_bar'] ); 92 92 93 93 // Check cap data types. 94 $this->assertI nternalType( 'string',$result['cap']['edit_post'] );95 $this->assertI nternalType( 'string',$result['cap']['read_post'] );96 $this->assertI nternalType( 'string',$result['cap']['delete_post'] );97 $this->assertI nternalType( 'string',$result['cap']['edit_posts'] );98 $this->assertI nternalType( 'string',$result['cap']['edit_others_posts'] );99 $this->assertI nternalType( 'string',$result['cap']['publish_posts'] );100 $this->assertI nternalType( 'string',$result['cap']['read_private_posts'] );101 $this->assertI nternalType( 'string',$result['cap']['read'] );102 $this->assertI nternalType( 'string',$result['cap']['delete_posts'] );103 $this->assertI nternalType( 'string',$result['cap']['delete_private_posts'] );104 $this->assertI nternalType( 'string',$result['cap']['delete_published_posts'] );105 $this->assertI nternalType( 'string',$result['cap']['delete_others_posts'] );106 $this->assertI nternalType( 'string',$result['cap']['edit_private_posts'] );107 $this->assertI nternalType( 'string',$result['cap']['edit_published_posts'] );94 $this->assertIsString( $result['cap']['edit_post'] ); 95 $this->assertIsString( $result['cap']['read_post'] ); 96 $this->assertIsString( $result['cap']['delete_post'] ); 97 $this->assertIsString( $result['cap']['edit_posts'] ); 98 $this->assertIsString( $result['cap']['edit_others_posts'] ); 99 $this->assertIsString( $result['cap']['publish_posts'] ); 100 $this->assertIsString( $result['cap']['read_private_posts'] ); 101 $this->assertIsString( $result['cap']['read'] ); 102 $this->assertIsString( $result['cap']['delete_posts'] ); 103 $this->assertIsString( $result['cap']['delete_private_posts'] ); 104 $this->assertIsString( $result['cap']['delete_published_posts'] ); 105 $this->assertIsString( $result['cap']['delete_others_posts'] ); 106 $this->assertIsString( $result['cap']['edit_private_posts'] ); 107 $this->assertIsString( $result['cap']['edit_published_posts'] ); 108 108 109 109 // Check taxonomy data types. 110 110 foreach ( $result['taxonomies'] as $taxonomy ) { 111 $this->assertI nternalType( 'string',$taxonomy );111 $this->assertIsString( $taxonomy ); 112 112 } 113 113 114 114 // Check support data types. 115 115 foreach ( $result['supports'] as $key => $value ) { 116 $this->assertI nternalType( 'string',$key );117 $this->assertI nternalType( 'bool',$value );116 $this->assertIsString( $key ); 117 $this->assertIsBool( $value ); 118 118 } 119 119 120 120 // Check expected values. -
tests/phpunit/tests/xmlrpc/wp/getPostTypes.php
15 15 16 16 $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'subscriber', 'subscriber' ) ); 17 17 $this->assertNotIXRError( $result ); 18 $this->assertI nternalType( 'array',$result );18 $this->assertIsArray( $result ); 19 19 $this->assertSame( 0, count( $result ) ); 20 20 } 21 21 … … 24 24 25 25 $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor' ) ); 26 26 $this->assertNotIXRError( $result ); 27 $this->assertI nternalType( 'array',$result );27 $this->assertIsArray( $result ); 28 28 $this->assertGreaterThan( 0, count( $result ) ); 29 29 } 30 30 … … 33 33 34 34 $result = $this->myxmlrpcserver->wp_getPostTypes( array( 1, 'editor', 'editor', array( 'hierarchical' => true ) ) ); 35 35 $this->assertNotIXRError( $result ); 36 $this->assertI nternalType( 'array',$result );36 $this->assertIsArray( $result ); 37 37 38 38 // Verify that page is in the result, and post is not. 39 39 $result_names = wp_list_pluck( $result, 'name' ); -
tests/phpunit/tests/xmlrpc/wp/getRevisions.php
41 41 ); // Create the initial revision. 42 42 43 43 $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) ); 44 $this->assertI nternalType( 'array',$result );44 $this->assertIsArray( $result ); 45 45 $this->assertCount( 1, $result ); 46 46 47 47 wp_insert_post( … … 52 52 ); 53 53 54 54 $result = $this->myxmlrpcserver->wp_getRevisions( array( 1, 'editor', 'editor', $post_id ) ); 55 $this->assertI nternalType( 'array',$result );55 $this->assertIsArray( $result ); 56 56 $this->assertCount( 2, $result ); 57 57 } 58 58 -
tests/phpunit/tests/xmlrpc/wp/getTerm.php
79 79 $this->assertEquals( $result, $term ); 80 80 81 81 // Check data types. 82 $this->assertI nternalType( 'string',$result['name'] );83 $this->assertI nternalType( 'string',$result['slug'] );84 $this->assertI nternalType( 'string',$result['taxonomy'] );85 $this->assertI nternalType( 'string',$result['description'] );86 $this->assertI nternalType( 'int',$result['count'] );82 $this->assertIsString( $result['name'] ); 83 $this->assertIsString( $result['slug'] ); 84 $this->assertIsString( $result['taxonomy'] ); 85 $this->assertIsString( $result['description'] ); 86 $this->assertIsInt( $result['count'] ); 87 87 88 88 // We expect all ID's to be strings not integers so we don't return something larger than an XMLRPC integer can describe. 89 89 $this->assertStringMatchesFormat( '%d', $result['term_id'] ); … … 121 121 ); 122 122 $this->assertNotIXRError( $result ); 123 123 124 $this->assertI nternalType( 'array',$result['custom_fields'] );124 $this->assertIsArray( $result['custom_fields'] ); 125 125 $term_meta = get_term_meta( self::$term_id, '', true ); 126 126 $this->assertSame( $term_meta['foo'][0], $result['custom_fields'][0]['value'] ); 127 127 } -
tests/phpunit/tests/xmlrpc/wp/getTerms.php
48 48 $this->assertNotIXRError( $results ); 49 49 50 50 foreach ( $results as $term ) { 51 $this->assertI nternalType( 'int',$term['count'] );51 $this->assertIsInt( $term['count'] ); 52 52 53 53 // Check custom term meta. 54 $this->assertI nternalType( 'array',$term['custom_fields'] );54 $this->assertIsArray( $term['custom_fields'] ); 55 55 56 56 // We expect all other IDs to be strings, not integers, 57 57 // so we don't return something larger than an XMLRPC integer can describe. -
tests/phpunit/tests/xmlrpc/wp/getUser.php
69 69 $this->assertNotIXRError( $result ); 70 70 71 71 // Check data types. 72 $this->assertI nternalType( 'string',$result['user_id'] );72 $this->assertIsString( $result['user_id'] ); 73 73 $this->assertStringMatchesFormat( '%d', $result['user_id'] ); 74 $this->assertI nternalType( 'string',$result['username'] );75 $this->assertI nternalType( 'string',$result['first_name'] );76 $this->assertI nternalType( 'string',$result['last_name'] );74 $this->assertIsString( $result['username'] ); 75 $this->assertIsString( $result['first_name'] ); 76 $this->assertIsString( $result['last_name'] ); 77 77 $this->assertInstanceOf( 'IXR_Date', $result['registered'] ); 78 $this->assertI nternalType( 'string',$result['bio'] );79 $this->assertI nternalType( 'string',$result['email'] );80 $this->assertI nternalType( 'string',$result['nickname'] );81 $this->assertI nternalType( 'string',$result['nicename'] );82 $this->assertI nternalType( 'string',$result['url'] );83 $this->assertI nternalType( 'string',$result['display_name'] );84 $this->assertI nternalType( 'array',$result['roles'] );78 $this->assertIsString( $result['bio'] ); 79 $this->assertIsString( $result['email'] ); 80 $this->assertIsString( $result['nickname'] ); 81 $this->assertIsString( $result['nicename'] ); 82 $this->assertIsString( $result['url'] ); 83 $this->assertIsString( $result['display_name'] ); 84 $this->assertIsArray( $result['roles'] ); 85 85 86 86 // Check expected values. 87 87 $this->assertEquals( $user_id, $result['user_id'] ); -
tests/phpunit/tests/xmlrpc/wp/getUsers.php
27 27 $this->assertNotIXRError( $result ); 28 28 29 29 // Check data types. 30 $this->assertI nternalType( 'string',$result[0]['user_id'] );30 $this->assertIsString( $result[0]['user_id'] ); 31 31 $this->assertStringMatchesFormat( '%d', $result[0]['user_id'] ); 32 $this->assertI nternalType( 'string',$result[0]['username'] );33 $this->assertI nternalType( 'string',$result[0]['first_name'] );34 $this->assertI nternalType( 'string',$result[0]['last_name'] );32 $this->assertIsString( $result[0]['username'] ); 33 $this->assertIsString( $result[0]['first_name'] ); 34 $this->assertIsString( $result[0]['last_name'] ); 35 35 $this->assertInstanceOf( 'IXR_Date', $result[0]['registered'] ); 36 $this->assertI nternalType( 'string',$result[0]['bio'] );37 $this->assertI nternalType( 'string',$result[0]['email'] );38 $this->assertI nternalType( 'string',$result[0]['nickname'] );39 $this->assertI nternalType( 'string',$result[0]['nicename'] );40 $this->assertI nternalType( 'string',$result[0]['url'] );41 $this->assertI nternalType( 'string',$result[0]['display_name'] );42 $this->assertI nternalType( 'array',$result[0]['roles'] );36 $this->assertIsString( $result[0]['bio'] ); 37 $this->assertIsString( $result[0]['email'] ); 38 $this->assertIsString( $result[0]['nickname'] ); 39 $this->assertIsString( $result[0]['nicename'] ); 40 $this->assertIsString( $result[0]['url'] ); 41 $this->assertIsString( $result[0]['display_name'] ); 42 $this->assertIsArray( $result[0]['roles'] ); 43 43 } 44 44 45 45 function test_invalid_role() { -
tests/phpunit/tests/xmlrpc/wp/newComment.php
208 208 209 209 $result = $this->myxmlrpcserver->wp_newComment( $comment_args ); 210 210 $this->assertNotIXRError( $result ); 211 $this->assertI nternalType( 'int',$result );211 $this->assertIsInt( $result ); 212 212 } 213 213 214 214 /** … … 290 290 291 291 $result = $this->myxmlrpcserver->wp_newComment( $comment_args ); 292 292 if ( $expected ) { 293 $this->assertI nternalType( 'int',$result );293 $this->assertIsInt( $result ); 294 294 return; 295 295 } 296 296 -
tests/phpunit/tests/xmlrpc/wp/newPost.php
280 280 $this->make_user_by_role( 'editor' ); 281 281 282 282 $tag1 = wp_create_tag( 'tag1' ); 283 $this->assertI nternalType( 'array',$tag1 );283 $this->assertIsArray( $tag1 ); 284 284 $tag2 = wp_create_tag( 'tag2' ); 285 $this->assertI nternalType( 'array',$tag2 );285 $this->assertIsArray( $tag2 ); 286 286 $tag3 = wp_create_tag( 'tag3' ); 287 $this->assertI nternalType( 'array',$tag3 );287 $this->assertIsArray( $tag3 ); 288 288 289 289 $post = array( 290 290 'post_title' => 'Test', -
tests/phpunit/tests/xmlrpc/wp/setOptions.php
26 26 ) 27 27 ); 28 28 29 $this->assertI nternalType( 'array',$result );29 $this->assertIsArray( $result ); 30 30 $this->assertSame( $escaped_string_with_quote, $result['blog_title']['value'] ); 31 31 $this->assertSame( 'open', $result['default_comment_status']['value'] ); 32 32 } -
tests/phpunit/tests/xmlrpc/wp/uploadFile.php
27 27 $this->assertNotIXRError( $result ); 28 28 29 29 // Check data types. 30 $this->assertI nternalType( 'string',$result['id'] );30 $this->assertIsString( $result['id'] ); 31 31 $this->assertStringMatchesFormat( '%d', $result['id'] ); 32 $this->assertI nternalType( 'string',$result['file'] );33 $this->assertI nternalType( 'string',$result['url'] );34 $this->assertI nternalType( 'string',$result['type'] );32 $this->assertIsString( $result['file'] ); 33 $this->assertIsString( $result['url'] ); 34 $this->assertIsString( $result['type'] ); 35 35 } 36 36 }