mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Consistently pass the $force_delete parameter to wp_delete_attachment().
Convert some `wp_delete_post()` calls to `wp_delete_attachment()` to avoid an extra function call. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53464 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
82d1e32a10
commit
d67674512e
@ -52,7 +52,7 @@ class Tests_Media extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public static function tear_down_after_class() {
|
||||
wp_delete_post( self::$large_id, true );
|
||||
wp_delete_attachment( self::$large_id, true );
|
||||
parent::tear_down_after_class();
|
||||
}
|
||||
|
||||
@ -1306,7 +1306,7 @@ VIDEO;
|
||||
$post = get_post( $post_id );
|
||||
|
||||
// Clean up.
|
||||
wp_delete_attachment( $post_id );
|
||||
wp_delete_attachment( $post_id, true );
|
||||
|
||||
$this->assertSame( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $post->post_excerpt );
|
||||
}
|
||||
@ -1345,7 +1345,7 @@ VIDEO;
|
||||
$post = get_post( $post_id );
|
||||
|
||||
// Clean up.
|
||||
wp_delete_attachment( $post_id );
|
||||
wp_delete_attachment( $post_id, true );
|
||||
|
||||
$this->assertSame( 'This is a test', $post->post_title );
|
||||
}
|
||||
@ -1724,7 +1724,7 @@ EOF;
|
||||
}
|
||||
|
||||
// Remove the attachment.
|
||||
wp_delete_attachment( $id );
|
||||
wp_delete_attachment( $id, true );
|
||||
remove_filter( 'upload_dir', '_upload_dir_no_subdir' );
|
||||
}
|
||||
|
||||
@ -2819,8 +2819,8 @@ EOF;
|
||||
$expected = $uploads_dir['url'] . '/test-image-iptc.jpg';
|
||||
|
||||
// Clean up.
|
||||
wp_delete_attachment( $post_id );
|
||||
wp_delete_post( $parent_id );
|
||||
wp_delete_attachment( $post_id, true );
|
||||
wp_delete_post( $parent_id, true );
|
||||
|
||||
$this->assertSame( $expected, $url );
|
||||
}
|
||||
@ -2871,8 +2871,8 @@ EOF;
|
||||
$expected = $uploads_dir['url'] . '/test-image-iptc.jpg';
|
||||
|
||||
// Clean up.
|
||||
wp_delete_attachment( $post_id );
|
||||
wp_delete_post( $parent_id );
|
||||
wp_delete_attachment( $post_id, true );
|
||||
wp_delete_post( $parent_id, true );
|
||||
|
||||
$this->assertSame( $expected, $url );
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ class Tests_Post_Thumbnail_Template extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public static function tear_down_after_class() {
|
||||
wp_delete_post( self::$attachment_id, true );
|
||||
wp_delete_attachment( self::$attachment_id, true );
|
||||
parent::tear_down_after_class();
|
||||
}
|
||||
|
||||
|
||||
@ -520,7 +520,7 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
|
||||
wp_delete_post( $post_id, true );
|
||||
wp_delete_post( $page_id, true );
|
||||
wp_delete_term( $tag_id, 'tags' );
|
||||
wp_delete_attachment( $media_id );
|
||||
wp_delete_attachment( $media_id, true );
|
||||
wp_delete_comment( $comment_id );
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user