From 593257683d9741b1cf1862dd421d244e90751d3a Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 6 Dec 2020 16:36:26 +0000 Subject: [PATCH] tests --- .travis.yml | 6 +++--- tests/parse_args.php | 12 ++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1492085..7a9b1dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ dist: xenial env: global: - # temp workaround to xdebug 3.0.0 bug - - XDEBUG_MODE=coverage - LOCALSERVER=localhost - URI=/demo/server/server.php - HTTPSSERVER=localhost @@ -20,6 +18,8 @@ env: - HTTPSIGNOREPEER=1 - SSLVERSION=0 - DEBUG=0 + # temp workaround to xdebug 3.0.0 bug + - XDEBUG_MODE=coverage php: #- 5.3 @@ -49,7 +49,7 @@ install: # Re-enable xdebug for when we need to generate code coverage - export COVERAGE_OPTS="" - - if [ "$TRAVIS_PHP_VERSION" = "7.3" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI" && export COVERAGE_OPTS="--coverage-clover=coverage.clover"; fi + - if [ "$TRAVIS_PHP_VERSION" = "7.4" -a "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI.bak" "$XDEBUG_INI" && export COVERAGE_OPTS="--coverage-clover=coverage.clover"; fi before_script: # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against diff --git a/tests/parse_args.php b/tests/parse_args.php index 6dc9b82..d9b3d5a 100644 --- a/tests/parse_args.php +++ b/tests/parse_args.php @@ -36,15 +36,11 @@ class argParser 'LOCALPATH' => __DIR__, ); - // check for command line vs web page input params + // check for command line (env vars) vs. web page input params if (!isset($_SERVER['REQUEST_METHOD'])) { - if (isset($argv)) { - foreach ($argv as $param) { - $param = explode('=', $param); - if (count($param) > 1) { - $pname = strtoupper(ltrim($param[0], '-')); - $$pname = $param[1]; - } + foreach($_SERVER as $key => $val) { + if (array_key_exists($key, $args)) { + $$key = $val; } } } else { -- 2.43.0