Make WordPress Core


Ignore:
Timestamp:
09/18/2024 04:16:19 PM (5 months ago)
Author:
hellofromTonya
Message:

Tests: Fix Tests_Theme tests to run (and pass) cross-OS.

Uses DIRECTORY_SEPARATOR in closures for cross-OS differences.

Follow-up to [56635].

Props jrf.
See #61530.

File:
1 edited

Legend:

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

    r57987 r59054  
    977977                'stylesheet_directory',
    978978                static function ( $dir ) {
    979                     return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir );
     979                    return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir );
    980980                },
    981981                '/fantasy-dir/block-theme',
     
    10371037                'template_directory',
    10381038                static function ( $dir ) {
    1039                     return str_replace( realpath( DIR_TESTDATA ) . '/themedir1', '/fantasy-dir', $dir );
     1039                    return str_replace( realpath( DIR_TESTDATA ) . DIRECTORY_SEPARATOR . 'themedir1', '/fantasy-dir', $dir );
    10401040                },
    10411041                '/fantasy-dir/block-theme',
Note: See TracChangeset for help on using the changeset viewer.