diff --git a/tests/phpunit/tests/admin/includesUpdateCore.php b/tests/phpunit/tests/admin/includesUpdateCore.php index 82ecfa62fa..2eda876c39 100644 --- a/tests/phpunit/tests/admin/includesUpdateCore.php +++ b/tests/phpunit/tests/admin/includesUpdateCore.php @@ -29,6 +29,6 @@ class Tests_Admin_IncludesUpdateCore extends WP_UnitTestCase { * @param string $file File name. */ public function test_new_files_are_not_in_old_files_array_compiled( $file ) { - $this->assertFalse( file_exists( dirname( ABSPATH ) . '/build/' . $file ) ); + $this->assertFileNotExists( dirname( ABSPATH ) . '/build/' . $file ); } } diff --git a/tests/phpunit/tests/ajax/MediaEdit.php b/tests/phpunit/tests/ajax/MediaEdit.php index 2ec07562cc..0528299e80 100644 --- a/tests/phpunit/tests/ajax/MediaEdit.php +++ b/tests/phpunit/tests/ajax/MediaEdit.php @@ -94,7 +94,7 @@ class Tests_Ajax_MediaEdit extends WP_Ajax_UnitTestCase { } foreach ( $files_that_shouldnt_exist as $file ) { - $this->assertFalse( file_exists( $file ), 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' ); + $this->assertFileNotExists( $file, 'IMAGE_EDIT_OVERWRITE is leaving garbage image files behind.' ); } } } diff --git a/tests/phpunit/tests/dependencies/backbonejs.php b/tests/phpunit/tests/dependencies/backbonejs.php index e55431eaeb..4c276ad898 100644 --- a/tests/phpunit/tests/dependencies/backbonejs.php +++ b/tests/phpunit/tests/dependencies/backbonejs.php @@ -8,7 +8,7 @@ class Tests_Dependencies_Backbonejs extends WP_UnitTestCase { function test_exclusion_of_sourcemaps() { $file = ABSPATH . WPINC . '/js/backbone.min.js'; - $this->assertTrue( file_exists( $file ) ); + $this->assertFileExists( $file ); $contents = trim( file_get_contents( $file ) ); $this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' ); } diff --git a/tests/phpunit/tests/multisite/ms-files-rewriting.php b/tests/phpunit/tests/multisite/ms-files-rewriting.php index 38be416aac..62d666bd64 100644 --- a/tests/phpunit/tests/multisite/ms-files-rewriting.php +++ b/tests/phpunit/tests/multisite/ms-files-rewriting.php @@ -76,14 +76,14 @@ class Tests_Multisite_MS_Files_Rewriting extends WP_UnitTestCase { wpmu_delete_blog( $blog_id, true ); // The file on the main site should still exist. The file on the deleted site should not. - $this->assertTrue( file_exists( $file1['file'] ) ); - $this->assertFalse( file_exists( $file2['file'] ) ); + $this->assertFileExists( $file1['file'] ); + $this->assertFileNotExists( $file2['file'] ); wpmu_delete_blog( $blog_id, true ); // The file on the main site should still exist. The file on the deleted site should not. - $this->assertTrue( file_exists( $file1['file'] ) ); - $this->assertFalse( file_exists( $file2['file'] ) ); + $this->assertFileExists( $file1['file'] ); + $this->assertFileNotExists( $file2['file'] ); } } diff --git a/tests/phpunit/tests/multisite/site.php b/tests/phpunit/tests/multisite/site.php index 33d47a22b5..7387d95d98 100644 --- a/tests/phpunit/tests/multisite/site.php +++ b/tests/phpunit/tests/multisite/site.php @@ -285,14 +285,14 @@ class Tests_Multisite_Site extends WP_UnitTestCase { wpmu_delete_blog( $blog_id, true ); // The file on the main site should still exist. The file on the deleted site should not. - $this->assertTrue( file_exists( $file1['file'] ) ); - $this->assertFalse( file_exists( $file2['file'] ) ); + $this->assertFileExists( $file1['file'] ); + $this->assertFileNotExists( $file2['file'] ); wpmu_delete_blog( $blog_id, true ); // The file on the main site should still exist. The file on the deleted site should not. - $this->assertTrue( file_exists( $file1['file'] ) ); - $this->assertFalse( file_exists( $file2['file'] ) ); + $this->assertFileExists( $file1['file'] ); + $this->assertFileNotExists( $file2['file'] ); } function test_wpmu_update_blogs_date() { diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 9d8d57182d..a9136d1dfd 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -210,7 +210,7 @@ class Tests_Theme extends WP_UnitTestCase { $wp_theme = wp_get_theme( $this->theme_slug ); $this->assertNotEmpty( $wp_theme->get('License') ); $path_to_style_css = $wp_theme->get_theme_root() . '/' . $wp_theme->get_stylesheet() . '/style.css'; - $this->assertTrue( file_exists( $path_to_style_css ) ); + $this->assertFileExists( $path_to_style_css ); $theme_data = get_theme_data( $path_to_style_css ); $this->assertArrayHasKey( 'License', $theme_data ); $this->assertArrayNotHasKey( 'Not a Valid Key', $theme_data ); diff --git a/tests/phpunit/tests/theme/themeDir.php b/tests/phpunit/tests/theme/themeDir.php index ab43eec4da..ef6e64c210 100644 --- a/tests/phpunit/tests/theme/themeDir.php +++ b/tests/phpunit/tests/theme/themeDir.php @@ -246,8 +246,8 @@ class Tests_Theme_ThemeDir extends WP_UnitTestCase { @mkdir( WP_CONTENT_DIR . '/themes/foo' ); @mkdir( WP_CONTENT_DIR . '/themes/foo-themes' ); - $this->assertTrue( file_exists( WP_CONTENT_DIR . '/themes/foo' ) ); - $this->assertTrue( file_exists( WP_CONTENT_DIR . '/themes/foo-themes') ); + $this->assertFileExists( WP_CONTENT_DIR . '/themes/foo' ); + $this->assertFileExists( WP_CONTENT_DIR . '/themes/foo-themes' ); register_theme_directory( '/' );