From fa2c313224c2b52c8392f9863e4a0a1cacfb4de3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 7 Aug 2021 14:18:31 +0000 Subject: [PATCH] Tests: Use more appropriate assertions in `get_themes()` tests. This replaces instances of `assertTrue( is_dir( ... ) )` with `assertDirectoryExists()` to use native PHPUnit functionality. The `assertDirectoryExists()` method was introduced in PHPUnit 5.6. As the minimum supported PHPUnit version has been raised to PHPUnit 5.7.21, it can now be used. Follow-up to [51543], [51574], [51579]. Props jrf. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51580 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index d7e81db033..62cadb62b0 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -158,8 +158,8 @@ class Tests_Theme extends WP_UnitTestCase { $this->assertFileIsReadable( $dir . $file ); } - $this->assertTrue( is_dir( $dir . $theme['Template Dir'] ) ); - $this->assertTrue( is_dir( $dir . $theme['Stylesheet Dir'] ) ); + $this->assertDirectoryExists( $dir . $theme['Template Dir'] ); + $this->assertDirectoryExists( $dir . $theme['Stylesheet Dir'] ); $this->assertSame( 'publish', $theme['Status'] );