Tests: Use more appropriate assertions in various tests.

This replaces instances of `assertTrue( is_array( ... ) )` with `assertIsArray()` to use native PHPUnit functionality.

Follow-up to [51331].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51335 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-07-06 12:25:53 +00:00
parent 67f31935d0
commit 24479f2141
8 changed files with 15 additions and 15 deletions
+4 -4
View File
@@ -145,16 +145,16 @@ class Tests_Theme extends WP_UnitTestCase {
$this->assertNotEmpty( $theme['Stylesheet'] );
// Template files should all exist.
$this->assertTrue( is_array( $theme['Template Files'] ) );
$this->assertTrue( count( $theme['Template Files'] ) > 0 );
$this->assertIsArray( $theme['Template Files'] );
$this->assertNotEmpty( $theme['Template Files'] );
foreach ( $theme['Template Files'] as $file ) {
$this->assertTrue( is_file( $dir . $file ) );
$this->assertTrue( is_readable( $dir . $file ) );
}
// CSS files should all exist.
$this->assertTrue( is_array( $theme['Stylesheet Files'] ) );
$this->assertTrue( count( $theme['Stylesheet Files'] ) > 0 );
$this->assertIsArray( $theme['Stylesheet Files'] );
$this->assertNotEmpty( $theme['Stylesheet Files'] );
foreach ( $theme['Stylesheet Files'] as $file ) {
$this->assertTrue( is_file( $dir . $file ) );
$this->assertTrue( is_readable( $dir . $file ) );