WordPress.org

Make WordPress Core

Changeset 51580


Ignore:
Timestamp:
08/07/2021 02:18:31 PM (4 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r51579 r51580  
    159159            }
    160160
    161             $this->assertTrue( is_dir( $dir . $theme['Template Dir'] ) );
    162             $this->assertTrue( is_dir( $dir . $theme['Stylesheet Dir'] ) );
     161            $this->assertDirectoryExists( $dir . $theme['Template Dir'] );
     162            $this->assertDirectoryExists( $dir . $theme['Stylesheet Dir'] );
    163163
    164164            $this->assertSame( 'publish', $theme['Status'] );
Note: See TracChangeset for help on using the changeset viewer.