mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added Makefile so that you can execute 'make test' in sapphire and it will run tests.
Added support for array in _ss_environment.php for specifying URLs to use for cli-script.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48093 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1896bff08c
commit
ddb96b9dbd
6
Makefile
Normal file
6
Makefile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
URL=`./cli-script.php SapphireInfo/baseurl`
|
||||||
|
|
||||||
|
test: windmill
|
||||||
|
|
||||||
|
windmill:
|
||||||
|
functest ../cms/tests/test_windmill url=${URL}admin browser=firefox
|
@ -72,6 +72,24 @@ foreach($envFiles as $envFile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the URL of this script
|
||||||
|
if(isset($_FILE_TO_URL_MAPPING)) {
|
||||||
|
$fullPath = $testPath = $_SERVER['SCRIPT_FILENAME'];
|
||||||
|
while($testPath && $testPath != "/") {
|
||||||
|
if(isset($_FILE_TO_URL_MAPPING[$testPath])) {
|
||||||
|
$url = $_FILE_TO_URL_MAPPING[$testPath] . substr($fullPath,strlen($testPath));
|
||||||
|
$_SERVER['HTTP_HOST'] = parse_url($url, PHP_URL_HOST);
|
||||||
|
$_SERVER['SCRIPT_NAME'] = parse_url($url, PHP_URL_PATH);
|
||||||
|
$_SERVER['REQUEST_PORT'] = parse_url($url, PHP_URL_PORT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$testPath = dirname($testPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(ManifestBuilder::staleManifest()){
|
if(ManifestBuilder::staleManifest()){
|
||||||
ManifestBuilder::compileManifest();
|
ManifestBuilder::compileManifest();
|
||||||
}
|
}
|
||||||
@ -80,7 +98,7 @@ require_once(MANIFEST_FILE);
|
|||||||
|
|
||||||
if($_GET['debugmanifest']) Debug::show(file_get_contents(MANIFEST_FILE));
|
if($_GET['debugmanifest']) Debug::show(file_get_contents(MANIFEST_FILE));
|
||||||
|
|
||||||
Director::set_environment_type($envType);
|
if(!isset(Director::$environment_type)) Director::set_environment_type($envType);
|
||||||
|
|
||||||
// Default director
|
// Default director
|
||||||
Director::addRules(10, array(
|
Director::addRules(10, array(
|
||||||
@ -103,9 +121,14 @@ DB::connect($databaseConfig);
|
|||||||
|
|
||||||
// Get the request URL
|
// Get the request URL
|
||||||
// $baseURL = dirname(dirname($_SERVER[SCRIPT_NAME]));
|
// $baseURL = dirname(dirname($_SERVER[SCRIPT_NAME]));
|
||||||
$url = $_GET['url'];
|
|
||||||
$url = $_SERVER['argv'][1];
|
$url = $_SERVER['argv'][1];
|
||||||
|
|
||||||
|
if(isset($_SERVER['argv'][2])) {
|
||||||
|
parse_str($_SERVER['argv'][2], $_GET);
|
||||||
|
$_REQUEST = $_GET;
|
||||||
|
print_r($_GET);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Direct away - this is the "main" function, that hands control to the apporopriate controllerx
|
// Direct away - this is the "main" function, that hands control to the apporopriate controllerx
|
||||||
Director::direct($url);
|
Director::direct($url);
|
||||||
|
11
core/control/SapphireInfo.php
Normal file
11
core/control/SapphireInfo.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns information about the current site instance.
|
||||||
|
*/
|
||||||
|
class SapphireInfo extends Controller {
|
||||||
|
function baseurl() {
|
||||||
|
return Director::absoluteBaseUrl() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user