Make WordPress Core


Ignore:
Timestamp:
09/18/2024 09:04:48 PM (5 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/block-template.php

    r58323 r59061  
    396396     */
    397397    public function test_get_block_templates_paths_dir_exists() {
    398         $theme_dir = get_template_directory();
     398        $theme_dir = $this->normalizeDirectorySeparatorsInPath( get_template_directory() );
    399399        // Templates in the current theme.
    400400        $templates = array(
     
    416416
    417417        $template_paths = _get_block_templates_paths( $theme_dir );
     418        $template_paths = array_map( array( $this, 'normalizeDirectorySeparatorsInPath' ), _get_block_templates_paths( $theme_dir ) );
     419
    418420        $this->assertSameSets( $expected_template_paths, $template_paths );
    419421    }
Note: See TracChangeset for help on using the changeset viewer.