Skip to content

Commit e543cf1

Browse files
authored
Merge pull request php-curl-class#664 from zachborboa/master
Remove environmental variable no longer needed
2 parents 2e63c0d + 0031da7 commit e543cf1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/PHPCurlClass/Helper.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ public function chainRequests($first, $second, $data = [])
6868

6969
public static function getTestUrl($port)
7070
{
71-
if (getenv('PHP_CURL_CLASS_LOCAL_TEST') === 'yes' ||
72-
in_array(getenv('CI_PHP_VERSION'), ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', 'nightly'])) {
73-
return 'http://127.0.0.1:' . $port . '/';
74-
} else {
75-
return self::TEST_URL;
76-
}
71+
// Return url pointing to a test server running on the specified port.
72+
// To avoid installing and configuring a web server for the tests, PHP's
73+
// built-in development server is used. As each development server can
74+
// only handle one request at a time (single-threaded) and some tests
75+
// expect the server to handle requests simultaneously, multiple
76+
// instances are run on different ports. With this setup, requests in
77+
// the test can be made to the various port urls without having to be
78+
// handled sequentially.
79+
return 'http://127.0.0.1:' . $port . '/';
7780
}
7881
}
7982

tests/run.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ set -x
66
# Let test server know we should allow testing.
77
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
88

9-
# Let test server know this is a local test.
10-
export PHP_CURL_CLASS_LOCAL_TEST="yes"
11-
129
# Start test servers. Run servers on different ports to allow simultaneous
1310
# requests without blocking.
1411
server_count=7

0 commit comments

Comments
 (0)