File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
tests/webfiori/framework/test/cli
webfiori/framework/cli/helpers Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ public function testCreateAPITestCase00() {
2020 '--service ' => 'c '
2121 ]);
2222
23- if ($ output [0 ] !== "Error: The argument --manager has invalid value. \n" ) {
23+ if ($ output [0 ] !== "Error: The argument --manager has invalid value: Not a class: A \n" ) {
2424 $ this ->fail ("Expected error message not found. Full output: " . implode ('' , $ output ));
2525 }
2626
27- $ this ->assertEquals ("Error: The argument --manager has invalid value. \n" , $ output [0 ]);
27+ $ this ->assertEquals ("Error: The argument --manager has invalid value: Not a class: A \n" , $ output [0 ]);
2828 $ this ->assertEquals (-1 , $ this ->getExitCode ());
2929 }
3030 /**
@@ -210,7 +210,7 @@ public function testCreateAPITestCase06() {
210210 */
211211 public function testCreateAPITestCase07 () {
212212 $ this ->assertEquals ([
213- "Error: The argument --manager has invalid value. \n" ,
213+ "Error: The argument --manager has invalid value: Not a class: \\ tests \\ apis \\ emptyService \\ Xyz \n" ,
214214 ], $ this ->executeMultiCommand ([
215215 CreateCommand::class,
216216 '--c ' => 'api-test ' ,
Original file line number Diff line number Diff line change @@ -76,28 +76,31 @@ private function readManagerInfo() : bool {
7676 $ instance = null ;
7777
7878 if ($ m !== null ) {
79- if (class_exists ($ m , false )) {
80- try {
81- $ instance = new $ m ();
82- } catch (\Throwable $ ex ) {
83- $ this ->error ("The argument --manager has invalid value. " );
84- return false ;
85- }
79+ try {
80+ if (class_exists ($ m )) {
81+
82+ $ instance = new $ m ();
83+
8684
8785 if ($ instance instanceof WebServicesManager) {
8886 $ this ->writer ->setServicesManager ($ instance );
8987
9088 return true ;
9189 } else {
92- $ this ->error ("The argument --manager has invalid value. " );
90+ $ this ->error ("The argument --manager has invalid value: Not an instance of " .WebServicesManager::class );
9391
9492 return false ;
9593 }
94+
9695 } else {
97- $ this ->error ("The argument --manager has invalid value. " );
96+ $ this ->error ("The argument --manager has invalid value: Not a class: " . $ m );
9897
9998 return false ;
10099 }
100+ } catch (\Throwable $ ex ) {
101+ $ this ->error ("The argument --manager has invalid value: " .$ ex ->getMessage ());
102+ return false ;
103+ }
101104 }
102105
103106 if ($ instance === null ) {
You can’t perform that action at this time.
0 commit comments