Skip to content

Commit

Permalink
pts-core: Fix check_tests breaking on pre PHP 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellarabel committed Feb 1, 2021
1 parent 43f92bb commit 81d2f14
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions pts-core/commands/check_tests.php
Expand Up @@ -49,18 +49,6 @@ class check_tests implements pts_option_interface
const V_DUPLICATE = "duplicate"; // indicates if we have already downloaded the file as part of an earlier test profile version
const V_REDIRECT = "redirectTo"; // If a url is redirected, this is the original url location. V_URL will contain the redirection

// Don't use const for these as it breaks PHP 5.6
// See https://stackoverflow.com/questions/10969342/parse-error-syntax-error-unexpected-expecting-or for details

// File contains a list of all the tests that have already been tested
protected static $TESTED_FILES = PTS_OPENBENCHMARKING_SCRATCH_PATH . 'check-tests-tested.txt';

// The file holding the final json results
protected static $JSON_FILE = PTS_OPENBENCHMARKING_SCRATCH_PATH . 'check-tests-results.json';

// Downloaded file from vendors
protected static $DOWNLOADED_VENDOR_FILES = PTS_OPENBENCHMARKING_SCRATCH_PATH . "checkTestsDownloads" . "/";

/**
* Determines if the test profile is valid. If invalid 'Invalid Arguement' Problem reported.
* */
Expand All @@ -80,6 +68,19 @@ public static function argument_checks()
*/
public static function run($r)
{

// Don't use const for these as it breaks PHP 5.6
// See https://stackoverflow.com/questions/10969342/parse-error-syntax-error-unexpected-expecting-or for details

// File contains a list of all the tests that have already been tested
protected static $TESTED_FILES = PTS_OPENBENCHMARKING_SCRATCH_PATH . 'check-tests-tested.txt';

// The file holding the final json results
protected static $JSON_FILE = PTS_OPENBENCHMARKING_SCRATCH_PATH . 'check-tests-results.json';

// Downloaded file from vendors
protected static $DOWNLOADED_VENDOR_FILES = PTS_OPENBENCHMARKING_SCRATCH_PATH . "checkTestsDownloads" . "/";

if (!function_exists('curl_init')) {
echo pts_client::cli_colored_text("Test Failed. cURL must be installed to proceed." . PHP_EOL . PHP_EOL, 'red', true);
return false;
Expand Down

0 comments on commit 81d2f14

Please sign in to comment.