Make WordPress Core

Changeset 43866


Ignore:
Timestamp:
11/05/2018 02:46:14 AM (8 years ago)
Author:
pento
Message:

Tests: Skip symlinked theme file tests if the links could not be created, or if symlink() is not available

Merges [42812,42819] to the 5.0 branch.

Props SergeyBiryukov.
Fixes #43508.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/tests/phpunit/tests/link/themeFile.php

    r39918 r43866  
    66
    77        public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
    8                 symlink( DIR_TESTDATA . '/theme-file-parent', WP_CONTENT_DIR . '/themes/theme-file-parent' );
    9                 symlink( DIR_TESTDATA . '/theme-file-child', WP_CONTENT_DIR . '/themes/theme-file-child' );
     8                if ( ! function_exists( 'symlink' ) ) {
     9                        self::markTestSkipped( 'symlink() is not available.' );
     10                }
     11                if ( ! @symlink( DIR_TESTDATA . '/theme-file-parent', WP_CONTENT_DIR . '/themes/theme-file-parent' ) ) {
     12                        self::markTestSkipped( 'Could not create parent symlink.' );
     13                }
     14                if ( ! @symlink( DIR_TESTDATA . '/theme-file-child', WP_CONTENT_DIR . '/themes/theme-file-child' ) ) {
     15                        self::markTestSkipped( 'Could not create child symlink.' );
     16                }
    1017        }
    1118
Note: See TracChangeset for help on using the changeset viewer.