mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'w28_MDL-34147_m24_cygwin' of git://github.com/skodak/moodle
This commit is contained in:
commit
4b9e493b0a
@ -123,7 +123,7 @@ Options:
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
\$/usr/bin/php lib/phpunit/tool.php --install
|
||||
\$ php ".phpunit_bootstrap_cli_argument_path('/admin/tool/phpunit/cli/util.php')." --install
|
||||
";
|
||||
echo $help;
|
||||
exit(0);
|
||||
|
@ -101,7 +101,11 @@ function phpunit_bootstrap_cli_argument_path($moodlepath) {
|
||||
$path = realpath($CFG->dirroot.$moodlepath);
|
||||
|
||||
if (strpos($path, $cwd) === 0) {
|
||||
return substr($path, strlen($cwd));
|
||||
$path = substr($path, strlen($cwd));
|
||||
}
|
||||
|
||||
if (phpunit_bootstrap_is_cygwin()) {
|
||||
$path = str_replace('\\', '/', $path);
|
||||
}
|
||||
|
||||
return $path;
|
||||
@ -140,3 +144,14 @@ function phpunit_boostrap_fix_file_permissions($file) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out if running under Cygwin on Windows.
|
||||
* @return bool
|
||||
*/
|
||||
function phpunit_bootstrap_is_cygwin() {
|
||||
if (empty($_SERVER['SHELL']) or empty($_SERVER['OS'])) {
|
||||
return false;
|
||||
}
|
||||
return ($_SERVER['OS'] === 'Windows_NT' and $_SERVER['SHELL'] === '/bin/bash');
|
||||
}
|
||||
|
@ -74,6 +74,12 @@ class Hint_ResultPrinter extends PHPUnit_TextUI_ResultPrinter {
|
||||
$file = substr($file, strlen($cwd)+1);
|
||||
}
|
||||
|
||||
$this->write("\nTo re-run:\n phpunit $testName $file\n");
|
||||
$executable = 'phpunit';
|
||||
if (phpunit_bootstrap_is_cygwin()) {
|
||||
$file = str_replace('\\', '/', $file);
|
||||
$executable = 'phpunit.bat';
|
||||
}
|
||||
|
||||
$this->write("\nTo re-run:\n $executable $testName $file\n");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user