WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/06/2021 12:25:53 PM (4 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme.php

    r49220 r51335  
    146146
    147147            // Template files should all exist.
    148             $this->assertTrue( is_array( $theme['Template Files'] ) );
    149             $this->assertTrue( count( $theme['Template Files'] ) > 0 );
     148            $this->assertIsArray( $theme['Template Files'] );
     149            $this->assertNotEmpty( $theme['Template Files'] );
    150150            foreach ( $theme['Template Files'] as $file ) {
    151151                $this->assertTrue( is_file( $dir . $file ) );
     
    154154
    155155            // CSS files should all exist.
    156             $this->assertTrue( is_array( $theme['Stylesheet Files'] ) );
    157             $this->assertTrue( count( $theme['Stylesheet Files'] ) > 0 );
     156            $this->assertIsArray( $theme['Stylesheet Files'] );
     157            $this->assertNotEmpty( $theme['Stylesheet Files'] );
    158158            foreach ( $theme['Stylesheet Files'] as $file ) {
    159159                $this->assertTrue( is_file( $dir . $file ) );
Note: See TracChangeset for help on using the changeset viewer.