Skip to content

Commit

Permalink
Update CreateAPITestCaseTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Oct 15, 2024
1 parent dc11c41 commit f144037
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions tests/webfiori/framework/test/cli/CreateAPITestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ public function testCreateAPITestCase03() {
*/
public function testCreateAPITestCase04() {
$runner = App::getRunner();
$runner->setArgsVector([
'webfiori',
'create',
'--c' => 'api-test',
'--service' => 'get-tasks',
]);


$runner->setArgsVector([
Expand Down Expand Up @@ -205,12 +199,6 @@ public function testCreateAPITestCase05() {
*/
public function testCreateAPITestCase06() {
$runner = App::getRunner();
$runner->setArgsVector([
'webfiori',
'create',
'--c' => 'api-test',
'--service' => 'get-tasks',
]);


$runner->setArgsVector([
Expand Down Expand Up @@ -269,4 +257,28 @@ public function testCreateAPITestCase07() {
"Error: The argument --manager has invalid value.\n",
], $runner->getOutput());
}
/**
* @test
*/
public function testCreateAPITestCase08() {
$runner = App::getRunner();
$runner->setArgsVector([
'webfiori',
'create',
'--c' => 'api-test',
'--service' => 'say-hi-service-2',
'--manager' => '\\tests\\apis\\multiple\\ServicesManager00',
'--defaults'
]);
$runner->setInputs();
$exitCode = $runner->start();
$this->assertEquals(0, $exitCode);
$path = ROOT_PATH.DS."tests".DS."tests".DS."apis".DS."multiple";
$this->assertEquals([
"Info: New class was created at \"".$path."\".\n"
], $runner->getOutput());
$clazz = '\\tests\\tests\\apis\\multiple\\WebService01Test';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
}

0 comments on commit f144037

Please sign in to comment.