Skip to content

Look for /tmp/wordpress-tests-lib in get_path_to_wp_test_dir() #12

@swissspidy

Description

@swissspidy

When using WP-CLI's scaffold command to set up WP integration tests, the install-wp-tests.sh bash script sets WP_TESTS_DIR to /tmp/wordpress-tests-lib.

get_path_to_wp_test_dir() does not currently check for that location, but instead requires setting the WP_TESTS_DIR environment variable manually.

I hereby propose adding such a check as a fallback in get_path_to_wp_test_dir().

Something like this:

$tests_dir = \realpath( sys_get_temp_dir() . '/wordpress-tests-lib' );
if ( $tests_dir !== false ) {
	return $normalize_path( $tests_dir ) . '/';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions