Skip to content

Commit

Permalink
👔 up: update the php some commands logic
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Dec 29, 2022
1 parent 69ce317 commit b44cb65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/Console/Controller/PhpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function sql2arrCommand(FlagsParser $fs, Output $output): void
*
* @example
* Use special php and phpunit:
* {binWithCmd} --php-bin php7 --phpunit /Users/inhere/.composer/vendor/phpunit/phpunit/phpunit -f KEYWORDS ./test
* {binWithCmd} --php-bin php7 --phpunit /Users/inhere/.composer/vendor/phpunit/phpunit/phpunit -f KEYWORDS ./test
*
* @param FlagsParser $fs
* @param Output $output
Expand All @@ -204,6 +204,8 @@ public function runUnitCommand(FlagsParser $fs, Output $output): void
$dir = dirname($dir);
}

$output->info('unit tests code dir or file: ' . $dir);

$runDir = KiteUtil::findPhpUnitConfigFile($dir);
if (!$runDir) {
throw new InvalidArgumentException("not found the phpunit.xml(.dist) in $dir or any parent dir");
Expand Down
2 changes: 1 addition & 1 deletion app/Helper/KiteUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static function findPhpUnitConfigFile(string $dir): string
$dir = FS::realpath($dir);

while (true) {
if (!$dir) {
if (!trim($dir, '/')) {
break;
}

Expand Down

0 comments on commit b44cb65

Please sign in to comment.