Skip to content
Merged
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/Unit/Admin/Options_Form_Generator_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function test_dont_generate_options_input_from_empty_options() {
'option_1' => [],
];

$this->assertEmpty( $this->instance->generate_options_input( $options ) );
$this->assertSame( '', $this->instance->generate_options_input( $options ) );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Admin/Options_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function test_get_options_for_first_tab_and_fieldset() {
public function test_get_options_for_non_existing_tab() {
$options = $this->instance->get_options_for_tab( 'tab3' );

$this->assertEmpty( $options );
$this->assertSame( [], $options );
}

/**
Expand All @@ -154,7 +154,7 @@ public function test_get_options_for_non_existing_tab() {
public function test_get_options_for_non_existing_fieldset() {
$options = $this->instance->get_options_for_tab( 'tab1', 'fieldset2' );

$this->assertEmpty( $options );
$this->assertSame( [], $options );
}

/**
Expand Down Expand Up @@ -191,6 +191,6 @@ public function test_get_valid_option() {
public function test_get_invalid_option() {
$options = $this->instance->get_option( 'option_4' );

$this->assertEmpty( $options );
$this->assertSame( [], $options );
}
}
4 changes: 2 additions & 2 deletions tests/WP/Admin_Functions_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ public function test_create_duplicate_respects_taxonomies_blacklist() {
$new_tags = \wp_get_post_tags( $new_id );

$this->assertContains( $category_id, $new_categories );
$this->assertEmpty( $new_tags );
$this->assertSame( [], $new_tags );
}

/**
Expand Down Expand Up @@ -1226,7 +1226,7 @@ public function test_create_duplicate_does_not_copy_thumbnail_when_disabled() {
$new_id = \duplicate_post_create_duplicate( $original );

// Thumbnail should NOT be copied when disabled.
$this->assertEmpty( \get_post_meta( $new_id, '_thumbnail_id', true ) );
$this->assertSame( '', \get_post_meta( $new_id, '_thumbnail_id', true ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/WP/Handlers/Rest_API_Handler_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function test_remove_original_success() {
$this->assertTrue( $data['success'] );

// Verify the meta is removed.
$this->assertEmpty( \get_post_meta( $copy_post, '_dp_original', true ) );
$this->assertSame( '', \get_post_meta( $copy_post, '_dp_original', true ) );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/WP/Handlers/Save_Post_Handler_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function test_delete_on_save_post_removes_meta_when_checkbox_checked() {
$this->instance->delete_on_save_post( $copy_post );

// Verify the meta is removed.
$this->assertEmpty( \get_post_meta( $copy_post, '_dp_original', true ) );
$this->assertSame( '', \get_post_meta( $copy_post, '_dp_original', true ) );
}

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/WP/Post_Republisher_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public function test_delete_copy_permanently_deletes_copy() {
$this->assertNull( \get_post( $copy_id ) );

// Verify the meta is cleaned up from the original.
$this->assertEmpty( \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );
$this->assertSame( '', \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );
}

/**
Expand Down Expand Up @@ -429,7 +429,7 @@ public function test_republish_scheduled_post_republishes_copy() {
$this->assertNull( \get_post( $copy->ID ) );

// Verify meta cleanup.
$this->assertEmpty( \get_post_meta( $original_id, '_dp_has_rewrite_republish_copy', true ) );
$this->assertSame( '', \get_post_meta( $original_id, '_dp_has_rewrite_republish_copy', true ) );
}

/**
Expand Down Expand Up @@ -963,7 +963,7 @@ public function test_republish_replaces_taxonomies_from_copy() {

// Note: WordPress may assign default category.
$this->assertNotContains( $category_id, $updated_categories );
$this->assertEmpty( $updated_tags );
$this->assertSame( [], $updated_tags );
}

/**
Expand Down Expand Up @@ -1280,7 +1280,7 @@ public function test_clean_up_when_copy_manually_deleted_removes_original_meta()
$this->instance->clean_up_when_copy_manually_deleted( $copy->ID );

// Verify the meta is removed from the original.
$this->assertEmpty( \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );
$this->assertSame( '', \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );
}

/**
Expand Down Expand Up @@ -1358,7 +1358,7 @@ public function test_delete_copy_cleans_meta_even_if_wp_delete_post_fails() {
$this->assertNotNull( $still_existing_copy );

// Verify the meta was still cleaned up from the original.
$this->assertEmpty( \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );
$this->assertSame( '', \get_post_meta( $original->ID, '_dp_has_rewrite_republish_copy', true ) );

// Clean up manually.
\wp_delete_post( $copy_id, true );
Expand Down