Changeset 52248
- Timestamp:
- 11/25/2021 07:39:31 PM (3 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/db/charset.php
r52010 r52248 768 768 769 769 $charset = self::$_wpdb->get_table_charset( $table ); 770 $this->assertSame( $ charset, $expected_charset );770 $this->assertSame( $expected_charset, $charset ); 771 771 772 772 $charset = self::$_wpdb->get_table_charset( strtoupper( $table ) ); 773 $this->assertSame( $ charset, $expected_charset );773 $this->assertSame( $expected_charset, $charset ); 774 774 775 775 self::$_wpdb->query( $drop ); -
trunk/tests/phpunit/tests/image/editor.php
r51704 r52248 298 298 299 299 $file_data = wp_get_webp_info( $file ); 300 $this->assertSame( $ file_data, $expected);300 $this->assertSame( $expected, $file_data ); 301 301 } 302 302 -
trunk/tests/phpunit/tests/image/functions.php
r52010 r52248 627 627 $metadata = wp_generate_attachment_metadata( $attachment_id, $test_file ); 628 628 $this->assertArrayHasKey( 'test-size', $metadata['sizes'], 'The `test-size` was not added to the metadata.' ); 629 $this->assertSame( $ metadata['sizes']['test-size'], $expected);629 $this->assertSame( $expected, $metadata['sizes']['test-size'] ); 630 630 631 631 remove_image_size( 'test-size' ); -
trunk/tests/phpunit/tests/l10n/loadTextdomainJustInTime.php
r51568 r52248 70 70 71 71 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-plugin' ); 72 $ expected_output= i18n_plugin_test();72 $actual_output = i18n_plugin_test(); 73 73 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-plugin' ); 74 74 … … 76 76 77 77 $this->assertFalse( $is_textdomain_loaded_before ); 78 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output );78 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output ); 79 79 $this->assertTrue( $is_textdomain_loaded_after ); 80 80 } … … 91 91 92 92 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-theme' ); 93 $ expected_output= i18n_theme_test();93 $actual_output = i18n_theme_test(); 94 94 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-theme' ); 95 95 … … 97 97 98 98 $this->assertFalse( $is_textdomain_loaded_before ); 99 $this->assertSame( 'Das ist ein Dummy Theme', $ expected_output );99 $this->assertSame( 'Das ist ein Dummy Theme', $actual_output ); 100 100 $this->assertTrue( $is_textdomain_loaded_after ); 101 101 } … … 122 122 require_once DIR_TESTDATA . '/plugins/internationalized-plugin.php'; 123 123 124 $ expected_output_before= i18n_plugin_test();124 $actual_output_before = i18n_plugin_test(); 125 125 $is_textdomain_loaded_before = is_textdomain_loaded( 'internationalized-plugin' ); 126 126 … … 128 128 remove_filter( 'locale', array( $this, 'filter_set_locale_to_german' ) ); 129 129 130 $ expected_output_after= i18n_plugin_test();130 $actual_output_after = i18n_plugin_test(); 131 131 $is_textdomain_loaded_after = is_textdomain_loaded( 'internationalized-plugin' ); 132 132 … … 134 134 load_textdomain( 'internationalized-plugin', WP_LANG_DIR . '/plugins/internationalized-plugin-de_DE.mo' ); 135 135 136 $ expected_output_final= i18n_plugin_test();136 $actual_output_final = i18n_plugin_test(); 137 137 $is_textdomain_loaded_final = is_textdomain_loaded( 'internationalized-plugin' ); 138 138 … … 141 141 142 142 // Text domain loaded just in time. 143 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output_before );143 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output_before ); 144 144 $this->assertTrue( $is_textdomain_loaded_before ); 145 145 146 146 // Text domain unloaded. 147 $this->assertSame( 'This is a dummy plugin', $ expected_output_after );147 $this->assertSame( 'This is a dummy plugin', $actual_output_after ); 148 148 $this->assertFalse( $is_textdomain_loaded_after ); 149 149 150 150 // Text domain loaded manually again. 151 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_output_final );151 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_output_final ); 152 152 $this->assertTrue( $is_textdomain_loaded_final ); 153 153 } … … 160 160 161 161 switch_to_locale( 'de_DE' ); 162 $ expected= i18n_plugin_test();162 $actual = i18n_plugin_test(); 163 163 restore_previous_locale(); 164 164 165 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected);165 $this->assertSame( 'Das ist ein Dummy Plugin', $actual ); 166 166 } 167 167 … … 173 173 174 174 switch_to_locale( 'de_DE' ); 175 $ expected_de_de = i18n_plugin_test();175 $actual_de_de = i18n_plugin_test(); 176 176 177 177 switch_to_locale( 'es_ES' ); 178 $ expected_es_es = i18n_plugin_test();178 $actual_es_es = i18n_plugin_test(); 179 179 180 180 restore_current_locale(); 181 181 182 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected_de_de );183 $this->assertSame( 'This is a dummy plugin', $ expected_es_es );182 $this->assertSame( 'Das ist ein Dummy Plugin', $actual_de_de ); 183 $this->assertSame( 'This is a dummy plugin', $actual_es_es ); 184 184 } 185 185 … … 193 193 194 194 switch_to_locale( 'de_DE' ); 195 $ expected= i18n_theme_test();195 $actual = i18n_theme_test(); 196 196 restore_previous_locale(); 197 197 198 198 switch_theme( WP_DEFAULT_THEME ); 199 199 200 $this->assertSame( 'Das ist ein Dummy Theme', $ expected);200 $this->assertSame( 'Das ist ein Dummy Theme', $actual ); 201 201 } 202 202 … … 210 210 wp_set_current_user( self::$user_id ); 211 211 212 $ expected= i18n_plugin_test();213 214 $this->assertSame( 'Das ist ein Dummy Plugin', $ expected);212 $actual = i18n_plugin_test(); 213 214 $this->assertSame( 'Das ist ein Dummy Plugin', $actual ); 215 215 } 216 216 … … 225 225 require_once get_stylesheet_directory() . '/functions.php'; 226 226 227 $ expected= i18n_theme_test();227 $actual = i18n_theme_test(); 228 228 229 229 switch_theme( WP_DEFAULT_THEME ); 230 230 231 $this->assertSame( 'Das ist ein Dummy Theme', $ expected);231 $this->assertSame( 'Das ist ein Dummy Theme', $actual ); 232 232 } 233 233 -
trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php
r51568 r52248 373 373 switch_to_locale( $site_locale ); 374 374 375 $ expected= i18n_plugin_test();375 $actual = i18n_plugin_test(); 376 376 377 377 restore_current_locale(); … … 380 380 381 381 $this->assertSame( 'en_US', get_locale() ); 382 $this->assertSame( 'This is a dummy plugin', $ expected);382 $this->assertSame( 'This is a dummy plugin', $actual ); 383 383 } 384 384 -
trunk/tests/phpunit/tests/menu/walker-nav-menu.php
r51657 r52248 42 42 */ 43 43 public function test_noopener_no_referrer_for_target_blank() { 44 $ expected= '';44 $actual = ''; 45 45 $post_id = $this->factory->post->create(); 46 46 $post_title = get_the_title( $post_id ); … … 62 62 ); 63 63 64 $this->walker->start_el( $ expected, (object) $item, 0, (object) $args );64 $this->walker->start_el( $actual, (object) $item, 0, (object) $args ); 65 65 66 $this->assertSame( "<li id=\"menu-item-{$post_id}\" class=\"menu-item-{$post_id}\"><a target=\"_blank\" rel=\"noopener\">{$post_title}</a>", $ expected);66 $this->assertSame( "<li id=\"menu-item-{$post_id}\" class=\"menu-item-{$post_id}\"><a target=\"_blank\" rel=\"noopener\">{$post_title}</a>", $actual ); 67 67 } 68 68 -
trunk/tests/phpunit/tests/meta/registerMeta.php
r49603 r52248 180 180 ), 181 181 ); 182 $this->assertSame( $ actual, $expected);182 $this->assertSame( $expected, $actual ); 183 183 } 184 184 … … 522 522 $object_id = self::$$object_property_name; 523 523 $default_value = get_metadata_default( $object_type, $object_id, $meta_key, $single ); 524 $this->assertSame( $ default_value, $expected);524 $this->assertSame( $expected, $default_value ); 525 525 526 526 // Check for default value. 527 527 $value = get_metadata( $object_type, $object_id, $meta_key, $single ); 528 $this->assertSame( $ value, $expected);528 $this->assertSame( $expected, $value ); 529 529 530 530 // Set value to check default is not being returned by mistake. … … 537 537 delete_metadata( $object_type, $object_id, $meta_key ); 538 538 $value = get_metadata( $object_type, $object_id, $meta_key, $single ); 539 $this->assertSame( $ value, $expected);539 $this->assertSame( $expected, $value ); 540 540 541 541 // Set other meta key, to make sure other keys are not effects. … … 569 569 $object_id = self::$$object_property_name; 570 570 $default_value = get_metadata_default( $object_type, $object_id, $meta_key, $single ); 571 $this->assertSame( $ default_value, $expected);571 $this->assertSame( $expected, $default_value ); 572 572 } 573 573 -
trunk/tests/phpunit/tests/post/nav-menu.php
r52010 r52248 248 248 $nav_menus_names = wp_list_pluck( wp_get_nav_menus(), 'name' ); 249 249 250 $this->assertSame( $ nav_menus_names, $expected_nav_menus_names );250 $this->assertSame( $expected_nav_menus_names, $nav_menus_names ); 251 251 } 252 252 -
trunk/tests/phpunit/tests/query/commentCount.php
r51568 r52248 82 82 $expected = self::$post_ids[4]; 83 83 84 $this->assertSameSets( $ found_post_ids, $expected);84 $this->assertSameSets( $expected, $found_post_ids ); 85 85 } 86 86 … … 100 100 $expected = self::$post_ids[5]; 101 101 102 $this->assertSameSets( $ found_post_ids, $expected);102 $this->assertSameSets( $expected, $found_post_ids ); 103 103 } 104 104 … … 118 118 $expected = array(); 119 119 120 $this->assertSameSets( $ found_post_ids, $expected);120 $this->assertSameSets( $expected, $found_post_ids ); 121 121 } 122 122 public function test_operator_less_than() { … … 144 144 } 145 145 146 $this->assertSameSets( $ found_post_ids, $expected);146 $this->assertSameSets( $expected, $found_post_ids ); 147 147 } 148 148 … … 162 162 $expected = array(); 163 163 164 $this->assertSameSets( $ found_post_ids, $expected);164 $this->assertSameSets( $expected, $found_post_ids ); 165 165 } 166 166 … … 190 190 } 191 191 192 $this->assertSameSets( $ found_post_ids, $expected);192 $this->assertSameSets( $expected, $found_post_ids ); 193 193 194 194 } … … 214 214 } 215 215 216 $this->assertSameSets( $ found_post_ids, $expected);216 $this->assertSameSets( $expected, $found_post_ids ); 217 217 } 218 218 … … 232 232 $expected = array(); 233 233 234 $this->assertSameSets( $ found_post_ids, $expected);234 $this->assertSameSets( $expected, $found_post_ids ); 235 235 } 236 236 … … 256 256 } 257 257 258 $this->assertSameSets( $ found_post_ids, $expected);258 $this->assertSameSets( $expected, $found_post_ids ); 259 259 } 260 260 … … 274 274 $expected = array(); 275 275 276 $this->assertSameSets( $ found_post_ids, $expected);276 $this->assertSameSets( $expected, $found_post_ids ); 277 277 } 278 278 … … 295 295 } 296 296 297 $this->assertSameSets( $ found_post_ids, $expected);297 $this->assertSameSets( $expected, $found_post_ids ); 298 298 } 299 299 … … 313 313 $expected = array(); 314 314 315 $this->assertSameSets( $ found_post_ids, $expected);315 $this->assertSameSets( $expected, $found_post_ids ); 316 316 } 317 317 … … 330 330 $expected = self::$post_ids[5]; 331 331 332 $this->assertSameSets( $ found_post_ids, $expected);332 $this->assertSameSets( $expected, $found_post_ids ); 333 333 } 334 334 … … 354 354 } 355 355 356 $this->assertSameSets( $ found_post_ids, $expected);356 $this->assertSameSets( $expected, $found_post_ids ); 357 357 } 358 358 … … 369 369 $expected = self::$post_ids[5]; 370 370 371 $this->assertSameSets( $ found_post_ids, $expected);371 $this->assertSameSets( $expected, $found_post_ids ); 372 372 } 373 373 } -
trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php
r52184 r52248 393 393 $actual[] = $data['menu_order']; 394 394 } 395 $this->assertSame( $ actual, $expected);395 $this->assertSame( $expected, $actual ); 396 396 } 397 397 -
trunk/tests/phpunit/tests/widgets/wpWidgetCustomHtml.php
r52010 r52248 186 186 ); 187 187 $result = $widget->update( $instance, array() ); 188 $this->assertSame( $ result, $expected);188 $this->assertSame( $expected, $result ); 189 189 190 190 // Make sure KSES is applying as expected. … … 194 194 $expected['content'] = $instance['content']; 195 195 $result = $widget->update( $instance, array() ); 196 $this->assertSame( $ result, $expected);196 $this->assertSame( $expected, $result ); 197 197 remove_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ) ); 198 198 … … 202 202 $expected['content'] = wp_kses_post( $instance['content'] ); 203 203 $result = $widget->update( $instance, array() ); 204 $this->assertSame( $ result, $expected);204 $this->assertSame( $expected, $result ); 205 205 remove_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10 ); 206 206 } -
trunk/tests/phpunit/tests/widgets/wpWidgetMedia.php
r52010 r52248 245 245 ); 246 246 $result = $widget->update( $expected, $instance ); 247 $this->assertSame( $ result, $expected);247 $this->assertSame( $expected, $result ); 248 248 249 249 // Should filter invalid attachment ID. … … 261 261 ); 262 262 $result = $widget->update( $expected, $instance ); 263 $this->assertSame( $ result, $expected);263 $this->assertSame( $expected, $result ); 264 264 265 265 // Should filter invalid attachment url. … … 277 277 ); 278 278 $result = $widget->update( $expected, $instance ); 279 $this->assertSame( $ result, $expected);279 $this->assertSame( $expected, $result ); 280 280 281 281 // Should filter invalid attachment title. -
trunk/tests/phpunit/tests/widgets/wpWidgetMediaAudio.php
r52010 r52248 126 126 ); 127 127 $result = $widget->update( $expected, $instance ); 128 $this->assertSame( $ result, $expected);128 $this->assertSame( $expected, $result ); 129 129 130 130 // Should filter invalid attachment ID. … … 142 142 ); 143 143 $result = $widget->update( $expected, $instance ); 144 $this->assertSame( $ result, $expected);144 $this->assertSame( $expected, $result ); 145 145 146 146 // Should filter invalid attachment url. … … 159 159 ); 160 160 $result = $widget->update( $expected, $instance ); 161 $this->assertSame( $ result, $expected);161 $this->assertSame( $expected, $result ); 162 162 163 163 // Should filter invalid loop setting. … … 175 175 ); 176 176 $result = $widget->update( $expected, $instance ); 177 $this->assertSame( $ result, $expected);177 $this->assertSame( $expected, $result ); 178 178 179 179 // Should filter invalid attachment title. … … 191 191 ); 192 192 $result = $widget->update( $expected, $instance ); 193 $this->assertSame( $ result, $expected);193 $this->assertSame( $expected, $result ); 194 194 195 195 // Should filter invalid preload setting. -
trunk/tests/phpunit/tests/widgets/wpWidgetMediaImage.php
r52010 r52248 133 133 ); 134 134 $result = $widget->update( $expected, $instance ); 135 $this->assertSame( $ result, $expected);135 $this->assertSame( $expected, $result ); 136 136 137 137 // Should filter invalid attachment ID. … … 149 149 ); 150 150 $result = $widget->update( $expected, $instance ); 151 $this->assertSame( $ result, $expected);151 $this->assertSame( $expected, $result ); 152 152 153 153 // Should filter invalid attachment url. … … 166 166 ); 167 167 $result = $widget->update( $expected, $instance ); 168 $this->assertSame( $ result, $expected);168 $this->assertSame( $expected, $result ); 169 169 170 170 // Should filter invalid attachment title. … … 182 182 ); 183 183 $result = $widget->update( $expected, $instance ); 184 $this->assertSame( $ result, $expected);184 $this->assertSame( $expected, $result ); 185 185 186 186 // Should filter invalid image size. … … 198 198 ); 199 199 $result = $widget->update( $expected, $instance ); 200 $this->assertSame( $ result, $expected);200 $this->assertSame( $expected, $result ); 201 201 202 202 // Should filter invalid image width. … … 214 214 ); 215 215 $result = $widget->update( $expected, $instance ); 216 $this->assertSame( $ result, $expected);216 $this->assertSame( $expected, $result ); 217 217 218 218 // Should filter invalid image height. … … 230 230 ); 231 231 $result = $widget->update( $expected, $instance ); 232 $this->assertSame( $ result, $expected);232 $this->assertSame( $expected, $result ); 233 233 234 234 // Should filter invalid image caption. … … 251 251 ); 252 252 $result = $widget->update( $expected, $instance ); 253 $this->assertSame( $ result, $expected);253 $this->assertSame( $expected, $result ); 254 254 255 255 // Should filter invalid alt text. … … 272 272 ); 273 273 $result = $widget->update( $expected, $instance ); 274 $this->assertSame( $ result, $expected);274 $this->assertSame( $expected, $result ); 275 275 276 276 // Should filter invalid link type. … … 288 288 ); 289 289 $result = $widget->update( $expected, $instance ); 290 $this->assertSame( $ result, $expected);290 $this->assertSame( $expected, $result ); 291 291 292 292 // Should filter invalid link url. … … 305 305 ); 306 306 $result = $widget->update( $expected, $instance ); 307 $this->assertSame( $ result, $expected);307 $this->assertSame( $expected, $result ); 308 308 309 309 // Should filter invalid image classes. … … 326 326 ); 327 327 $result = $widget->update( $expected, $instance ); 328 $this->assertSame( $ result, $expected);328 $this->assertSame( $expected, $result ); 329 329 330 330 // Should filter invalid link classes. … … 347 347 ); 348 348 $result = $widget->update( $expected, $instance ); 349 $this->assertSame( $ result, $expected);349 $this->assertSame( $expected, $result ); 350 350 351 351 // Should filter invalid rel text. … … 368 368 ); 369 369 $result = $widget->update( $expected, $instance ); 370 $this->assertSame( $ result, $expected);370 $this->assertSame( $expected, $result ); 371 371 372 372 // Should filter invalid link target. … … 384 384 ); 385 385 $result = $widget->update( $expected, $instance ); 386 $this->assertSame( $ result, $expected);386 $this->assertSame( $expected, $result ); 387 387 388 388 // Should filter invalid image title. -
trunk/tests/phpunit/tests/widgets/wpWidgetMediaVideo.php
r52010 r52248 127 127 ); 128 128 $result = $widget->update( $expected, $instance ); 129 $this->assertSame( $ result, $expected);129 $this->assertSame( $expected, $result ); 130 130 131 131 // Should filter invalid attachment ID. … … 143 143 ); 144 144 $result = $widget->update( $expected, $instance ); 145 $this->assertSame( $ result, $expected);145 $this->assertSame( $expected, $result ); 146 146 147 147 // Should filter invalid attachment url. … … 160 160 ); 161 161 $result = $widget->update( $expected, $instance ); 162 $this->assertSame( $ result, $expected);162 $this->assertSame( $expected, $result ); 163 163 164 164 // Should filter invalid loop setting. … … 176 176 ); 177 177 $result = $widget->update( $expected, $instance ); 178 $this->assertSame( $ result, $expected);178 $this->assertSame( $expected, $result ); 179 179 180 180 // Should filter invalid attachment title. … … 192 192 ); 193 193 $result = $widget->update( $expected, $instance ); 194 $this->assertSame( $ result, $expected);194 $this->assertSame( $expected, $result ); 195 195 196 196 // Should filter invalid preload setting.
Note: See TracChangeset
for help on using the changeset viewer.