Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant.

Follow to the commit in WP Core e72fff9cef/wp-tests-config-sample.php

As previous version of wp-tests-config-sample.php can be downloaded with previous WP Core version, I keep replacement of `dirname( __FILE__ )`, and add replacement of `__DIR__`.
This commit is contained in:
kagg-design 2020-02-06 21:01:48 +02:00
parent ee48bb10bc
commit fcf38f11f4

View file

@ -116,6 +116,7 @@ install_test_suite() {
# remove all forward slashes in the end
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s:__DIR__ . '/src/':'${WP_CORE_DIR}/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php