ENHANCEMENT Log user constants during CI for debugging improvements

This commit is contained in:
Damian Mooyman 2017-08-23 14:20:39 +12:00
parent 376294f354
commit 2c34af72e1
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
3 changed files with 16 additions and 3 deletions

View File

@ -78,6 +78,9 @@ before_script:
# Bootstrap dependencies
- if [[ $PHPUNIT_TEST == cms ]] || [[ $BEHAT_TEST == cms ]]; then php ./cms/tests/bootstrap/mysite.php; fi
# Log constants to CI for debugging purposes
- php ./tests/dump_constants.php
# Start behat services
- if [[ $BEHAT_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi

View File

@ -2,7 +2,6 @@
use Dotenv\Dotenv;
use Dotenv\Exception\InvalidPathException;
use SilverStripe\Control\Util\IPUtils;
use SilverStripe\Core\TempFolder;
/**
@ -18,14 +17,14 @@ use SilverStripe\Core\TempFolder;
* See Director::baseFolder(). Can be overwritten by Config::modify()->set(Director::class, 'alternate_base_folder', ).
* - TEMP_FOLDER: Absolute path to temporary folder, used for manifest and template caches. Example: "/var/tmp"
* See getTempFolder(). No trailing slash.
* - ASSETS_DIR: Dir for assets folder. e.g. "assets"
* - ASSETS_PATH: Full path to assets folder. e.g. "/var/www/my-webroot/assets"
* - THEMES_DIR: Path relative to webroot, e.g. "themes"
* - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes"
* - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework"
* - FRAMEWORK_PATH:Absolute filepath, e.g. "/var/www/my-webroot/framework"
* - THIRDPARTY_DIR: Path relative to webroot, e.g. "framework/thirdparty"
* - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/thirdparty"
* - TRUSTED_PROXY: true or false, depending on whether the X-Forwarded-* HTTP
* headers from the given client are trustworthy (e.g. from a reverse proxy).
*/
require_once __DIR__ . '/functions.php';

11
tests/dump_constants.php Normal file
View File

@ -0,0 +1,11 @@
<?php
// Helper for dumping the value of standard constants prior to test
require __DIR__ . '/../src/includes/autoload.php';
echo "=== User-Defined Constants ===\n";
$constants = get_defined_constants(true);
foreach ($constants['user'] as $name => $value) {
echo " - {$name}: '{$value}'\n";
}
echo "==============================\n";