Make WordPress Core


Ignore:
Timestamp:
09/18/2024 09:04:48 PM (14 months ago)
Author:
hellofromTonya
Message:

Tests: Use file paths independent of OS-specifics assertion or helper.

Use WP_UnitTestCase_Base::assertSamePathIgnoringDirectorySeparators() and WP_UnitTestCase_Base::normalizeDirectorySeparatorsInPath() in existing tests.

Follow-up to [59057], [57753], [57215], [56635], [48937], [25002].

Props jrf.
See #61530.

File:
1 edited

Legend:

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

    r59054 r59061  
    926926    public function test_get_stylesheet_directory() {
    927927        switch_theme( 'block-theme-child' );
    928         $this->assertSame( realpath( DIR_TESTDATA ) . '/themedir1/block-theme-child', get_stylesheet_directory() );
     928        $this->assertSamePathIgnoringDirectorySeparators( realpath( DIR_TESTDATA ) . '/themedir1/block-theme-child', get_stylesheet_directory() );
    929929    }
    930930
     
    938938    public function test_get_template_directory() {
    939939        switch_theme( 'block-theme-child' );
    940         $this->assertSame( realpath( DIR_TESTDATA ) . '/themedir1/block-theme', get_template_directory() );
     940        $this->assertSamePathIgnoringDirectorySeparators( realpath( DIR_TESTDATA ) . '/themedir1/block-theme', get_template_directory() );
    941941    }
    942942
Note: See TracChangeset for help on using the changeset viewer.