Changeset 54073 for trunk/tests/phpunit/tests/ajax/MediaEdit.php
- Timestamp:
- 09/05/2022 07:22:27 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/MediaEdit.php
r53561 r54073 98 98 $file_path = dirname( get_attached_file( $id ) ); 99 99 100 $files_that_should_not_exist = array(); 101 100 102 foreach ( $sizes1 as $key => $size ) { 101 103 if ( $sizes2[ $key ]['file'] !== $size['file'] ) { 102 $files_that_should nt_exist[] = $file_path . '/' . $size['file'];104 $files_that_should_not_exist[] = $file_path . '/' . $size['file']; 103 105 } 104 106 } 105 107 106 foreach ( $files_that_shouldnt_exist as $file ) { 107 $this->assertFileDoesNotExist( $file, 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' ); 108 if ( ! empty( $files_that_should_not_exist ) ) { 109 foreach ( $files_that_should_not_exist as $file ) { 110 $this->assertFileDoesNotExist( $file, 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' ); 111 } 112 } else { 113 /* 114 * This assertion will always pass due to the "if" condition, but prevents this test 115 * from being marked as "risky" due to the test not performing any assertions. 116 */ 117 $this->assertSame( array(), $files_that_should_not_exist ); 108 118 } 109 119 }
Note: See TracChangeset
for help on using the changeset viewer.