mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-02 13:48:47 +00:00
@@ -27,8 +27,6 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
bash tests/before_script.sh
|
||||
bash tests/script.sh
|
||||
run: bash tests/ci.sh
|
||||
env:
|
||||
CI_PHP_VERSION: ${{ matrix.php }}
|
||||
|
||||
@@ -3,12 +3,12 @@ require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Curl\MultiCurl;
|
||||
|
||||
$server_count = 5;
|
||||
$server_count = 7;
|
||||
$urls = [];
|
||||
$port = 8000;
|
||||
for ($i = 0; $i < $server_count; $i++) {
|
||||
$port += 1;
|
||||
$urls[] = 'http://localhost:' . $port . '/';
|
||||
$port += 1;
|
||||
}
|
||||
|
||||
$multi_curl = new MultiCurl();
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
start_php_servers() {
|
||||
for i in $(seq 0 6); do
|
||||
port=8000
|
||||
(( port += $i ))
|
||||
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
|
||||
done
|
||||
}
|
||||
|
||||
set -x
|
||||
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
|
||||
php -r "var_dump(phpversion());"
|
||||
php -r "var_dump(curl_version());"
|
||||
|
||||
composer self-update
|
||||
composer install --prefer-source --no-interaction
|
||||
|
||||
# Let test server know we should allow testing.
|
||||
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
|
||||
|
||||
if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "7.2" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "7.3" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "7.4" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "8.0" ]]; then
|
||||
start_php_servers
|
||||
elif [[ "${CI_PHP_VERSION}" == "nightly" ]]; then
|
||||
start_php_servers
|
||||
fi
|
||||
@@ -1,3 +1,25 @@
|
||||
set -x
|
||||
|
||||
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
|
||||
php -r "var_dump(phpversion());"
|
||||
php -r "var_dump(curl_version());"
|
||||
|
||||
composer self-update
|
||||
composer install --prefer-source --no-interaction
|
||||
|
||||
# Let test server know we should allow testing.
|
||||
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
|
||||
|
||||
# Start test servers. Run servers on different ports to allow simultaneous
|
||||
# requests without blocking.
|
||||
server_count=7
|
||||
for i in $(seq 0 $(("${server_count}" - 1))); do
|
||||
port=8000
|
||||
(( port += $i ))
|
||||
|
||||
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
|
||||
done
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "${SCRIPT_DIR}"
|
||||
|
||||
@@ -34,9 +56,6 @@ errors=()
|
||||
|
||||
source "check_syntax.sh"
|
||||
|
||||
# Let test server know we should allow testing.
|
||||
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
|
||||
|
||||
# Determine which phpunit to use.
|
||||
if [[ -f "../vendor/bin/phpunit" ]]; then
|
||||
phpunit_to_use="../vendor/bin/phpunit"
|
||||
+4
-4
@@ -180,22 +180,22 @@ p:last-child {
|
||||
<a href="https://github.com/php-curl-class/php-curl-class/releases/">
|
||||
<img
|
||||
alt=""
|
||||
src="https://img.shields.io/github/release/php-curl-class/php-curl-class.svg?style=flat-square">
|
||||
src="https://img.shields.io/github/release/php-curl-class/php-curl-class.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://github.com/php-curl-class/php-curl-class/blob/master/LICENSE">
|
||||
<img
|
||||
alt=""
|
||||
src="https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=flat-square">
|
||||
src="https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://github.com/php-curl-class/php-curl-class/actions/workflows/ci.yml">
|
||||
<img
|
||||
alt=""
|
||||
src="https://img.shields.io/github/workflow/status/php-curl-class/php-curl-class/ci?style=flat-square">
|
||||
src="https://img.shields.io/github/workflow/status/php-curl-class/php-curl-class/ci?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://github.com/php-curl-class/php-curl-class/releases/">
|
||||
<img
|
||||
alt=""
|
||||
src="https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=flat-square">
|
||||
src="https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=flat-square" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user