Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/phpunit/tests/customize/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3041,7 +3041,7 @@ public function test_return_url() {

$url = 'http://badreferer.example.com/';
$_SERVER['HTTP_REFERER'] = wp_slash( $url );
$this->assertNotEquals( $url, $this->manager->get_return_url() );
$this->assertNotSame( $url, $this->manager->get_return_url() );
$this->assertSame( $preview_url, $this->manager->get_return_url() );

$this->manager->set_return_url( admin_url( 'edit.php?trashed=1' ) );
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/customize/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ public function test_preview_standard_types_non_multidimensional() {
$message = 'Initial value should be overridden because initial preview() was no-op due to setting having existing value and/or post value was absent.';
$this->assertSame( $overridden_value, call_user_func( $type_options['getter'], $name ), $message );
$this->assertSame( $overridden_value, $setting->value(), $message );
$this->assertNotEquals( $initial_value, $setting->value(), $message );
$this->assertNotSame( $initial_value, $setting->value(), $message );

// Non-multidimensional: Ensure that setting a post value *after* preview() is called results in the post value being seen (deferred preview).
$post_value = "post_value_for_{$setting->id}_set_after_preview_called";
$this->assertSame( 0, did_action( "customize_post_value_set_{$setting->id}" ) );
$this->manager->set_post_value( $setting->id, $post_value );
$this->assertSame( 1, did_action( "customize_post_value_set_{$setting->id}" ) );
$this->assertNotEquals( $overridden_value, $setting->value() );
$this->assertNotSame( $overridden_value, $setting->value() );
$this->assertSame( $post_value, call_user_func( $type_options['getter'], $name ) );
$this->assertSame( $post_value, $setting->value() );

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ public function data_wp_is_json_media_type() {
*/
public function test_wp_get_default_extension_for_mime_type() {
$this->assertSame( 'jpg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpg not returned as default extension for "image/jpeg"' );
$this->assertNotEquals( 'jpeg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpeg should not be returned as default extension for "image/jpeg"' );
$this->assertNotSame( 'jpeg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpeg should not be returned as default extension for "image/jpeg"' );
$this->assertSame( 'png', wp_get_default_extension_for_mime_type( 'image/png' ), 'png not returned as default extension for "image/png"' );
$this->assertFalse( wp_get_default_extension_for_mime_type( 'wibble/wobble' ), 'false not returned for unrecognized mime type' );
$this->assertFalse( wp_get_default_extension_for_mime_type( '' ), 'false not returned when empty string as mime type supplied' );
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/icons/wpRestIconsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function test_get_items_search_includes_label() {
$data = $response->get_data();

$this->assertSame( 200, $response->get_status() );
$this->assertEquals( array( 'core/at-symbol' ), array_column( $data, 'name' ) );
$this->assertSame( array( 'core/at-symbol' ), array_column( $data, 'name' ) );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/tests/image/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1014,12 +1014,12 @@ public function test_pdf_preview_doesnt_overwrite_existing_jpeg() {
$preview_path = $temp_dir . $metadata['sizes']['full']['file'];

// PDF preview didn't overwrite PDF.
$this->assertNotEquals( $pdf_path, $preview_path );
$this->assertNotSame( $pdf_path, $preview_path );
// PDF preview didn't overwrite JPG with same name.
$this->assertNotEquals( $jpg1_path, $preview_path );
$this->assertNotSame( $jpg1_path, $preview_path );
$this->assertSame( 'asdf', file_get_contents( $jpg1_path ) );
// PDF preview didn't overwrite PDF preview with same name.
$this->assertNotEquals( $jpg2_path, $preview_path );
$this->assertNotSame( $jpg2_path, $preview_path );
$this->assertSame( 'fdsa', file_get_contents( $jpg2_path ) );

// Cleanup.
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function test_wp_count_posts_insert_invalidation() {

$post = get_post( $post_ids[ $key ] );
$this->assertSame( 'draft', $post->post_status );
$this->assertNotEquals( 'publish', $post->post_status );
$this->assertNotSame( 'publish', $post->post_status );

$after_draft_counts = wp_count_posts();
$this->assertSame( '1', $after_draft_counts->draft );
Expand All @@ -294,7 +294,7 @@ public function test_wp_count_posts_trash_invalidation() {

$post = get_post( $post_ids[ $key ] );
$this->assertSame( 'trash', $post->post_status );
$this->assertNotEquals( 'publish', $post->post_status );
$this->assertNotSame( 'publish', $post->post_status );

$after_trash_counts = wp_count_posts();
$this->assertSame( '1', $after_trash_counts->trash );
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/tests/rest-api/rest-users-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ public function test_update_user_role() {
$new_data = $response->get_data();

$this->assertSame( 'editor', $new_data['roles'][0] );
$this->assertNotEquals( 'administrator', $new_data['roles'][0] );
$this->assertNotSame( 'administrator', $new_data['roles'][0] );

$user = get_userdata( $user_id );
$this->assertArrayHasKey( 'editor', $user->caps );
Expand Down Expand Up @@ -2090,7 +2090,7 @@ public function test_update_user_role_privilege_deescalation_multisite() {

$new_data = $response->get_data();
$this->assertSame( 'editor', $new_data['roles'][0] );
$this->assertNotEquals( 'administrator', $new_data['roles'][0] );
$this->assertNotSame( 'administrator', $new_data['roles'][0] );

$user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );

Expand All @@ -2104,7 +2104,7 @@ public function test_update_user_role_privilege_deescalation_multisite() {

$new_data = $response->get_data();
$this->assertSame( 'editor', $new_data['roles'][0] );
$this->assertNotEquals( 'administrator', $new_data['roles'][0] );
$this->assertNotSame( 'administrator', $new_data['roles'][0] );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function test_pagination_headers(): void {
$this->assertArrayHasKey( 'X-WP-TotalPages', $headers );

$total_categories = count( wp_get_ability_categories() );
$this->assertEquals( $total_categories, (int) $headers['X-WP-Total'] );
$this->assertSame( $total_categories, (int) $headers['X-WP-Total'] );
$this->assertEquals( ceil( $total_categories / 10 ), (int) $headers['X-WP-TotalPages'] );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public function test_pagination_headers(): void {
$this->assertArrayHasKey( 'X-WP-TotalPages', $headers );

$total_abilities = count( wp_get_abilities() ) - 1; // Exclude the one that doesn't show in REST.
$this->assertEquals( $total_abilities, (int) $headers['X-WP-Total'] );
$this->assertSame( $total_abilities, (int) $headers['X-WP-Total'] );
$this->assertEquals( ceil( $total_abilities / 10 ), (int) $headers['X-WP-TotalPages'] );
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/script-modules/wpScriptModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ public function test_static_import_dependency_with_dynamic_imports_depending_on_
$preload_links = get_echo( array( wp_script_modules(), 'print_script_module_preloads' ) );
$script_modules = get_echo( array( wp_script_modules(), 'print_enqueued_script_modules' ) );

$this->assertEquals(
$this->assertSame(
array(
'static1' => '/static1.js',
'dynamic1' => '/dynamic1.js',
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ static function ( string $buffer ): string {

$processed_output = ob_get_clean(); // Obtain the output via the wrapper output buffer.
$this->assertIsString( $processed_output );
$this->assertNotEquals( $original_output, $processed_output );
$this->assertNotSame( $original_output, $processed_output );

$this->assertStringContainsString( '<!DOCTYPE html>', $processed_output, 'Expected processed output to contain string.' );
$this->assertStringContainsString( '<html lang="es">', $processed_output, 'Expected processed output to contain string.' );
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/term/wpInsertTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ public function test_wp_insert_term_with_and_without_accents() {

$this->assertIsInt( $t1 );
$this->assertIsInt( $t2 );
$this->assertNotEquals( $t1, $t2 );
$this->assertNotSame( $t1, $t2 );

$term_2 = get_term( $t2, 'wptests_tax' );
$this->assertSame( $t2, $term_2->term_id );
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/theme/themeDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function test_theme_dir_slashes() {
$this->assertCount( $size + 1, $GLOBALS['wp_theme_directories'] );

foreach ( $GLOBALS['wp_theme_directories'] as $dir ) {
$this->assertNotEquals( '/', substr( $dir, -1 ) );
$this->assertNotSame( '/', substr( $dir, -1 ) );
}

rmdir( WP_CONTENT_DIR . '/themes/foo' );
Expand Down
Loading