Skip to content

Commit d6f69d6

Browse files
committed
Add assertions for successful attachment creation
1 parent f728cfb commit d6f69d6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/phpunit/tests/media/wpDeleteAttachmentHeicCompanionFile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function tear_down(): void {
1919
*/
2020
public function test_deletes_heic_file_recorded_in_metadata_original(): void {
2121
$attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' );
22+
$this->assertIsInt( $attachment_id );
2223

2324
$attached_file = get_attached_file( $attachment_id, true );
2425
$dir = dirname( $attached_file );
@@ -44,6 +45,7 @@ public function test_deletes_heic_file_recorded_in_metadata_original(): void {
4445
*/
4546
public function test_noop_when_metadata_original_is_missing(): void {
4647
$attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' );
48+
$this->assertIsInt( $attachment_id );
4749

4850
// Sanity: no 'original' key on freshly-created metadata.
4951
$metadata = wp_get_attachment_metadata( $attachment_id, true );
@@ -63,6 +65,7 @@ public function test_noop_when_metadata_original_is_missing(): void {
6365
*/
6466
public function test_noop_when_metadata_original_is_not_a_string(): void {
6567
$attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/canola.jpg' );
68+
$this->assertIsInt( $attachment_id );
6669
$attached_file = get_attached_file( $attachment_id, true );
6770

6871
$metadata = wp_get_attachment_metadata( $attachment_id, true );

0 commit comments

Comments
 (0)