Skip to content

Commit

Permalink
- Merge [3862].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 19, 2008
1 parent 4bd4dc5 commit 346b6be
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions PHPUnit/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ protected static function handleArguments()
$arguments['testFile'] = '';
}

if (isset($arguments['test']) && is_file($arguments['test'])) {
$arguments['testFile'] = realpath($arguments['test']);
$arguments['test'] = substr($arguments['test'], 0, strrpos($arguments['test'], '.'));
}

foreach ($options[0] as $option) {
switch ($option[0]) {
case '--ansi':
Expand Down Expand Up @@ -429,22 +434,22 @@ protected static function handleArguments()
case '--skeleton':
case '--skeleton-class':
case '--skeleton-test': {
if (isset($arguments['bootstrap'])) {
require_once $arguments['bootstrap'];
}
if (isset($arguments['test']) && $arguments['test'] !== FALSE) {
PHPUnit_TextUI_TestRunner::printVersionString();

if ($option[0] == '--skeleton-class') {
require_once 'PHPUnit/Util/Skeleton/Class.php';
if (isset($arguments['bootstrap'])) {
require_once $arguments['bootstrap'];
}

$class = 'PHPUnit_Util_Skeleton_Class';
} else {
require_once 'PHPUnit/Util/Skeleton/Test.php';
if ($option[0] == '--skeleton-class') {
require_once 'PHPUnit/Util/Skeleton/Class.php';

$class = 'PHPUnit_Util_Skeleton_Test';
}
$class = 'PHPUnit_Util_Skeleton_Class';
} else {
require_once 'PHPUnit/Util/Skeleton/Test.php';

if (isset($arguments['test']) && $arguments['test'] !== FALSE && isset($arguments['testFile'])) {
PHPUnit_TextUI_TestRunner::printVersionString();
$class = 'PHPUnit_Util_Skeleton_Test';
}

try {
$skeleton = new $class($arguments['test'], $arguments['testFile']);
Expand Down

0 comments on commit 346b6be

Please sign in to comment.