File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Unit
13
13
const PATTERN = 'unitary-*.php ' ;
14
14
private Command $ command ;
15
15
private bool $ quite ;
16
- private ?string $ title ;
16
+ private ?string $ title = null ;
17
17
private array $ args = [];
18
18
private array $ units ;
19
19
private int $ index = 0 ;
@@ -90,7 +90,7 @@ public function add(string $message, callable $callback): void
90
90
*/
91
91
public function execute (): void
92
92
{
93
- if (!is_null ($ this ->title ) && !$ this ->quite || count ($ this ->error ) > 0 ) {
93
+ if (!is_null ($ this ->title ) && ( !$ this ->quite || count ($ this ->error ) > 0 ) ) {
94
94
$ this ->command ->title ("\n--------- $ this ->title --------- " );
95
95
}
96
96
if (count ($ this ->error ) > 0 ) {
@@ -147,7 +147,7 @@ private function findFiles($dir): array
147
147
$ files = [];
148
148
$ iterator = new RecursiveIteratorIterator (new RecursiveDirectoryIterator ($ dir ));
149
149
foreach ($ iterator as $ file ) {
150
- if ( fnmatch ( static :: PATTERN , $ file ->getFilename ()) ) {
150
+ if ( isset ( $ this -> args [ ' path ' ]) || strpos ( $ file ->getPathname (), " vendor/ " ) === false ) {
151
151
$ files [] = $ file ->getPathname ();
152
152
}
153
153
}
Original file line number Diff line number Diff line change 19
19
"php" : " >=8.0" ,
20
20
"maplephp/dto" : " ^1.0" ,
21
21
"maplephp/http" : " ^1.0" ,
22
- "maplephp/validate" : " ^1.0" ,
22
+ "maplephp/validate" : " ^1.0.0 " ,
23
23
"maplephp/prompts" : " ^1.0"
24
24
},
25
25
"autoload" : {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use MaplePHP\Unitary\Unit;
8
8
9
9
if (!class_exists (Unit::class)) {
10
10
$ dir = realpath (__DIR__ . "/../../../ " );
11
- $ alFile = (defined ("UNITARY_AUTOLOAD_FILE " ) ? UNITARY_AUTOLOAD_FILE : "$ dir/vendor/ autoload.php " );
11
+ $ alFile = (defined ("UNITARY_AUTOLOAD_FILE " ) ? UNITARY_AUTOLOAD_FILE : "$ dir/autoload.php " );
12
12
if (is_file ($ alFile )) {
13
13
require_once ($ alFile );
14
14
} else {
@@ -24,15 +24,15 @@ $request = new ServerRequest(new Uri($env->getUriParts([
24
24
])), $ env );
25
25
26
26
$ data = $ request ->getCliArgs ();
27
- $ defaultPath = (defined ("UNITARY_PATH " ) ? UNITARY_PATH : null );
27
+ $ defaultPath = (defined ("UNITARY_PATH " ) ? UNITARY_PATH : " ./ " );
28
28
29
29
try {
30
30
$ path = ($ data ['path ' ] ?? $ defaultPath );
31
31
if (!isset ($ path )) {
32
32
throw new Exception ("Path not specified: --path=path/to/dir " );
33
33
}
34
34
35
- $ testDir = realpath ($ data [ ' path ' ] );
35
+ $ testDir = realpath ($ path );
36
36
if (!is_dir ($ testDir )) {
37
37
throw new Exception ("Test directory ' $ testDir' does not exist " );
38
38
}
You can’t perform that action at this time.
0 commit comments