Make WordPress Core


Ignore:
Timestamp:
10/26/2018 03:54:02 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use DIR_TESTDATA in test_wp_set_script_translation().

__DIR__ is not available in PHP 5.2.x.

See #45103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/tests/phpunit/tests/dependencies/scripts.php

    r43825 r43828  
    774774        wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
    775775        wp_enqueue_script( 'test-example', '/wp-includes/js/script.js', array(), null );
    776         wp_set_script_translations( 'test-example', 'default',  __DIR__ . '/../../data/languages/' );
     776        wp_set_script_translations( 'test-example', 'default',  DIR_TESTDATA . '/languages/' );
    777777
    778778        $expected  = "<script type='text/javascript' src='/wp-includes/js/dist/wp-i18n.js'></script>";
    779779        $expected .= "\n<script type='text/javascript'>\n(function( translations ){" .
    780780                "wp.i18n.setLocaleData( translations.locale_data, \"default\" );" .
    781             "})(" . file_get_contents( __DIR__ . '/../../data/languages/default-en_US-813e104eb47e13dd4cc5af844c618754.json') . ");\n</script>\n";
     781            "})(" . file_get_contents( DIR_TESTDATA . '/languages/default-en_US-813e104eb47e13dd4cc5af844c618754.json') . ");\n</script>\n";
    782782        $expected .= "<script type='text/javascript' src='/wp-includes/js/script.js'></script>\n";
    783783
Note: See TracChangeset for help on using the changeset viewer.