mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 12:43:14 +00:00
Remove environmental variable no longer needed
All the tests now make use of PHP's built-in web server and the variable is no longer needed to determine if the development server is being used.
This commit is contained in:
@@ -68,12 +68,15 @@ class Test
|
||||
|
||||
public static function getTestUrl($port)
|
||||
{
|
||||
if (getenv('PHP_CURL_CLASS_LOCAL_TEST') === 'yes' ||
|
||||
in_array(getenv('CI_PHP_VERSION'), ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', 'nightly'])) {
|
||||
return 'http://127.0.0.1:' . $port . '/';
|
||||
} else {
|
||||
return self::TEST_URL;
|
||||
}
|
||||
// Return url pointing to a test server running on the specified port.
|
||||
// To avoid installing and configuring a web server for the tests, PHP's
|
||||
// built-in development server is used. As each development server can
|
||||
// only handle one request at a time (single-threaded) and some tests
|
||||
// expect the server to handle requests simultaneously, multiple
|
||||
// instances are run on different ports. With this setup, requests in
|
||||
// the test can be made to the various port urls without having to be
|
||||
// handled sequentially.
|
||||
return 'http://127.0.0.1:' . $port . '/';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@ set -x
|
||||
# Let test server know we should allow testing.
|
||||
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
|
||||
|
||||
# Let test server know this is a local test.
|
||||
export PHP_CURL_CLASS_LOCAL_TEST="yes"
|
||||
|
||||
# Start test servers. Run servers on different ports to allow simultaneous
|
||||
# requests without blocking.
|
||||
server_count=7
|
||||
|
||||
Reference in New Issue
Block a user