Skip to content

Commit

Permalink
Merge pull request #206 from WebFiori/dev
Browse files Browse the repository at this point in the history
Update composer.json
  • Loading branch information
usernane authored Jan 16, 2024
2 parents 4f3537f + eca77ce commit 1541078
Show file tree
Hide file tree
Showing 25 changed files with 1,002 additions and 626 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ext-mbstring": "*",
"ext-fileinfo": "*",
"ext-openssl": "*",
"webfiori/http":"v3.3.8",
"webfiori/http":"v3.3.9",
"webfiori/file":"v1.3.4",
"webfiori/jsonx":"v3.3.0",
"webfiori/ui":"v2.6.1",
Expand Down
13 changes: 7 additions & 6 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
return function (ECSConfig $ecsConfig): void
{
$ecsConfig->paths([
__DIR__ . '/app',
__DIR__ . '/public',
__DIR__ . '/tests',
__DIR__ . '/themes',
__DIR__ . '/webfiori',
__DIR__.'/app',
__DIR__.'/public',
__DIR__.'/tests',
__DIR__.'/themes',
__DIR__.'/webfiori',
]);

// this way you add a single rule
Expand Down
74 changes: 0 additions & 74 deletions tests/webfiori/framework/test/cli/CreateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,78 +62,4 @@ public function testCreate01() {
"9: Quit. <--\n",
], $runner->getOutput());
}




/**
* @test
*/
public function testCreateWebService00() {
$runner = $runner = App::getRunner();
$runner->setInputs([
'2',
'NewWeb',
'',
'get-hello',
'0',
'y',
'6',
'name',
'n',
'n',
'',
]);
$runner->setArgsVector([
'webfiori',
'create'
]);
$result = $runner->start();
$this->assertEquals(0, $result);
$this->assertEquals([
"What would you like to create?\n",
"0: Database table class.\n",
"1: Entity class from table.\n",
"2: Web service.\n",
"3: Background Task.\n",
"4: Middleware.\n",
"5: CLI Command.\n",
"6: Theme.\n",
"7: Database access class based on table.\n",
"8: Complete REST backend (Database table, entity, database access and web services).\n",
"9: Quit. <--\n",
"Enter a name for the new class:\n",
"Enter an optional namespace for the class: Enter = 'app\apis'\n",
"Enter a name for the new web service:\n",
"Request method:\n",
"0: CONNECT\n",
"1: DELETE\n",
"2: GET <--\n",
"3: HEAD\n",
"4: OPTIONS\n",
"5: POST\n",
"6: PUT\n",
"7: TRACE\n",

"Would you like to add request parameters to the service?(y/N)\n",
"Choose parameter type:\n",
"0: array <--\n",
"1: boolean\n",
"2: email\n",
"3: double\n",
"4: integer\n",
"5: json-obj\n",
"6: string\n",
"7: url\n",
"Enter a name for the request parameter:\n",
"Is this parameter optional?(Y/n)\n",
"Success: New parameter added to the service 'get-hello'.\n",
"Would you like to add another parameter?(y/N)\n",
"Creating the class...\n",
'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."apis\".\n",
"Info: Don't forget to add the service to a services manager.\n",
], $runner->getOutput());
$this->assertTrue(class_exists('\\app\\apis\\NewWebService'));
$this->removeClass('\\app\\apis\\NewWebService');
}
}
5 changes: 3 additions & 2 deletions tests/webfiori/framework/test/cli/CreateTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ public function testCreateTable05() {
$this->assertEquals(DataType::INT, $idCol->getDatatype());
$this->assertTrue($idCol->isPrimary());
$this->assertTrue($idCol->isUnique());

return $clazz;
}
/**
Expand Down Expand Up @@ -546,7 +547,7 @@ public function testCreateTable06($refTable) {
$output = $runner->getOutput();
$clazz = '\\app\\database\\Cool06Table';
$this->assertTrue(class_exists($clazz));

$this->removeClass($clazz);
$this->assertEquals(array_merge([
"Database type:\n",
Expand Down Expand Up @@ -597,7 +598,7 @@ public function testCreateTable06($refTable) {
"Would you like to create an entity class that maps to the database table?(y/N)\n",
'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."database\".\n",
]), $output);

$instance = new $clazz();
$instance instanceof Table;
$this->assertEquals(1, $instance->getForeignKeysCount());
Expand Down
Loading

0 comments on commit 1541078

Please sign in to comment.