* Where <password> is the password
* that was set by the developer to protect the tasks from unauthorized access.
* If no password is set, then it can be removed from the command.
diff --git a/WebFiori/Framework/Scheduler/WebServices/ForceTaskExecutionService.php b/WebFiori/Framework/Scheduler/WebServices/ForceTaskExecutionService.php
index 55614882f..97484a268 100644
--- a/WebFiori/Framework/Scheduler/WebServices/ForceTaskExecutionService.php
+++ b/WebFiori/Framework/Scheduler/WebServices/ForceTaskExecutionService.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\scheduler\webServices;
+namespace WebFiori\Framework\Scheduler\WebServices;
-use webfiori\framework\scheduler\TasksManager;
+use WebFiori\Framework\Scheduler\TasksManager;
use WebFiori\Http\RequestParameter;
use WebFiori\Http\WebServicesManager;
use WebFiori\Json\Json;
diff --git a/WebFiori/Framework/Scheduler/WebServices/GetTasksService.php b/WebFiori/Framework/Scheduler/WebServices/GetTasksService.php
index e8f7b5e52..a338cda21 100644
--- a/WebFiori/Framework/Scheduler/WebServices/GetTasksService.php
+++ b/WebFiori/Framework/Scheduler/WebServices/GetTasksService.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\scheduler\webServices;
+namespace WebFiori\Framework\Scheduler\WebServices;
-use webfiori\framework\scheduler\TasksManager;
+use WebFiori\Framework\Scheduler\TasksManager;
use WebFiori\Json\Json;
/**
* A web service which is used to fetch a list of all scheduled tasks.
diff --git a/WebFiori/Framework/Scheduler/WebServices/PrivateSchedulerService.php b/WebFiori/Framework/Scheduler/WebServices/PrivateSchedulerService.php
index d9e2b3f37..09ebe6eb5 100644
--- a/WebFiori/Framework/Scheduler/WebServices/PrivateSchedulerService.php
+++ b/WebFiori/Framework/Scheduler/WebServices/PrivateSchedulerService.php
@@ -1,7 +1,7 @@
getDocument()->getBody()->addChild('script', [
'type' => 'text/javascript',
- 'src' => 'https://cdn.jsdelivr.net/gh/webfiori/framework@'.WF_VERSION.'/assets/js/scheduler-logic.js',
+ 'src' => 'https://cdn.jsdelivr.net/gh/WebFiori/framework@'.WF_VERSION.'/assets/js/scheduler-logic.js',
]);
});
}
diff --git a/WebFiori/Framework/Scheduler/WebUI/ListTasksPage.php b/WebFiori/Framework/Scheduler/WebUI/ListTasksPage.php
index 6a326834d..5117fdcf3 100644
--- a/WebFiori/Framework/Scheduler/WebUI/ListTasksPage.php
+++ b/WebFiori/Framework/Scheduler/WebUI/ListTasksPage.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\scheduler\webUI;
+namespace WebFiori\Framework\Scheduler\WebUI;
use WebFiori\File\File;
use WebFiori\Http\Response;
diff --git a/WebFiori/Framework/Scheduler/WebUI/SetPasswordPage.php b/WebFiori/Framework/Scheduler/WebUI/SetPasswordPage.php
index 8fe6dcf5e..8b8741119 100644
--- a/WebFiori/Framework/Scheduler/WebUI/SetPasswordPage.php
+++ b/WebFiori/Framework/Scheduler/WebUI/SetPasswordPage.php
@@ -1,7 +1,7 @@
diff --git a/WebFiori/Framework/Session/DatabaseSessionStorage.php b/WebFiori/Framework/Session/DatabaseSessionStorage.php
index eec797eb6..daf0a1f43 100644
--- a/WebFiori/Framework/Session/DatabaseSessionStorage.php
+++ b/WebFiori/Framework/Session/DatabaseSessionStorage.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\DatabaseException;
-use webfiori\framework\exceptions\SessionException;
+use WebFiori\Framework\Exceptions\SessionException;
/**
* A session storage engine which uses database to store session state.
@@ -47,9 +47,9 @@ public function __construct() {
}
}
/**
- * Drop the tables which are used to store session information.
+ * Drop the Tables which are used to store session information.
*
- * The method will drop two tables, the table 'session_data' and the
+ * The method will drop two Tables, the table 'session_data' and the
* table 'sessions'.
*/
public function dropTables() {
diff --git a/WebFiori/Framework/Session/DefaultSessionStorage.php b/WebFiori/Framework/Session/DefaultSessionStorage.php
index d379e44e5..496116b25 100644
--- a/WebFiori/Framework/Session/DefaultSessionStorage.php
+++ b/WebFiori/Framework/Session/DefaultSessionStorage.php
@@ -8,12 +8,12 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Cli\Runner;
use WebFiori\File\exceptions\FileException;
use WebFiori\File\File;
-use webfiori\framework\exceptions\SessionException;
+use WebFiori\Framework\Exceptions\SessionException;
/**
* The default sessions storage engine.
*
diff --git a/WebFiori/Framework/Session/MSSQLSessionDataTable.php b/WebFiori/Framework/Session/MSSQLSessionDataTable.php
index 73d4d01fc..6d6d322a5 100644
--- a/WebFiori/Framework/Session/MSSQLSessionDataTable.php
+++ b/WebFiori/Framework/Session/MSSQLSessionDataTable.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\MsSql\MSSQLTable;
diff --git a/WebFiori/Framework/Session/MSSQLSessionsTable.php b/WebFiori/Framework/Session/MSSQLSessionsTable.php
index 6e6fcee3c..db7504239 100644
--- a/WebFiori/Framework/Session/MSSQLSessionsTable.php
+++ b/WebFiori/Framework/Session/MSSQLSessionsTable.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\MsSql\MSSQLTable;
/**
diff --git a/WebFiori/Framework/Session/MySQLSessionDataTable.php b/WebFiori/Framework/Session/MySQLSessionDataTable.php
index 2413bc4a1..7ca18429f 100644
--- a/WebFiori/Framework/Session/MySQLSessionDataTable.php
+++ b/WebFiori/Framework/Session/MySQLSessionDataTable.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\MySql\MySQLTable;
diff --git a/WebFiori/Framework/Session/MySQLSessionsTable.php b/WebFiori/Framework/Session/MySQLSessionsTable.php
index a7ab4f303..0d36515c8 100644
--- a/WebFiori/Framework/Session/MySQLSessionsTable.php
+++ b/WebFiori/Framework/Session/MySQLSessionsTable.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\MySql\MySQLTable;
diff --git a/WebFiori/Framework/Session/Session.php b/WebFiori/Framework/Session/Session.php
index adae7c5b1..6aac552c3 100644
--- a/WebFiori/Framework/Session/Session.php
+++ b/WebFiori/Framework/Session/Session.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
-use webfiori\framework\App;
-use webfiori\framework\exceptions\SessionException;
+use WebFiori\Framework\App;
+use WebFiori\Framework\Exceptions\SessionException;
use WebFiori\Http\HttpCookie;
use WebFiori\Http\Request;
use WebFiori\Json\Json;
diff --git a/WebFiori/Framework/Session/SessionDB.php b/WebFiori/Framework/Session/SessionDB.php
index f3bcd5948..792ddd75c 100644
--- a/WebFiori/Framework/Session/SessionDB.php
+++ b/WebFiori/Framework/Session/SessionDB.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
use WebFiori\Database\DatabaseException;
-use webfiori\framework\DB;
+use WebFiori\Framework\DB;
/**
* A class which includes all database related operations to add, update,
* and delete sessions from a database.
@@ -155,7 +155,7 @@ public function removeSession(string $sId) {
$this->table('sessions')->delete()->where('s-id', $sId)->execute();
}
/**
- * Removes database tables which are used to store session information.
+ * Removes database Tables which are used to store session information.
*/
public function removeTables() {
$this->transaction(function (DB $db)
diff --git a/WebFiori/Framework/Session/SessionOption.php b/WebFiori/Framework/Session/SessionOption.php
index a78065346..a7953a634 100644
--- a/WebFiori/Framework/Session/SessionOption.php
+++ b/WebFiori/Framework/Session/SessionOption.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
/**
* A class which is used to hold the options names that are supported during
diff --git a/WebFiori/Framework/Session/SessionStatus.php b/WebFiori/Framework/Session/SessionStatus.php
index 460037183..bb4a840f4 100644
--- a/WebFiori/Framework/Session/SessionStatus.php
+++ b/WebFiori/Framework/Session/SessionStatus.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
/**
* A class which is used to hold constants which represents different statuses
diff --git a/WebFiori/Framework/Session/SessionStorage.php b/WebFiori/Framework/Session/SessionStorage.php
index 3ce1085ca..9a106d4da 100644
--- a/WebFiori/Framework/Session/SessionStorage.php
+++ b/WebFiori/Framework/Session/SessionStorage.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
/**
* An interface which can be used to implement different types of sessions storage.
diff --git a/WebFiori/Framework/Session/SessionUser.php b/WebFiori/Framework/Session/SessionUser.php
index 45759f167..198a95665 100644
--- a/WebFiori/Framework/Session/SessionUser.php
+++ b/WebFiori/Framework/Session/SessionUser.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
/**
* An interface which is used to tell if an entity can represents session
diff --git a/WebFiori/Framework/Session/SessionsManager.php b/WebFiori/Framework/Session/SessionsManager.php
index 929843086..b67cd53e3 100644
--- a/WebFiori/Framework/Session/SessionsManager.php
+++ b/WebFiori/Framework/Session/SessionsManager.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\session;
+namespace WebFiori\Framework\Session;
-use webfiori\framework\exceptions\SessionException;
+use WebFiori\Framework\Exceptions\SessionException;
use WebFiori\Http\Request;
/**
* A class which is used to manage user sessions.
@@ -65,10 +65,10 @@ private function __construct() {
$constructor = WF_SESSION_STORAGE.'';
$classObj = new $constructor();
- if (is_subclass_of($classObj, '\webfiori\framework\session\SessionStorage')) {
+ if (is_subclass_of($classObj, '\WebFiori\framework\session\SessionStorage')) {
$this->sessionStorage = $classObj;
} else {
- throw new SessionException('The class "'.WF_SESSION_STORAGE.'" does not implement "\webfiori\framework\session\SessionStorage".');
+ throw new SessionException('The class "'.WF_SESSION_STORAGE.'" does not implement "\WebFiori\framework\session\SessionStorage".');
}
}
diff --git a/WebFiori/Framework/Theme.php b/WebFiori/Framework/Theme.php
index 930c13e4a..2fa685c0b 100644
--- a/WebFiori/Framework/Theme.php
+++ b/WebFiori/Framework/Theme.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework;
+namespace WebFiori\Framework;
use ReflectionClass;
-use webfiori\framework\ui\WebPage;
+use WebFiori\Framework\UI\WebPage;
use WebFiori\Json\Json;
use WebFiori\Json\JsonI;
use WebFiori\UI\exceptions\InvalidNodeNameException;
diff --git a/WebFiori/Framework/ThemeManager.php b/WebFiori/Framework/ThemeManager.php
index 05758292d..527208bd8 100644
--- a/WebFiori/Framework/ThemeManager.php
+++ b/WebFiori/Framework/ThemeManager.php
@@ -8,15 +8,15 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework;
+namespace WebFiori\Framework;
use Error;
use Exception;
-use webfiori\file\File;
-use webfiori\framework\exceptions\NoSuchThemeException;
-use webfiori\framework\router\RouteOption;
-use webfiori\framework\router\Router;
-use webfiori\http\Response;
+use WebFiori\file\File;
+use WebFiori\Framework\Exceptions\NoSuchThemeException;
+use WebFiori\Framework\Router\RouteOption;
+use WebFiori\Framework\Router\Router;
+use WebFiori\http\Response;
/**
* A class which manages theme registration and loading.
diff --git a/WebFiori/Framework/Ui/BeforeRenderCallback.php b/WebFiori/Framework/Ui/BeforeRenderCallback.php
index f381feaed..106bea5b2 100644
--- a/WebFiori/Framework/Ui/BeforeRenderCallback.php
+++ b/WebFiori/Framework/Ui/BeforeRenderCallback.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\ui;
+namespace WebFiori\Framework\UI;
use WebFiori\Collections\Comparable;
/**
diff --git a/WebFiori/Framework/Ui/HTTPCodeView.php b/WebFiori/Framework/Ui/HTTPCodeView.php
index 316251778..2539d0b71 100644
--- a/WebFiori/Framework/Ui/HTTPCodeView.php
+++ b/WebFiori/Framework/Ui/HTTPCodeView.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\ui;
+namespace WebFiori\Framework\UI;
-use webfiori\framework\App;
+use WebFiori\Framework\App;
use WebFiori\UI\HTMLNode;
/**
* A basic view which is used to display HTTP error codes taken from
diff --git a/WebFiori/Framework/Ui/MessageBox.php b/WebFiori/Framework/Ui/MessageBox.php
index af849fae2..59db37e49 100644
--- a/WebFiori/Framework/Ui/MessageBox.php
+++ b/WebFiori/Framework/Ui/MessageBox.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\ui;
+namespace WebFiori\Framework\UI;
use WebFiori\UI\HTMLNode;
/**
@@ -138,13 +138,13 @@ private function _init() {
$css = new HTMLNode('link');
$css->setAttributes([
'rel' => 'stylesheet',
- 'href' => 'https://cdn.jsdelivr.net/gh/webfiori/app@'.WF_VERSION.'/public/assets/css/message-box.css'
+ 'href' => 'https://cdn.jsdelivr.net/gh/WebFiori/app@'.WF_VERSION.'/public/assets/css/message-box.css'
]);
$this->addChild($css);
$js = new HTMLNode('script');
$js->setAttributes([
'type' => 'text/javascript',
- 'src' => 'https://cdn.jsdelivr.net/gh/webfiori/app@'.WF_VERSION.'/public/assets/js/message-box.js'
+ 'src' => 'https://cdn.jsdelivr.net/gh/WebFiori/app@'.WF_VERSION.'/public/assets/js/message-box.js'
]);
$this->addChild($js);
}
diff --git a/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php b/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
index 1120e1360..80851c680 100644
--- a/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\ui\serverErrPage;
+namespace WebFiori\Framework\UI\ServerErrPage;
use WebFiori\Error\AbstractHandler;
-use webfiori\framework\ui\WebPage;
+use WebFiori\Framework\UI\WebPage;
use WebFiori\UI\HTMLNode;
/**
* A page which is used to display exception information when it is thrown or
@@ -41,7 +41,7 @@ public function __construct(AbstractHandler $throwableOrErr) {
$this->addBeforeRender(function (WebPage $p)
{
$p->getDocument()->getBody()->addChild('script', [
- 'src' => 'https://cdn.jsdelivr.net/gh/webfiori/framework@'.WF_VERSION.'/assets/js/server-err.js',
+ 'src' => 'https://cdn.jsdelivr.net/gh/WebFiori/framework@'.WF_VERSION.'/assets/js/server-err.js',
'type' => 'text/javascript'
]);
});
diff --git a/WebFiori/Framework/Ui/ServerErrPage/error-details.php b/WebFiori/Framework/Ui/ServerErrPage/error-details.php
index 1a3a2a3d1..bde2da28d 100644
--- a/WebFiori/Framework/Ui/ServerErrPage/error-details.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/error-details.php
@@ -1,5 +1,5 @@
diff --git a/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php b/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
index 79603599f..88fef9d5e 100644
--- a/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
@@ -1,5 +1,5 @@
diff --git a/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php b/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
index fd7c16234..7b62f964d 100644
--- a/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
@@ -1,5 +1,5 @@
setTitle('Welcome to WebFiori');
$div = $this->insert('div');
$div->addChild('img', [
- 'src' => 'https://webfiori.com/assets/images/WFLogo512.png',
+ 'src' => 'https://WebFiori.com/assets/images/WFLogo512.png',
'style' => 'width:250px;height:250px;border-radius:250px;background-color:black'
]);
$div->setStyle([
@@ -56,7 +56,7 @@ public function __construct() {
$cardsRow = $row->addChild('v-col', [
'cols' => 12,
])->addChild('v-row');
- $this->createCard('https://webfiori.com/learn',
+ $this->createCard('https://WebFiori.com/learn',
'mdi-book-open-variant',
'Learn',
'Documentation is always the first place where developers can find what they need.'
@@ -66,7 +66,7 @@ public function __construct() {
.'experience with it, we recommend the '
.'documentation as they will help in a way or another.',
$cardsRow->addChild('v-col', ['cols' => 12, 'md' => 6, 'sm' => 12]));
- $this->createCard('https://webfiori.com/docs/webfiori',
+ $this->createCard('https://WebFiori.com/docs/WebFiori',
'mdi-book-check-outline',
'API Reference',
'This reference has all information about core framework classes that a developer '
@@ -74,7 +74,7 @@ public function __construct() {
.'uses of every public class attribute and method. It can be handy when developers starts '
.'using advanced features of the framework.',
$cardsRow->addChild('v-col', ['cols' => 12, 'md' => 6, 'sm' => 12]));
- $this->createCard('https://webfiori.com/contribute',
+ $this->createCard('https://WebFiori.com/contribute',
'mdi-comment-plus-outline',
'Support The Project',
'Want to help in development of the framework or contribute? This place is for you. It holds '
diff --git a/WebFiori/Framework/Ui/WebPage.php b/WebFiori/Framework/Ui/WebPage.php
index 58d0efb15..219ac76fb 100644
--- a/WebFiori/Framework/Ui/WebPage.php
+++ b/WebFiori/Framework/Ui/WebPage.php
@@ -8,24 +8,24 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\ui;
+namespace WebFiori\Framework\UI;
use Error;
use Exception;
use TypeError;
use WebFiori\Collections\LinkedList;
-use webfiori\framework\App;
-use webfiori\framework\exceptions\InitializationException;
-use webfiori\framework\exceptions\MissingLangException;
-use webfiori\framework\exceptions\SessionException;
-use webfiori\framework\exceptions\UIException;
-use webfiori\framework\Lang;
-use webfiori\framework\router\Router;
-use webfiori\framework\session\Session;
-use webfiori\framework\session\SessionsManager;
-use webfiori\framework\Theme;
-use webfiori\framework\ThemeManager;
-use webfiori\framework\Util;
+use WebFiori\Framework\App;
+use WebFiori\Framework\Exceptions\InitializationException;
+use WebFiori\Framework\Exceptions\MissingLangException;
+use WebFiori\Framework\Exceptions\SessionException;
+use WebFiori\Framework\Exceptions\UIException;
+use WebFiori\Framework\Lang;
+use WebFiori\Framework\Router\Router;
+use WebFiori\Framework\Session\Session;
+use WebFiori\Framework\Session\SessionsManager;
+use WebFiori\Framework\Theme;
+use WebFiori\Framework\ThemeManager;
+use WebFiori\Framework\Util;
use WebFiori\Http\Request;
use WebFiori\Http\Response;
use WebFiori\Json\Json;
@@ -1174,7 +1174,7 @@ private function _getComponent($methToCall, $nodeId) {
}
throw new UIException('The the method "'.get_class($loadedTheme).'::'.$methToCall.'()" did not return '
- .'an instance of the class "webfiori\\ui\\HTMLNode".');
+ .'an instance of the class "WebFiori\\ui\\HTMLNode".');
}
/**
* Sets the language of the page based on session language or
@@ -1235,7 +1235,7 @@ private function getHead() {
if (!($headNode instanceof HeadNode)) {
throw new UIException('The method "'.get_class($loadedTheme).'::getHeadNode()" did not return '
- .'an instance of the class "webfiori\\ui\\HeadNode".');
+ .'an instance of the class "WebFiori\\ui\\HeadNode".');
}
}
$headNode->addMeta('charset','UTF-8',true);
diff --git a/WebFiori/Framework/Ui/ui-functions.php b/WebFiori/Framework/Ui/ui-functions.php
index b0aa17fe1..21fe2b876 100644
--- a/WebFiori/Framework/Ui/ui-functions.php
+++ b/WebFiori/Framework/Ui/ui-functions.php
@@ -9,9 +9,9 @@
*
*/
-use webfiori\framework\exceptions\MissingLangException;
-use webfiori\framework\Lang;
-use webfiori\framework\ui\WebPage;
+use WebFiori\Framework\Exceptions\MissingLangException;
+use WebFiori\Framework\Lang;
+use WebFiori\Framework\UI\WebPage;
use WebFiori\Http\Response;
use WebFiori\Json\JsonI;
use WebFiori\UI\HTMLNode;
diff --git a/WebFiori/Framework/User.php b/WebFiori/Framework/User.php
index 7772c24b8..ca3f579fd 100644
--- a/WebFiori/Framework/User.php
+++ b/WebFiori/Framework/User.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework;
+namespace WebFiori\Framework;
-use webfiori\framework\session\SessionUser;
+use WebFiori\Framework\Session\SessionUser;
use WebFiori\Json\Json;
use WebFiori\Json\JsonI;
/**
diff --git a/WebFiori/Framework/Util.php b/WebFiori/Framework/Util.php
index cf3fc9d56..517ec19bc 100644
--- a/WebFiori/Framework/Util.php
+++ b/WebFiori/Framework/Util.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework;
+namespace WebFiori\Framework;
-use webfiori\framework\cli\Runner;
-use webfiori\framework\ui\MessageBox;
+use WebFiori\Framework\Cli\Runner;
+use WebFiori\Framework\UI\MessageBox;
use WebFiori\Http\Response;
/**
* Framework utility class.
diff --git a/WebFiori/Framework/Writers/APITestCaseWriter.php b/WebFiori/Framework/Writers/APITestCaseWriter.php
index e1972c1fa..cdd46eb8f 100644
--- a/WebFiori/Framework/Writers/APITestCaseWriter.php
+++ b/WebFiori/Framework/Writers/APITestCaseWriter.php
@@ -1,5 +1,5 @@
name: The name of the class that will be created. If not provided, the
* string 'NewClass' is used.
*
namespace: The namespace that the class will belong to. If not provided,
- * the namespace 'webfiori' is used.
+ * the namespace 'WebFiori' is used.
*
path: The location at which the class will be created on. If not
* provided, the constant ROOT_PATH is used.
*
diff --git a/WebFiori/Framework/Writers/DBClassWriter.php b/WebFiori/Framework/Writers/DBClassWriter.php
index 3113d9787..8ab043da5 100644
--- a/WebFiori/Framework/Writers/DBClassWriter.php
+++ b/WebFiori/Framework/Writers/DBClassWriter.php
@@ -8,14 +8,14 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use WebFiori\Database\Column;
use WebFiori\Database\EntityMapper;
use WebFiori\Database\MsSql\MSSQLColumn;
use WebFiori\Database\MsSql\MSSQLTable;
use WebFiori\Database\Table;
-use webfiori\framework\DB;
+use WebFiori\Framework\DB;
/**
* A class which is used to create a database access controller.
*
diff --git a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
index ed807c230..dba8ead9b 100644
--- a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
+++ b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use WebFiori\Database\Database;
use WebFiori\Database\Schema\AbstractMigration;
diff --git a/WebFiori/Framework/Writers/LangClassWriter.php b/WebFiori/Framework/Writers/LangClassWriter.php
index 35fa00312..de71ccb67 100644
--- a/WebFiori/Framework/Writers/LangClassWriter.php
+++ b/WebFiori/Framework/Writers/LangClassWriter.php
@@ -8,9 +8,9 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
-use webfiori\framework\Lang;
+use WebFiori\Framework\Lang;
/**
* A writer which is used to write any class that represents a language class.
*
diff --git a/WebFiori/Framework/Writers/MiddlewareClassWriter.php b/WebFiori/Framework/Writers/MiddlewareClassWriter.php
index 1fd6867a3..4efc9228e 100644
--- a/WebFiori/Framework/Writers/MiddlewareClassWriter.php
+++ b/WebFiori/Framework/Writers/MiddlewareClassWriter.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
-use webfiori\framework\middleware\AbstractMiddleware;
-use webfiori\framework\session\SessionsManager;
+use WebFiori\Framework\Middleware\AbstractMiddleware;
+use WebFiori\Framework\Session\SessionsManager;
use WebFiori\Http\Request;
use WebFiori\Http\Response;
/**
@@ -32,7 +32,7 @@ class MiddlewareClassWriter extends ClassWriter {
*
name: The name of the class that will be created. If not provided, the
* string 'NewClass' is used.
*
namespace: The namespace that the class will belong to. If not provided,
- * the namespace 'webfiori' is used.
+ * the namespace 'WebFiori' is used.
*
path: The location at which the class will be created on. If not
* provided, the constant ROOT_PATH is used.
*
diff --git a/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php b/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
index acc015798..928384105 100644
--- a/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
+++ b/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
@@ -8,13 +8,13 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
-use webfiori\framework\scheduler\AbstractTask;
-use webfiori\framework\scheduler\BaseTask;
-use webfiori\framework\scheduler\TaskArgument;
-use webfiori\framework\scheduler\TasksManager;
-use webfiori\framework\scheduler\TaskStatusEmail;
+use WebFiori\Framework\Scheduler\AbstractTask;
+use WebFiori\Framework\Scheduler\BaseTask;
+use WebFiori\Framework\Scheduler\TaskArgument;
+use WebFiori\Framework\Scheduler\TasksManager;
+use WebFiori\Framework\Scheduler\TaskStatusEmail;
/**
* A class which is used to write scheduler tasks classes.
*
@@ -158,7 +158,7 @@ public function writeClassBody() {
$this->append('//TODO: Implement the action to perform when the task finishes to execute.', 2);
$this->append("//\$email = new TaskStatusEmail('no-reply', [", 2);
- $this->append("// 'webfiori@example.com' => 'Ibrahim Ali'", 2);
+ $this->append("// 'WebFiori@example.com' => 'Ibrahim Ali'", 2);
$this->append('//]);', 2);
$this->append('}', 1);
diff --git a/WebFiori/Framework/Writers/ServiceHolder.php b/WebFiori/Framework/Writers/ServiceHolder.php
index 1154b281f..4b9ca3510 100644
--- a/WebFiori/Framework/Writers/ServiceHolder.php
+++ b/WebFiori/Framework/Writers/ServiceHolder.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use WebFiori\Http\AbstractWebService;
/**
diff --git a/WebFiori/Framework/Writers/TableClassWriter.php b/WebFiori/Framework/Writers/TableClassWriter.php
index 92d739e62..3a2a52223 100644
--- a/WebFiori/Framework/Writers/TableClassWriter.php
+++ b/WebFiori/Framework/Writers/TableClassWriter.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use const APP_DIR;
use const APP_PATH;
@@ -57,7 +57,7 @@ class TableClassWriter extends ClassWriter {
*
name: The name of the class that will be created. If not provided, the
* string 'NewClass' is used.
*
namespace: The namespace that the class will belong to. If not provided,
- * the namespace 'webfiori' is used.
+ * the namespace 'WebFiori' is used.
*
path: The location at which the query will be created on. If not
* provided, the constant ROOT_PATH is used.
*
entity-info: A sub associative array that contains information about the entity
diff --git a/WebFiori/Framework/Writers/ThemeClassWriter.php b/WebFiori/Framework/Writers/ThemeClassWriter.php
index 8072c7f5a..33754993b 100644
--- a/WebFiori/Framework/Writers/ThemeClassWriter.php
+++ b/WebFiori/Framework/Writers/ThemeClassWriter.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use WebFiori\File\File;
-use webfiori\framework\Theme;
+use WebFiori\Framework\Theme;
use WebFiori\UI\HeadNode;
use WebFiori\UI\HTMLNode;
diff --git a/WebFiori/Framework/Writers/ThemeComponentWriter.php b/WebFiori/Framework/Writers/ThemeComponentWriter.php
index a14e96f3b..7588d1bc0 100644
--- a/WebFiori/Framework/Writers/ThemeComponentWriter.php
+++ b/WebFiori/Framework/Writers/ThemeComponentWriter.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
/**
* A helper class which is used in generating theme template.
diff --git a/WebFiori/Framework/Writers/WebServiceWriter.php b/WebFiori/Framework/Writers/WebServiceWriter.php
index 59129c6ad..cae3c03b7 100644
--- a/WebFiori/Framework/Writers/WebServiceWriter.php
+++ b/WebFiori/Framework/Writers/WebServiceWriter.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace webfiori\framework\writers;
+namespace WebFiori\Framework\Writers;
use WebFiori\Http\AbstractWebService;
use WebFiori\Http\ParamOption;
@@ -41,7 +41,7 @@ class WebServiceWriter extends ClassWriter {
*
name: The name of the class that will be created. If not provided, the
* string 'NewClass' is used.
*
namespace: The namespace that the class will belong to. If not provided,
- * the namespace 'webfiori' is used.
+ * the namespace 'WebFiori' is used.
*
path: The location at which the query will be created on. If not
* provided, the constant ROOT_PATH is used.
*
diff --git a/composer.json b/composer.json
index 1f1453bab..9acd5db7b 100644
--- a/composer.json
+++ b/composer.json
@@ -42,12 +42,12 @@
},
"autoload": {
"psr-4": {
- "webfiori\\framework\\": "webfiori/framework/"
+ "WebFiori\\Framework\\": "WebFiori/Framework/"
}
},
"autoload-dev": {
"psr-4": {
- "webfiori\\tests\\": "tests/"
+ "WebFiori\\Tests\\": "tests/"
}
},
"keywords": [
diff --git a/public/index.php b/public/index.php
index 09da46ee1..8e8db2dcf 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,12 +1,12 @@
getCol('contact-type')->setIsUnique(false);
$this->getCol('contact-type')->setIsPrimary(true);
$this->table->addColumn('contact-info', new MySQLColumn('contact_info', 'varchar',320));
- $this->table->addReference('webfiori\tests\database\UsersQuery', [
+ $this->table->addReference('WebFiori\tests\database\UsersQuery', [
'user-id' => 'user-id'
], 'user_contact_info_fk', 'cadcade', 'cascade');
$this->setTable($this->table);
diff --git a/tests/TestEntities/UserWithContact.php b/tests/TestEntities/UserWithContact.php
index ce225b968..cccaf6426 100644
--- a/tests/TestEntities/UserWithContact.php
+++ b/tests/TestEntities/UserWithContact.php
@@ -1,7 +1,7 @@
getDBConnections()) + 1);
$output = $this->executeSingleCommand(new AddCommand(), [
- 'webfiori',
+ 'WebFiori',
'add'
], [
'0',
@@ -121,7 +121,7 @@ public function testAddDBConnection02() {
$connName = 'db-connection-'.($count + 1);
$output = $this->executeSingleCommand(new AddCommand(), [
- 'webfiori',
+ 'WebFiori',
'add'
], [
'0',
@@ -169,8 +169,8 @@ public function testAddLang00() {
$langCode = chr(65 + ($langCode[0] % 26)) . chr(65 + ($langCode[1] % 26));
// Clean up if it exists from previous runs
- if (class_exists('\\app\\langs\\Lang' . $langCode)) {
- $this->removeClass('\\app\\langs\\Lang' . $langCode);
+ if (class_exists('\\App\\Langs\\Lang' . $langCode)) {
+ $this->removeClass('\\App\\Langs\\Lang' . $langCode);
}
$output = $this->executeSingleCommand(new AddCommand(), [], [
@@ -198,8 +198,8 @@ public function testAddLang00() {
"1: rtl\n",
"Success: Language added. Also, a class for the language is created at \"".APP_DIR."\langs\" for that language.\n"
], $output);
- $this->assertTrue(class_exists('\\app\\langs\\Lang' . $langCode));
- $this->removeClass('\\app\\langs\\Lang' . $langCode);
+ $this->assertTrue(class_exists('\\App\\Langs\\Lang' . $langCode));
+ $this->removeClass('\\App\\Langs\\Lang' . $langCode);
Controller::getDriver()->initialize();
}
/**
@@ -242,7 +242,7 @@ public function testAddLang02() {
"Language code:\n",
"Error: Invalid language code.\n",
], $output);
- $this->removeClass('\\app\\langs\\LanguageFK');
+ $this->removeClass('\\App\\Langs\\LanguageFK');
}
/**
* @test
@@ -251,7 +251,7 @@ public function testAddSMTPConnection00() {
$connName = 'smtp-connection-'.count(App::getConfig()->getSMTPConnections());
$output = $this->executeSingleCommand(new AddCommand(), [
- 'webfiori',
+ 'WebFiori',
'add'
], [
'1',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index ee53c02d1..b6c9b0992 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -1,9 +1,9 @@
assertEquals([
"Info: Selected services manager has no service with name 'c'.\n",
"Which service you would like to have a test case for?\n",
@@ -38,7 +38,7 @@ public function testCreateAPITestCase01() {
"4: set-password\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\webfiori\\framework\scheduler\webServices\\TasksLoginServiceTest'."\n",
+ 'Name: tests\WebFiori\\Framework\scheduler\webServices\\TasksLoginServiceTest'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"Info: New class was created at \"".$path."\".\n"
@@ -53,7 +53,7 @@ public function testCreateAPITestCase01() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\webfiori\\framework\scheduler\webServices\\TasksLoginServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\TasksLoginServiceTest';
$this->assertTrue(file_exists($path.DS.'TasksLoginServiceTest.php'));
require_once $path.DS.'TasksLoginServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -63,7 +63,7 @@ public function testCreateAPITestCase01() {
* @test
*/
public function testCreateAPITestCase02() {
- $path = ROOT_PATH.DS."tests".DS."webfiori".DS."framework".DS."scheduler".DS."webServices";
+ $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."framework".DS."scheduler".DS."webServices";
$this->assertEquals([
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
@@ -74,7 +74,7 @@ public function testCreateAPITestCase02() {
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\webfiori\\framework\scheduler\webServices\\GetTasksServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -84,24 +84,24 @@ public function testCreateAPITestCase02() {
* @test
*/
public function testCreateAPITestCase03() {
- $path = ROOT_PATH.DS."tests".DS."webfiori".DS."framework".DS."scheduler".DS."webServices";
+ $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."framework".DS."scheduler".DS."webServices";
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\webfiori\\framework\scheduler\webServices\\GetTasksServiceTest'."\n",
+ 'Name: tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\webfiori\\framework\scheduler\webServices'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\WebFiori\\Framework\scheduler\webServices'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
'--service' => 'get-tasks',
], [
- '\webfiori\\framework\scheduler\webServices\\TasksServicesManager',
+ '\WebFiori\\Framework\scheduler\webServices\\TasksServicesManager',
'n',
'10',
'',
@@ -109,7 +109,7 @@ public function testCreateAPITestCase03() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\webfiori\\framework\scheduler\webServices\\GetTasksServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -136,7 +136,7 @@ public function testCreateAPITestCase04() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\tests\\apis\\multiple\\ServicesManager00',
+ '\\Tests\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
@@ -144,7 +144,7 @@ public function testCreateAPITestCase04() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\apis\\multiple\\WebService00Test';
+ $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -160,7 +160,7 @@ public function testCreateAPITestCase05() {
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\tests\\apis\\emptyService\\EmptyServicesManager',
+ '--manager' => '\\Tests\\Apis\\EmptyService\\EmptyServicesManager',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -187,15 +187,15 @@ public function testCreateAPITestCase06() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\tests\\apis\\multiple\\WebService00',
- '\\tests\\apis\\multiple\\ServicesManager00',
+ '\\Tests\\Apis\\Multiple\\WebService00',
+ '\\Tests\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
'',
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\apis\\multiple\\WebService00Test';
+ $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -206,11 +206,11 @@ public function testCreateAPITestCase06() {
*/
public function testCreateAPITestCase07() {
$this->assertEquals([
- "Error: The argument --manager has invalid value: Not a class: \\tests\\apis\\emptyService\\Xyz\n",
+ "Error: The argument --manager has invalid value: Not a class: \\Tests\\Apis\\EmptyService\\Xyz\n",
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\tests\\apis\\emptyService\\Xyz',
+ '--manager' => '\\Tests\\Apis\\EmptyService\\Xyz',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -225,11 +225,11 @@ public function testCreateAPITestCase08() {
CreateCommand::class,
'--c' => 'api-test',
'--service' => 'say-hi-service-2',
- '--manager' => '\\tests\\apis\\multiple\\ServicesManager00',
+ '--manager' => '\\Tests\\Apis\\Multiple\\ServicesManager00',
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\apis\\multiple\\WebService01Test';
+ $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService01Test';
$this->assertTrue(file_exists($path.DS.'WebService01Test.php'));
require_once $path.DS.'WebService01Test.php';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
index 4f27c91d5..835806d43 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
@@ -1,9 +1,9 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'5',
@@ -62,7 +62,7 @@ public function testCreateCommand01() {
}
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'command'
], [
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateCommandTest.php
index b60a4b452..eacb03f84 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateCommandTest.php
@@ -1,8 +1,8 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'11',
@@ -44,7 +44,7 @@ public function testCreate00() {
*/
public function testCreate01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
"\n", // Hit Enter to pick default value (quit)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
index 13664f854..241d59b0b 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
@@ -1,10 +1,10 @@
removeAllDBConnections();
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'db'
], [
- 'tables\\EmployeeInfoTable',
+ 'Tables\\EmployeeInfoTable',
'EmployeeOperations',
"\n", // Hit Enter to pick default value (app\database)
'SuperUser',
@@ -36,15 +36,15 @@ public function test00() {
"Enter database table class name (include namespace):\n",
"We need from you to give us class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Warning: No database connections were found. Make sure to specify connection later inside the class.\n",
"We need from you to give us entity class information.\n",
"Entity class name:\n",
- "Entity namespace: Enter = 'app\\entity'\n",
+ "Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
"Info: New class was created at \"". ROOT_PATH.DS."app".DS."database\".\n"
], $output);
- $clazz = '\\app\\database\\EmployeeOperationsDB';
+ $clazz = '\\App\\Database\\EmployeeOperationsDB';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
@@ -54,15 +54,15 @@ public function test00() {
*/
public function test01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'db'
], [
- 'tables\\EmployeeInfoTable',
+ 'Tables\\EmployeeInfoTable',
'EmployeeS',
- 'app\\database\\empl',
+ 'App\\Database\\empl',
'SuperHero',
- 'app\\entity\\subs',
+ 'App\\Entity\\subs',
'y'
]);
@@ -71,15 +71,15 @@ public function test01() {
"Enter database table class name (include namespace):\n",
"We need from you to give us class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Warning: No database connections were found. Make sure to specify connection later inside the class.\n",
"We need from you to give us entity class information.\n",
"Entity class name:\n",
- "Entity namespace: Enter = 'app\\entity'\n",
+ "Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
"Info: New class was created at \"". ROOT_PATH.DS."app".DS."database".DS."empl\".\n"
], $output);
- $clazz = '\\app\\database\\empl\\EmployeeSDB';
+ $clazz = '\\App\\Database\\empl\\EmployeeSDB';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
@@ -94,16 +94,16 @@ public function test02() {
App::getConfig()->addOrUpdateDBConnection($conn);
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'db'
], [
- 'tables\\PositionInfoTable',
+ 'Tables\\PositionInfoTable',
'Position2x',
- 'app\\database',
+ 'App\\Database',
'0',
'SuperPosition',
- 'app\\entity\\subs',
+ 'App\\Entity\\subs',
'y'
]);
@@ -112,17 +112,17 @@ public function test02() {
"Enter database table class name (include namespace):\n",
"We need from you to give us class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Select database connecion to use with the class:\n",
"0: Test Connection\n",
"1: None <--\n",
"We need from you to give us entity class information.\n",
"Entity class name:\n",
- "Entity namespace: Enter = 'app\\entity'\n",
+ "Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
"Info: New class was created at \"". ROOT_PATH.DS."app".DS."database\".\n"
], $output);
- $clazz = '\\app\\database\\Position2xDB';
+ $clazz = '\\App\\Database\\Position2xDB';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
index f0d107ffa..0c155d31c 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
@@ -1,9 +1,9 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'entity',
'--table' => TestTable::class
@@ -32,7 +32,7 @@ public function testCreateEntity00() {
$this->assertEquals([
"We need from you to give us entity class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\entity'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Entity'\n",
"Would you like from your class to implement the interface JsonI?(Y/n)\n",
"Would you like to add extra attributes to the entity?(y/N)\n",
"Enter attribute name:\n",
@@ -48,8 +48,8 @@ public function testCreateEntity00() {
"Generating your entity...\n",
"Success: Entity class created.\n"
], $output);
- $this->assertTrue(class_exists('\\app\\entity\\NeEntity'));
- $this->removeClass('\\app\\entity\\NeEntity');
+ $this->assertTrue(class_exists('\\App\\Entity\\NeEntity'));
+ $this->removeClass('\\App\\Entity\\NeEntity');
}
/**
@@ -57,7 +57,7 @@ public function testCreateEntity00() {
*/
public function testCreateEntity01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'entiy', // Invalid command value
'--table' => TestTable::class
@@ -93,7 +93,7 @@ public function testCreateEntity01() {
"11: Quit. <--\n",
"We need from you to give us entity class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\entity'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Entity'\n",
"Would you like from your class to implement the interface JsonI?(Y/n)\n",
"Would you like to add extra attributes to the entity?(y/N)\n",
"Enter attribute name:\n",
@@ -109,7 +109,7 @@ public function testCreateEntity01() {
"Generating your entity...\n",
"Success: Entity class created.\n"
], $output);
- $this->assertTrue(class_exists('\\app\\entity\\NewEntity'));
- $this->removeClass('\\app\\entity\\NewEntity');
+ $this->assertTrue(class_exists('\\App\\Entity\\NewEntity'));
+ $this->removeClass('\\App\\Entity\\NewEntity');
}
}
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
index 68c2b3d71..63c137a04 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
@@ -1,10 +1,10 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'4',
'NewCoolMd',
- 'app\middleware',
+ 'App\Middleware',
'Check is authorized',
'22',
"\n", // Hit Enter to pick default value (no group)
@@ -44,14 +44,14 @@ public function testCreateMiddleware00() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\middleware'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Middleware'\n",
"Enter a name for the middleware:\n",
"Enter middleware priority: Enter = '0'\n",
"Would you like to add the middleware to a group?(y/N)\n",
'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."middleware\".\n",
], $output);
- $this->assertTrue(class_exists('\\app\\middleware\\NewCoolMdMiddleware'));
- $this->removeClass('\\app\\middleware\\NewCoolMdMiddleware');
+ $this->assertTrue(class_exists('\\App\\Middleware\\NewCoolMdMiddleware'));
+ $this->removeClass('\\App\\Middleware\\NewCoolMdMiddleware');
}
/**
@@ -59,12 +59,12 @@ public function testCreateMiddleware00() {
*/
public function testCreateMiddleware01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'middleware'
], [
'NewCool',
- 'app\middleware',
+ 'App\Middleware',
' ', // Invalid input (spaces only)
'Check is cool',
'22',
@@ -76,7 +76,7 @@ public function testCreateMiddleware01() {
$this->assertEquals(0, $this->getExitCode());
$this->assertEquals([
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\middleware'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Middleware'\n",
"Enter a name for the middleware:\n",
"Error: Invalid input is given. Try again.\n",
"Enter a name for the middleware:\n",
@@ -87,7 +87,7 @@ public function testCreateMiddleware01() {
'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."middleware\".\n",
], $output);
- $clazz = '\\app\\middleware\\NewCoolMiddleware';
+ $clazz = '\\App\\Middleware\\NewCoolMiddleware';
$this->assertTrue(class_exists($clazz));
$clazzObj = new $clazz();
$this->assertTrue($clazzObj instanceof AbstractMiddleware);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index 0ef67a48e..841fa27ca 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -1,9 +1,9 @@
assertEquals([
"Migration namespace: Enter = 'app\database\migrations'\n",
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateRESTTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateRESTTest.php
index 7c7273492..dbcad0935 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateRESTTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateRESTTest.php
@@ -1,11 +1,11 @@
removeAllDBConnections();
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'rest'
], [
'0',
'SuperUser',
- 'app\\entity\\super',
+ 'App\\Entity\\super',
'y',
'n',
- "app\\database\\super",
+ "App\\Database\\super",
"super_users",
"A table to hold super users information.",
"id",
@@ -57,7 +57,7 @@ public function test00() {
"n",
'n',
"y",
- "app\\apis\\super"
+ "App\\Apis\\super"
]);
$this->assertEquals(0, $this->getExitCode());
@@ -69,11 +69,11 @@ public function test00() {
"1: mssql\n",
"First thing, we need entity class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\entity'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Entity'\n",
"Would you like from your entity class to implement the interface JsonI?(Y/n)\n",
"Would you like to add extra attributes to the entity?(y/N)\n",
"Now, time to collect database table information.\n",
- "Provide us with a namespace for table class: Enter = 'app\database'\n",
+ "Provide us with a namespace for table class: Enter = 'App\Database'\n",
"Enter database table name:\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
@@ -108,7 +108,7 @@ public function test00() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Last thing needed is to provide us with namespace for web services: Enter = 'app\\apis'\n",
+ "Last thing needed is to provide us with namespace for web services: Enter = 'App\\Apis'\n",
"Creating entity class...\n",
"Creating database table class...\n",
"Creating database access class...\n",
@@ -116,17 +116,17 @@ public function test00() {
"Done.\n"
]), $output);
- $tableClazz = '\\app\\database\\super\\SuperUserTable';
- $entityClazz = '\\app\\entity\\super\\SuperUser';
- $dbClazz = "\\app\\database\\super\\SuperUserDB";
+ $tableClazz = '\\App\\Database\\super\\SuperUserTable';
+ $entityClazz = '\\App\\Entity\\super\\SuperUser';
+ $dbClazz = "\\App\\Database\\super\\SuperUserDB";
$apiClazzes = [
- '\\app\\apis\\super\\AddSuperUserService',
- '\\app\\apis\\super\\DeleteSuperUserService',
- '\\app\\apis\\super\\GetAllSuperUsersService',
- '\\app\\apis\\super\\GetSuperUserService',
- '\\app\\apis\\super\\UpdateSuperUserService',
- '\\app\\apis\\super\\UpdateFirstNameOfSuperUserService',
- '\\app\\apis\\super\\UpdateIsHappyOfSuperUserService'
+ '\\App\\Apis\\super\\AddSuperUserService',
+ '\\App\\Apis\\super\\DeleteSuperUserService',
+ '\\App\\Apis\\super\\GetAllSuperUsersService',
+ '\\App\\Apis\\super\\GetSuperUserService',
+ '\\App\\Apis\\super\\UpdateSuperUserService',
+ '\\App\\Apis\\super\\UpdateFirstNameOfSuperUserService',
+ '\\App\\Apis\\super\\UpdateIsHappyOfSuperUserService'
];
foreach ($apiClazzes as $clazz) {
@@ -152,16 +152,16 @@ public function test01() {
App::getConfig()->removeAllDBConnections();
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'rest'
], [
'0',
'SuperUserX',
- 'app\\entity\\super',
+ 'App\\Entity\\super',
'y',
'n',
- "app\\database\\super",
+ "App\\Database\\super",
"super_users",
"A table to hold super users information.",
"id",
@@ -191,7 +191,7 @@ public function test01() {
"n",
'n',
"y",
- "app\\apis\\super"
+ "App\\Apis\\super"
]);
$this->assertEquals(0, $this->getExitCode());
@@ -202,11 +202,11 @@ public function test01() {
"1: mssql\n",
"First thing, we need entity class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\entity'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Entity'\n",
"Would you like from your entity class to implement the interface JsonI?(Y/n)\n",
"Would you like to add extra attributes to the entity?(y/N)\n",
"Now, time to collect database table information.\n",
- "Provide us with a namespace for table class: Enter = 'app\database'\n",
+ "Provide us with a namespace for table class: Enter = 'App\Database'\n",
"Enter database table name:\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
@@ -243,7 +243,7 @@ public function test01() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Last thing needed is to provide us with namespace for web services: Enter = 'app\\apis'\n",
+ "Last thing needed is to provide us with namespace for web services: Enter = 'App\\Apis'\n",
"Creating entity class...\n",
"Creating database table class...\n",
"Creating database access class...\n",
@@ -251,18 +251,18 @@ public function test01() {
"Done.\n"
]), $output);
- $tableClazz = '\\app\\database\\super\\SuperUserXTable';
- $entityClazz = '\\app\\entity\\super\\SuperUserX';
- $dbClazz = "\\app\\database\\super\\SuperUserXDB";
+ $tableClazz = '\\App\\Database\\super\\SuperUserXTable';
+ $entityClazz = '\\App\\Entity\\super\\SuperUserX';
+ $dbClazz = "\\App\\Database\\super\\SuperUserXDB";
$apiClazzes = [
- '\\app\\apis\\super\\AddSuperUserXService',
- '\\app\\apis\\super\\DeleteSuperUserXService',
- '\\app\\apis\\super\\GetAllSuperUserXsService',
- '\\app\\apis\\super\\GetSuperUserXService',
- '\\app\\apis\\super\\UpdateSuperUserXService',
- '\\app\\apis\\super\\UpdateFirstNameOfSuperUserXService',
- '\\app\\apis\\super\\UpdateIsHappyOfSuperUserXService',
- '\\app\\apis\\super\\UpdateIdOfSuperUserXService'
+ '\\App\\Apis\\super\\AddSuperUserXService',
+ '\\App\\Apis\\super\\DeleteSuperUserXService',
+ '\\App\\Apis\\super\\GetAllSuperUserXsService',
+ '\\App\\Apis\\super\\GetSuperUserXService',
+ '\\App\\Apis\\super\\UpdateSuperUserXService',
+ '\\App\\Apis\\super\\UpdateFirstNameOfSuperUserXService',
+ '\\App\\Apis\\super\\UpdateIsHappyOfSuperUserXService',
+ '\\App\\Apis\\super\\UpdateIdOfSuperUserXService'
];
foreach ($apiClazzes as $clazz) {
@@ -291,16 +291,16 @@ public function test02() {
App::getConfig()->addOrUpdateDBConnection($conn);
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'rest',
], [
'Super Connection',
'SuperUserX9',
- 'app\\entity\\super',
+ 'App\\Entity\\super',
'y',
'n',
- "app\\database\\super",
+ "App\\Database\\super",
"super_users",
"A table to hold super users information.",
"id",
@@ -330,7 +330,7 @@ public function test02() {
"n",
'n',
"y",
- "app\\apis\\super"
+ "App\\Apis\\super"
]);
$this->assertEquals(0, $this->getExitCode());
@@ -339,11 +339,11 @@ public function test02() {
"0: Super Connection <--\n",
"First thing, we need entity class information.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\entity'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Entity'\n",
"Would you like from your entity class to implement the interface JsonI?(Y/n)\n",
"Would you like to add extra attributes to the entity?(y/N)\n",
"Now, time to collect database table information.\n",
- "Provide us with a namespace for table class: Enter = 'app\database'\n",
+ "Provide us with a namespace for table class: Enter = 'App\Database'\n",
"Enter database table name:\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
@@ -378,7 +378,7 @@ public function test02() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Last thing needed is to provide us with namespace for web services: Enter = 'app\\apis'\n",
+ "Last thing needed is to provide us with namespace for web services: Enter = 'App\\Apis'\n",
"Creating entity class...\n",
"Creating database table class...\n",
"Creating database access class...\n",
@@ -386,19 +386,19 @@ public function test02() {
"Done.\n"
]), $output);
- $tableClazz = '\\app\\database\\super\\SuperUserX9Table';
- $entityClazz = '\\app\\entity\\super\\SuperUserX9';
- $dbClazz = "\\app\\database\\super\\SuperUserX9DB";
+ $tableClazz = '\\App\\Database\\super\\SuperUserX9Table';
+ $entityClazz = '\\App\\Entity\\super\\SuperUserX9';
+ $dbClazz = "\\App\\Database\\super\\SuperUserX9DB";
$apiClazzes = [
- '\\app\\apis\\super\\AddSuperUserX9Service',
- '\\app\\apis\\super\\DeleteSuperUserX9Service',
- '\\app\\apis\\super\\GetAllSuperUserX9sService',
- '\\app\\apis\\super\\GetSuperUserX9Service',
- '\\app\\apis\\super\\UpdateSuperUserX9Service',
- '\\app\\apis\\super\\UpdateFirstNameOfSuperUserX9Service',
- '\\app\\apis\\super\\UpdateIsHappyOfSuperUserX9Service',
- '\\app\\apis\\super\\UpdateIdOfSuperUserX9Service',
- '\\app\\apis\\super\\UpdateIsHappyOfSuperUserX9Service'
+ '\\App\\Apis\\super\\AddSuperUserX9Service',
+ '\\App\\Apis\\super\\DeleteSuperUserX9Service',
+ '\\App\\Apis\\super\\GetAllSuperUserX9sService',
+ '\\App\\Apis\\super\\GetSuperUserX9Service',
+ '\\App\\Apis\\super\\UpdateSuperUserX9Service',
+ '\\App\\Apis\\super\\UpdateFirstNameOfSuperUserX9Service',
+ '\\App\\Apis\\super\\UpdateIsHappyOfSuperUserX9Service',
+ '\\App\\Apis\\super\\UpdateIdOfSuperUserX9Service',
+ '\\App\\Apis\\super\\UpdateIsHappyOfSuperUserX9Service'
];
foreach ($apiClazzes as $clazz) {
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
index e94674e7b..2e2ab4570 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
@@ -1,13 +1,13 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'table'
], [
@@ -87,8 +87,8 @@ public function testCreateTable00() {
]);
$this->assertEquals(0, $this->getExitCode());
- $this->assertTrue(class_exists('\\app\\database\\Cool00Table'));
- $clazz = '\\app\\database\\Cool00Table';
+ $this->assertTrue(class_exists('\\App\\Database\\Cool00Table'));
+ $clazz = '\\App\\Database\\Cool00Table';
$this->removeClass($clazz);
$testObj = new $clazz();
$this->assertTrue($testObj instanceof MySQLTable);
@@ -107,7 +107,7 @@ public function testCreateTable00() {
"0: mysql\n",
"1: mssql\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Enter database table name: Enter = 'cool_00_table'\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
@@ -129,7 +129,7 @@ public function testCreateTable00() {
*/
public function testCreateTable01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'table'
], [
@@ -149,7 +149,7 @@ public function testCreateTable01() {
]);
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\app\\database\\Cool01Table';
+ $clazz = '\\App\\Database\\Cool01Table';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
$testObj = new $clazz();
@@ -172,7 +172,7 @@ public function testCreateTable01() {
"0: mysql\n",
"1: mssql\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Enter database table name: Enter = 'cool_01_table'\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
@@ -193,7 +193,7 @@ public function testCreateTable01() {
*/
public function testCreateTable02() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'table'
], [
@@ -225,8 +225,8 @@ public function testCreateTable02() {
]);
$this->assertEquals(0, $this->getExitCode());
- $this->assertTrue(class_exists('\\app\\database\\Cool02Table'));
- $clazz = '\\app\\database\\Cool02Table';
+ $this->assertTrue(class_exists('\\App\\Database\\Cool02Table'));
+ $clazz = '\\App\\Database\\Cool02Table';
$this->removeClass($clazz);
$testObj = new $clazz();
$this->assertTrue($testObj instanceof MySQLTable);
@@ -247,7 +247,7 @@ public function testCreateTable02() {
"0: mysql\n",
"1: mssql\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Enter database table name: Enter = 'cool_02_table'\n",
"Enter your optional comment about the table:\n",
"Now you have to add columns to the table.\n",
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
index 17acb7f10..1c3197e2e 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
@@ -1,10 +1,10 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'3',
'SuperCoolTask',
- 'app\tasks',
+ 'App\Tasks',
'The Greatest task',
'The task will do nothing.',
'N',
@@ -45,13 +45,13 @@ public function test00() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\tasks'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Tasks'\n",
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
"Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
], $output);
- $clazz = '\\app\\tasks\\SuperCoolTask';
+ $clazz = '\\App\\Tasks\\SuperCoolTask';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
@@ -61,14 +61,14 @@ public function test00() {
*/
public function test01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'3',
'SuperCoolTask',
- 'app\tasks',
+ 'App\Tasks',
'SuperCool2',
- 'app\tasks',
+ 'App\Tasks',
'The Greatest task',
'The task will do nothing.',
'N',
@@ -91,18 +91,18 @@ public function test01() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\tasks'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Tasks'\n",
"Error: A class in the given namespace which has the given name was found.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\tasks'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Tasks'\n",
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
"Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
], $output);
- $clazz = '\\app\\tasks\\SuperCool2Task';
+ $clazz = '\\App\\Tasks\\SuperCool2Task';
$this->assertTrue(class_exists($clazz));
- $this->removeClass('\\app\\tasks\\SuperCoolTask');
+ $this->removeClass('\\App\\Tasks\\SuperCoolTask');
$this->removeClass($clazz);
}
@@ -111,12 +111,12 @@ public function test01() {
*/
public function test02() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'3',
'NewRound',
- 'app\tasks',
+ 'App\Tasks',
'', // Invalid empty name
'Invalid#', // Invalid name with special character
'Create Round task',
@@ -142,7 +142,7 @@ public function test02() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\tasks'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Tasks'\n",
"Enter a name for the task:\n",
"Error: Provided name is invalid!\n",
"Enter a name for the task:\n",
@@ -154,7 +154,7 @@ public function test02() {
"Would you like to add arguments to the task?(y/N)\n",
"Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
], $output);
- $clazz = '\\app\\tasks\\NewRoundTask';
+ $clazz = '\\App\\Tasks\\NewRoundTask';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
@@ -164,12 +164,12 @@ public function test02() {
*/
public function test03() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'task'
], [
'SendDailyReport',
- 'app\tasks',
+ 'App\Tasks',
'Send Sales Report',
'The task will execute every day to send sales report to management.',
'y',
@@ -190,7 +190,7 @@ public function test03() {
$this->assertEquals(0, $this->getExitCode());
$this->assertEquals([
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\\tasks'\n",
+ "Enter an optional namespace for the class: Enter = 'App\\Tasks'\n",
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
@@ -210,7 +210,7 @@ public function test03() {
"Would you like to add more arguments?(y/N)\n",
"Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
], $output);
- $clazz = '\\app\\tasks\\SendDailyReportTask';
+ $clazz = '\\App\\Tasks\\SendDailyReportTask';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
$task = new $clazz();
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
index dc8bf311b..c3e66729a 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
@@ -1,10 +1,10 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'6',
@@ -60,14 +60,14 @@ public function testCreateTheme00() {
*/
public function testCreateThemeWithExistingName() {
$runner = App::getRunner();
- $ns = '\\themes\\fioriTheme';
+ $ns = '\\Themes\\FioriTheme';
$name = 'NewFTestTheme';
$ns2 = '\\themes\\cool';
$name2 = 'NewFTestTheme';
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'6',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
index 092738710..f620ee3e0 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
@@ -1,8 +1,8 @@
executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create'
], [
'2',
@@ -55,7 +55,7 @@ public function test00() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\apis'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Apis'\n",
"Enter a name for the new web service:\n",
"Description:\n",
"Request method:\n",
@@ -91,9 +91,9 @@ public function test00() {
"Info: Don't forget to add the service to a services manager.\n",
], $output);
- $clazz = '\\app\\apis\\NewWebService';
+ $clazz = '\\App\\Apis\\NewWebService';
$this->assertTrue(class_exists($clazz));
- $this->removeClass('\\app\\apis\\NewWebService');
+ $this->removeClass('\\App\\Apis\\NewWebService');
$instance = new $clazz();
$instance instanceof AbstractWebService;
$this->assertEquals('get-hello', $instance->getName());
@@ -120,7 +120,7 @@ public function test00() {
*/
public function test01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'web-service'
], [
@@ -144,7 +144,7 @@ public function test01() {
$this->assertEquals(0, $this->getExitCode());
$this->assertEquals([
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\apis'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Apis'\n",
"Enter a name for the new web service:\n",
"Description:\n",
"Request method:\n",
@@ -190,9 +190,9 @@ public function test01() {
"Info: Don't forget to add the service to a services manager.\n",
], $output);
- $clazz = '\\app\\apis\\NewWeb2Service';
+ $clazz = '\\App\\Apis\\NewWeb2Service';
$this->assertTrue(class_exists($clazz));
- $this->removeClass('\\app\\apis\\NewWeb2Service');
+ $this->removeClass('\\App\\Apis\\NewWeb2Service');
$instance = new $clazz();
$instance instanceof AbstractWebService;
$this->assertEquals('get-hello-2', $instance->getName());
@@ -219,7 +219,7 @@ public function test01() {
*/
public function test02() {
$output = $this->executeSingleCommand(new CreateCommand(), [
- 'webfiori',
+ 'WebFiori',
'create',
'--c' => 'web-service'
], [
@@ -243,7 +243,7 @@ public function test02() {
$this->assertEquals(0, $this->getExitCode());
$this->assertEquals([
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\apis'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Apis'\n",
"Enter a name for the new web service:\n",
"Description:\n",
"Request method:\n",
@@ -289,7 +289,7 @@ public function test02() {
"Info: Don't forget to add the service to a services manager.\n",
], $output);
- $clazz = '\\app\\apis\\NewWeb3Service';
+ $clazz = '\\App\\Apis\\NewWeb3Service';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
$instance = new $clazz();
diff --git a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
index 2f520d683..f065feb56 100644
--- a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
@@ -1,11 +1,11 @@
getEntityMapper();
$mapper->setEntityName('CoolUser');
- $mapper->setNamespace('webfiori\\entity');
- $writter = new DBClassWriter('UserDBClass', 'webfiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\entity');
+ $writter = new DBClassWriter('UserDBClass', 'WebFiori\\db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -34,8 +34,8 @@ public function test01() {
$table = new EmployeeInfoTable();
$mapper = $table->getEntityMapper();
$mapper->setEntityName('Employee');
- $mapper->setNamespace('webfiori\\entity');
- $writter = new DBClassWriter('EmployeeDB', 'webfiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\entity');
+ $writter = new DBClassWriter('EmployeeDB', 'WebFiori\\db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -48,8 +48,8 @@ public function test02() {
$table = new PositionInfoTable();
$mapper = $table->getEntityMapper();
$mapper->setEntityName('Position');
- $mapper->setNamespace('webfiori\\entity');
- $writter = new DBClassWriter('PositionDB', 'webfiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\entity');
+ $writter = new DBClassWriter('PositionDB', 'WebFiori\\db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -60,7 +60,7 @@ public function test02() {
*/
public function test03() {
$table = new PositionInfoTable();
- $writter = new DBClassWriter('PositionDB2', 'webfiori\\db', $table);
+ $writter = new DBClassWriter('PositionDB2', 'WebFiori\\db', $table);
$writter->setConnection(' ');
$this->assertNull($writter->getConnectionName());
$writter->setConnection('ok-connection');
diff --git a/tests/WebFiori/Framework/Tests/Cli/HelpCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/HelpCommandTest.php
index 299ee050e..917064faf 100644
--- a/tests/WebFiori/Framework/Tests/Cli/HelpCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/HelpCommandTest.php
@@ -1,7 +1,7 @@
setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'list-routes'
]);
$runner->start();
@@ -34,7 +34,7 @@ public function test01() {
$runner = App::getRunner();
$runner->setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'list-routes'
]);
Router::addRoute([
diff --git a/tests/WebFiori/Framework/Tests/Cli/ListThemesCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/ListThemesCommandTest.php
index 32f1c0657..53357ae3b 100644
--- a/tests/WebFiori/Framework/Tests/Cli/ListThemesCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/ListThemesCommandTest.php
@@ -1,8 +1,8 @@
setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'list-themes'
]);
$runner->start();
@@ -33,7 +33,7 @@ public function test01() {
$runner = App::getRunner();
$runner->setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'list-themes',
'--theme-name' => "New Super Theme"
]);
@@ -54,7 +54,7 @@ public function test02() {
$runner = App::getRunner();
$runner->setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'list-themes',
'--theme-name="Not Exist"'
]);
diff --git a/tests/WebFiori/Framework/Tests/Cli/RunMigrationsCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/RunMigrationsCommandTest.php
index bdb059c82..0a8adc45b 100644
--- a/tests/WebFiori/Framework/Tests/Cli/RunMigrationsCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/RunMigrationsCommandTest.php
@@ -1,11 +1,11 @@
removeAllDBConnections();
$output = $this->executeSingleCommand(new RunSQLQueryCommand(), [
- 'webfiori',
+ 'WebFiori',
'run-query',
'--connection' => 'testing-connection',
'--no-confirm',
@@ -105,7 +105,7 @@ public function testQueryFromFile01() {
App::getConfig()->addOrUpdateDBConnection($conn);
$output = $this->executeSingleCommand(new RunSQLQueryCommand(), [
- 'webfiori',
+ 'WebFiori',
'run-query',
'--connection' => 'testing-connection',
'--no-confirm',
@@ -130,7 +130,7 @@ public function testQueryFromFile02() {
'run-query',
'--connection' => 'testing-connection',
'--no-confirm',
- '--file' => 'app\\database\\Test2Table.php'
+ '--file' => 'App\\Database\\Test2Table.php'
], []);
$this->assertEquals(-1, $this->getExitCode());
@@ -151,7 +151,7 @@ public function testQueryFromFile03() {
'run-query',
'--connection' => 'testing-connection',
'--no-confirm',
- '--file' => 'app\\database\\sql-file.sql'
+ '--file' => 'App\\Database\\sql-file.sql'
], []);
$this->assertEquals(0, $this->getExitCode());
diff --git a/tests/WebFiori/Framework/Tests/Cli/SchedulerCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/SchedulerCommandTest.php
index 223cfd540..9bb2d5fdb 100644
--- a/tests/WebFiori/Framework/Tests/Cli/SchedulerCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/SchedulerCommandTest.php
@@ -1,9 +1,9 @@
executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
], []);
@@ -39,7 +39,7 @@ public function testCheckScheduledTasks() {
TasksManager::setPassword('123456');
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--check',
'p' => '123456'
@@ -63,7 +63,7 @@ public function testCheckScheduledTasks() {
*/
public function testCheckWithoutPassword() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--check',
], []);
@@ -80,7 +80,7 @@ public function testCheckWithoutPassword() {
public function testForceTaskExecution() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'p' => '123456'
@@ -111,7 +111,7 @@ public function testForceTaskExecution() {
*/
public function testForceTaskWithLogging() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--show-log',
@@ -132,11 +132,11 @@ public function testForceTaskWithLogging() {
"Running task(s) check...\n",
"Forcing task 'Fail 1' to execute...\n",
"Active task: \"Fail 1\" ...\n",
- "Calling the method app\\tasks\Fail1TestTask::execute()\n",
+ "Calling the method App\\Tasks\Fail1TestTask::execute()\n",
"Info: Task Fail 1 Is executing...\n",
- "Calling the method app\\tasks\Fail1TestTask::onFail()\n",
+ "Calling the method App\\Tasks\Fail1TestTask::onFail()\n",
"Error: Task Fail 1 Failed.\n",
- "Calling the method app\\tasks\Fail1TestTask::afterExec()\n",
+ "Calling the method App\\Tasks\Fail1TestTask::afterExec()\n",
"Check finished.\n",
"Total number of tasks: 5\n",
"Executed Tasks: 1\n",
@@ -152,7 +152,7 @@ public function testForceTaskWithLogging() {
*/
public function testForceTaskWithExceptionLogging() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--show-log',
@@ -173,20 +173,20 @@ public function testForceTaskWithExceptionLogging() {
"Running task(s) check...\n",
"Forcing task 'Fail 2' to execute...\n",
"Active task: \"Fail 2\" ...\n",
- "Calling the method app\\tasks\Fail2TestTask::execute()\n",
- "WARNING: An exception was thrown while performing the operation app\\tasks\Fail2TestTask::execute. The output of the task might be not as expected.\n",
+ "Calling the method App\\Tasks\Fail2TestTask::execute()\n",
+ "WARNING: An exception was thrown while performing the operation App\\Tasks\Fail2TestTask::execute. The output of the task might be not as expected.\n",
"Exception class: Error\n",
- "Exception message: Call to undefined method app\\tasks\Fail2TestTask::undefined()\n",
+ "Exception message: Call to undefined method App\\Tasks\Fail2TestTask::undefined()\n",
"Thrown in: Fail2TestTask",
"Line: 44",
"Stack Trace:",
- "#0 At class webfiori\\framework\\scheduler\\AbstractTask Line:",
- "#1 At class webfiori\\framework\\scheduler\\AbstractTask Line:",
- "#2 At class webfiori\\framework\\scheduler\\AbstractTask Line:",
- "#3 At class webfiori\\framework\\scheduler\\TasksManager Line:",
- "#4 At class webfiori\\framework\\scheduler\\TasksManager Line:",
- "#5 At class webfiori\\framework\\cli\\commands\\SchedulerCommand Line:",
- "#6 At class webfiori\\framework\\cli\\commands\\SchedulerCommand Line:",
+ "#0 At class WebFiori\\Framework\\Scheduler\\AbstractTask Line:",
+ "#1 At class WebFiori\\Framework\\Scheduler\\AbstractTask Line:",
+ "#2 At class WebFiori\\Framework\\Scheduler\\AbstractTask Line:",
+ "#3 At class WebFiori\\Framework\\Scheduler\\TasksManager Line:",
+ "#4 At class WebFiori\\Framework\\Scheduler\\TasksManager Line:",
+ "#5 At class WebFiori\\Framework\\Cli\\Commands\\SchedulerCommand Line:",
+ "#6 At class WebFiori\\Framework\\Cli\\Commands\\SchedulerCommand Line:",
"#7 At class WebFiori\\Cli\\Command Line:",
"#8 At class WebFiori\\Cli\\Runner Line:",
"#9 At class WebFiori\\Cli\\Runner Line:",
@@ -210,7 +210,7 @@ public function testForceTaskWithExceptionLogging() {
public function testForceSpecificTaskByName() {
$this->getRunner(true);
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--show-log',
@@ -226,12 +226,12 @@ public function testForceSpecificTaskByName() {
"Running task(s) check...\n",
"Forcing task 'Success 1' to execute...\n",
"Active task: \"Success 1\" ...\n",
- "Calling the method app\\tasks\SuccessTestTask::execute()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::execute()\n",
"Start: 2021-07-08\n",
"End: \n",
"The task was forced.\n",
- "Calling the method app\\tasks\SuccessTestTask::onSuccess()\n",
- "Calling the method app\\tasks\SuccessTestTask::afterExec()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::onSuccess()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::afterExec()\n",
"Check finished.\n",
"Total number of tasks: 5\n",
"Executed Tasks: 1\n",
@@ -249,7 +249,7 @@ public function testForceTaskWithCustomArguments() {
TasksManager::execLog(true);
$this->getRunner(true);
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--show-log',
@@ -267,12 +267,12 @@ public function testForceTaskWithCustomArguments() {
"Running task(s) check...\n",
"Forcing task 'Success 1' to execute...\n",
"Active task: \"Success 1\" ...\n",
- "Calling the method app\\tasks\SuccessTestTask::execute()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::execute()\n",
"Start: 2021\n",
"End: 2022\n",
"The task was forced.\n",
- "Calling the method app\\tasks\SuccessTestTask::onSuccess()\n",
- "Calling the method app\\tasks\SuccessTestTask::afterExec()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::onSuccess()\n",
+ "Calling the method App\\Tasks\SuccessTestTask::afterExec()\n",
"Check finished.\n",
"Total number of tasks: 5\n",
"Executed Tasks: 1\n",
@@ -293,7 +293,7 @@ public function testForceTaskWithIncorrectPassword() {
TasksManager::registerTasks();
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--task-name' => 'Success 1',
@@ -318,7 +318,7 @@ public function testForceTaskWithIncorrectPassword() {
*/
public function testShowTaskArguments() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--task-name' => 'Success 1',
'--show-task-args',
@@ -338,7 +338,7 @@ public function testShowTaskArguments() {
*/
public function testShowTaskArgumentsWithSelection() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--show-task-args',
'p' => '123456'
@@ -364,7 +364,7 @@ public function testShowTaskArgumentsWithSelection() {
*/
public function testListAllScheduledTasks() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--list'
], []);
@@ -396,7 +396,7 @@ public function testListAllScheduledTasks() {
public function testCheckWithValidPassword() {
TasksManager::setPassword('123456');
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--check',
'p' => '123456'
@@ -425,7 +425,7 @@ public function testForceTaskWithInteractiveArguments() {
TasksManager::registerTasks();
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--task-name' => 'Success 1',
@@ -454,9 +454,9 @@ public function testForceTaskWithInteractiveArguments() {
'Running task(s) check...',
"Forcing task 'Success 1' to execute...",
"Active task: \"Success 1\" ...",
- "Calling the method app\\tasks\SuccessTestTask::execute()",
- "Calling the method app\\tasks\SuccessTestTask::onSuccess()",
- "Calling the method app\\tasks\SuccessTestTask::afterExec()",
+ "Calling the method App\\Tasks\SuccessTestTask::execute()",
+ "Calling the method App\\Tasks\SuccessTestTask::onSuccess()",
+ "Calling the method App\\Tasks\SuccessTestTask::afterExec()",
"Check finished.",
], TasksManager::getLogArray());
}
@@ -466,7 +466,7 @@ public function testForceTaskWithInteractiveArguments() {
*/
public function testCancelTaskSelection() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'p' => '123456'
@@ -491,7 +491,7 @@ public function testCancelTaskSelection() {
*/
public function testForceNonExistentTask() {
$output = $this->executeSingleCommand(new SchedulerCommand(), [
- 'webfiori',
+ 'WebFiori',
'scheduler',
'--force',
'--task-name="Rand"',
diff --git a/tests/WebFiori/Framework/Tests/Cli/SettingsCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/SettingsCommandTest.php
index 3f8344780..1ffe500b8 100644
--- a/tests/WebFiori/Framework/Tests/Cli/SettingsCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/SettingsCommandTest.php
@@ -1,9 +1,9 @@
setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'show-settings'
]);
$runner->start();
diff --git a/tests/WebFiori/Framework/Tests/Cli/UpdateSettingsCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/UpdateSettingsCommandTest.php
index 83b866786..43538d969 100644
--- a/tests/WebFiori/Framework/Tests/Cli/UpdateSettingsCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/UpdateSettingsCommandTest.php
@@ -1,11 +1,11 @@
initialize(true);
$runner = App::getRunner();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'q'
]);
@@ -44,7 +44,7 @@ public function testUpdateAppName00() {
'Super App',
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'app-name'
]);
@@ -73,7 +73,7 @@ public function testUpdateAppName01() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'app-name'
]);
@@ -109,7 +109,7 @@ public function testUpdateAppName02() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'app-name'
]);
@@ -137,7 +137,7 @@ public function testUpdateHomePage00() {
$runner->setInputs();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'home-page'
]);
@@ -161,7 +161,7 @@ public function testUpdateHomePage01() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'home-page'
]);
@@ -185,7 +185,7 @@ public function testUpdatePageDescription00() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'page-description'
]);
@@ -211,7 +211,7 @@ public function testUpdatePageTitle00() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'page-title'
]);
@@ -229,7 +229,7 @@ public function testUpdatePageTitle00() {
public function testUpdatePrimaryLang() {
$runner = App::getRunner();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'primary-lang'
]);
@@ -254,7 +254,7 @@ public function testUpdatePrimaryLang00() {
'NEW PAGE DESCRIPTION'
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'page-description'
]);
@@ -275,11 +275,11 @@ public function testUpdatePrimaryLang00() {
public function testUpdatePrimaryTheme00() {
$runner = App::getRunner();
$runner->setInputs([
- 'themes\\fioriTheme2\\NewTestTheme2'
+ 'Themes\\FioriTheme2\\NewTestTheme2'
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'theme'
]);
@@ -290,7 +290,7 @@ public function testUpdatePrimaryTheme00() {
"Success: Theme successfully updated.\n"
], $runner->getOutput());
- $this->assertEquals('themes\\fioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
+ $this->assertEquals('Themes\\FioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
}
/**
* @test
@@ -300,10 +300,10 @@ public function testUpdatePrimaryTheme01() {
$runner->setInputs([
'themes\\greeny\\NotATheme',
'',
- 'themes\\fioriTheme2\\NewTestTheme2'
+ 'Themes\\FioriTheme2\\NewTestTheme2'
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'theme'
]);
@@ -318,7 +318,7 @@ public function testUpdatePrimaryTheme01() {
"Success: Theme successfully updated.\n"
], $runner->getOutput());
- $this->assertEquals('themes\\fioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
+ $this->assertEquals('Themes\\FioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
}
/**
* @test
@@ -326,11 +326,11 @@ public function testUpdatePrimaryTheme01() {
public function testUpdatePrimaryTheme02() {
$runner = App::getRunner();
$runner->setInputs([
- 'webfiori\\framework\\Privilege',
- 'themes\\fioriTheme2\\NewTestTheme2'
+ 'WebFiori\\Framework\\Privilege',
+ 'Themes\\FioriTheme2\\NewTestTheme2'
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'theme'
]);
@@ -343,7 +343,7 @@ public function testUpdatePrimaryTheme02() {
"Success: Theme successfully updated.\n"
], $runner->getOutput());
- $this->assertEquals('themes\\fioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
+ $this->assertEquals('Themes\\FioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
}
/**
* @test
@@ -351,11 +351,11 @@ public function testUpdatePrimaryTheme02() {
public function testUpdatePrimaryTheme03() {
$runner = App::getRunner();
$runner->setInputs([
- 'webfiori\\framework\\App',
- 'themes\\fioriTheme2\\NewTestTheme2'
+ 'WebFiori\\Framework\\App',
+ 'Themes\\FioriTheme2\\NewTestTheme2'
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'theme'
]);
@@ -368,7 +368,7 @@ public function testUpdatePrimaryTheme03() {
"Success: Theme successfully updated.\n"
], $runner->getOutput());
- $this->assertEquals('themes\\fioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
+ $this->assertEquals('Themes\\FioriTheme2\\NewTestTheme2', App::getConfig()->getTheme());
}
/**
* @test
@@ -380,7 +380,7 @@ public function testUpdateSchedulerPass00() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'scheduler-pass',
]);
@@ -403,7 +403,7 @@ public function testUpdateSchedulerPass01() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'scheduler-pass',
]);
@@ -428,7 +428,7 @@ public function testUpdateTitleSep00() {
]);
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'xyz'
]);
@@ -458,7 +458,7 @@ public function testUpdateTitleSep00() {
public function testUpdateVersion00() {
$runner = App::getRunner();
$runner->setArgsVector([
- 'webfiori',
+ 'WebFiori',
'update-settings',
'--w' => 'version'
]);
diff --git a/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
index 722f5d1d8..8171040fd 100644
--- a/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
@@ -1,20 +1,20 @@
executeSingleCommand(new UpdateTableCommand(), [
- 'webfiori',
+ 'WebFiori',
'update-table',
], [
' ', // Invalid class name
'ok\\y\\Super', // Invalid class name
- 'app\\database\\TestTable',
+ 'App\\Database\\TestTable',
'0',
'new-col',
'1',
@@ -70,11 +70,11 @@ public function test00() {
"Enter your optional comment about the column:\n",
"Would you like to update same class or create a copy with the update?(y/N)\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Success: Column added.\n",
], $output);
- $clazz = '\\app\\database\\ModifiedOTable';
+ $clazz = '\\App\\Database\\ModifiedOTable';
$this->assertTrue(class_exists($clazz));
$file = new File(ROOT_PATH.$clazz.'.php');
$file->remove();
@@ -91,10 +91,10 @@ public function test00() {
*/
public function test01() {
$output = $this->executeSingleCommand(new UpdateTableCommand(), [
- 'webfiori',
+ 'WebFiori',
'update-table',
], [
- 'app\\database\\TestTable',
+ 'App\\Database\\TestTable',
'2',
'id',
'user-id',
@@ -149,11 +149,11 @@ public function test01() {
"Enter your optional comment about the column:\n",
"Would you like to update same class or create a copy with the update?(y/N)\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Success: Column updated.\n",
], $output);
- $clazz = '\\app\\database\\ModifiedTable';
+ $clazz = '\\App\\Database\\ModifiedTable';
$this->assertTrue(class_exists($clazz));
$file = new File(ROOT_PATH.$clazz.'.php');
$file->remove();
@@ -167,10 +167,10 @@ public function test01() {
public function test02() {
$output = $this->executeSingleCommand(new UpdateTableCommand(), [
- 'webfiori',
+ 'WebFiori',
'update-table',
], [
- 'app\\database\\Test2Table',
+ 'App\\Database\\Test2Table',
'4',
'0',
'y',
@@ -191,11 +191,11 @@ public function test02() {
"0: user_id_fk\n",
"Would you like to update same class or create a copy with the update?(y/N)\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\database'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Database'\n",
"Success: Table updated.\n",
], $output);
- $clazz = '\\app\\database\\Modified2Table';
+ $clazz = '\\App\\Database\\Modified2Table';
$this->assertTrue(class_exists($clazz));
$file = new File(ROOT_PATH.$clazz.'.php');
$file->remove();
diff --git a/tests/WebFiori/Framework/Tests/Cli/VersionCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/VersionCommandTest.php
index 4bdb4baa5..d40a98a80 100644
--- a/tests/WebFiori/Framework/Tests/Cli/VersionCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/VersionCommandTest.php
@@ -1,8 +1,8 @@
expectException(Exception::class);
- $this->expectExceptionMessage('A language class for the language \'FR\' was found. But it is not a sub class of \'webfiori\framework\Lang\'.');
+ $this->expectExceptionMessage('A language class for the language \'FR\' was found. But it is not a sub class of \'WebFiori\framework\Lang\'.');
Lang::loadTranslation('fr');
}
/**
@@ -221,7 +221,7 @@ public function testLoadTranslation02() {
*/
public function testLoadTranslation03() {
$this->expectException(Exception::class);
- $this->expectExceptionMessage('The translation file was found. But no object of type \'webfiori\framework\Lang\' is stored. Make sure that the parameter '
+ $this->expectExceptionMessage('The translation file was found. But no object of type \'WebFiori\framework\Lang\' is stored. Make sure that the parameter '
.'$addtoLoadedAfterCreate is set to true when creating the language object.');
Lang::loadTranslation('Jp');
}
diff --git a/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php b/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
index ec3f159e4..03cedf51e 100644
--- a/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
+++ b/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
@@ -1,14 +1,14 @@
setTheme(' New Super Theme ');
$theme3 = $page->getTheme();
- $this->assertTrue($theme3 instanceof \webfiori\framework\Theme);
+ $this->assertTrue($theme3 instanceof \WebFiori\framework\Theme);
}
/**
* @test
diff --git a/tests/WebFiori/Framework/Tests/PrivilegeTest.php b/tests/WebFiori/Framework/Tests/PrivilegeTest.php
index b5e976293..dfb71ba8c 100644
--- a/tests/WebFiori/Framework/Tests/PrivilegeTest.php
+++ b/tests/WebFiori/Framework/Tests/PrivilegeTest.php
@@ -1,10 +1,10 @@
expectException(InvalidArgumentException::class);
- $this->expectExceptionMessage("Invalid argument type. Expected 'string' or 'webfiori\\framework\\scheduler\\TaskArgument'");
+ $this->expectExceptionMessage("Invalid argument type. Expected 'string' or 'WebFiori\\Framework\\Scheduler\\TaskArgument'");
$job = new BaseTask();
$job->addExecutionArg(new Privilege());
}
diff --git a/tests/WebFiori/Framework/Tests/Scheduler/SchedulerTest.php b/tests/WebFiori/Framework/Tests/Scheduler/SchedulerTest.php
index 396f0bf3d..e3a136314 100644
--- a/tests/WebFiori/Framework/Tests/Scheduler/SchedulerTest.php
+++ b/tests/WebFiori/Framework/Tests/Scheduler/SchedulerTest.php
@@ -1,12 +1,12 @@
assertEquals('NewTask', $writter->getName());
- $this->assertEquals('app\\tasks', $writter->getNamespace());
+ $this->assertEquals('App\\Tasks', $writter->getNamespace());
$this->assertEquals('Task', $writter->getSuffix());
$this->assertEquals([
- "webfiori\\framework\\scheduler\\AbstractTask",
- "webfiori\\framework\\scheduler\\TaskStatusEmail",
- "webfiori\\framework\\scheduler\\TasksManager",
+ "WebFiori\\Framework\\Scheduler\\AbstractTask",
+ "WebFiori\\Framework\\Scheduler\\TaskStatusEmail",
+ "WebFiori\\Framework\\Scheduler\\TasksManager",
], $writter->getUseStatements());
$this->assertEquals('No Description', $writter->getTaskDescription());
$this->assertEquals(0, count($writter->getTask()->getArguments()));
@@ -33,12 +33,12 @@ public function test01() {
$writter = new SchedulerTaskClassWriter();
$writter->setClassName('NewOk');
$this->assertEquals('NewOkTask', $writter->getName());
- $this->assertEquals('app\\tasks', $writter->getNamespace());
+ $this->assertEquals('App\\Tasks', $writter->getNamespace());
$this->assertEquals('Task', $writter->getSuffix());
$this->assertEquals([
- "webfiori\\framework\\scheduler\\AbstractTask",
- "webfiori\\framework\\scheduler\\TaskStatusEmail",
- "webfiori\\framework\\scheduler\\TasksManager",
+ "WebFiori\\Framework\\Scheduler\\AbstractTask",
+ "WebFiori\\Framework\\Scheduler\\TaskStatusEmail",
+ "WebFiori\\Framework\\Scheduler\\TasksManager",
], $writter->getUseStatements());
$this->assertEquals('No Description', $writter->getTaskDescription());
$this->assertEquals(0, count($writter->getTask()->getArguments()));
@@ -63,12 +63,12 @@ public function test02() {
$this->assertEquals('NewOk2BTask', $writter->getName());
- $this->assertEquals('app\\tasks', $writter->getNamespace());
+ $this->assertEquals('App\\Tasks', $writter->getNamespace());
$this->assertEquals('Task', $writter->getSuffix());
$this->assertEquals([
- "webfiori\\framework\\scheduler\\AbstractTask",
- "webfiori\\framework\\scheduler\\TaskStatusEmail",
- "webfiori\\framework\\scheduler\\TasksManager",
+ "WebFiori\\Framework\\Scheduler\\AbstractTask",
+ "WebFiori\\Framework\\Scheduler\\TaskStatusEmail",
+ "WebFiori\\Framework\\Scheduler\\TasksManager",
], $writter->getUseStatements());
$this->assertEquals('A test Task', $writter->getTaskDescription());
$this->assertEquals(1, count($writter->getTask()->getArguments()));
diff --git a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
index 8d88d7d86..3541f1c1c 100644
--- a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
@@ -1,9 +1,9 @@
removeClass($clazz);
$runner = new SchemaRunner(null);
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
- $this->assertEquals('app\\database\\migrations', $writter->getNamespace());
+ $this->assertEquals('App\\Database\\migrations', $writter->getNamespace());
$this->assertEquals('', $writter->getSuffix());
$this->assertEquals([
"WebFiori\Database\Database",
@@ -53,7 +53,7 @@ public function test00() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('app\\database\\migrations\\Migration000', $m00->getName());
+ $this->assertEquals('App\\Database\\migrations\\Migration000', $m00->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
}
@@ -64,14 +64,14 @@ public function test01() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
$path = APP_PATH.DS.'database'.DS.'migrations';
- $ns = '\\app\\database\\migrations';
+ $ns = '\\App\\Database\\migrations';
$writter = new DatabaseMigrationWriter($runner);
$writter->setClassName('MyMigration');
$this->assertEquals('MyMigration', $writter->getName());
- $this->assertEquals('app\\database\\migrations', $writter->getNamespace());
+ $this->assertEquals('App\\Database\\migrations', $writter->getNamespace());
$writter->writeClass();
- $clazz = "\\app\\database\\migrations\\MyMigration";
+ $clazz = "\\App\\Database\\migrations\\MyMigration";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -79,7 +79,7 @@ public function test01() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('app\\database\\migrations\\MyMigration', $m00->getName());
+ $this->assertEquals('App\\Database\\migrations\\MyMigration', $m00->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
}
@@ -90,11 +90,11 @@ public function test02() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
$path = APP_PATH.DS.'database'.DS.'migrations';
- $ns = '\\app\\database\\migrations';
+ $ns = '\\App\\Database\\migrations';
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
$writter->writeClass();
- $clazz = "\\app\\database\\migrations\\Migration000";
+ $clazz = "\\App\\Database\\migrations\\Migration000";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -104,12 +104,12 @@ public function test02() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('app\\database\\migrations\\Migration000', $m00->getName());
+ $this->assertEquals('App\\Database\\migrations\\Migration000', $m00->getName());
$writter2 = new DatabaseMigrationWriter($runner2);
$this->assertEquals('Migration001', $writter2->getName());
$writter2->writeClass();
- $clazz2 = "\\app\\database\\migrations\\Migration001";
+ $clazz2 = "\\App\\Database\\migrations\\Migration001";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -120,7 +120,7 @@ public function test02() {
$this->assertEquals(2, count($migrations2));
$m01 = $migrations2[1];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('app\\database\\migrations\\Migration001', $m01->getName());
+ $this->assertEquals('App\\Database\\migrations\\Migration001', $m01->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
$this->removeClass($clazz2);
@@ -132,7 +132,7 @@ public function test03() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
$path = APP_PATH.DS.'database'.DS.'migrations';
- $ns = '\\app\\database\\migrations';
+ $ns = '\\App\\Database\\migrations';
$allClasses = [];
for ($x = 0 ; $x < 110 ; $x++) {
$writter = new DatabaseMigrationWriter($runner);
@@ -145,7 +145,7 @@ public function test03() {
}
$this->assertEquals($name, $writter->getName());
$writter->writeClass();
- $clazz = "\\app\\database\\migrations\\".$name;
+ $clazz = "\\App\\Database\\migrations\\".$name;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -158,10 +158,10 @@ public function test03() {
$this->assertEquals($x + 1, count($migrations));
$m = $migrations[$x];
$this->assertTrue($m instanceof AbstractMigration);
- $this->assertEquals("app\\database\\migrations\\" . $name, $m->getName());
+ $this->assertEquals("App\\Database\\migrations\\" . $name, $m->getName());
}
foreach ($migrations as $m) {
- $this->removeClass("\\app\\database\\migrations\\".$m->getName());
+ $this->removeClass("\\App\\Database\\migrations\\".$m->getName());
}
}
private function removeClass($classPath) {
diff --git a/tests/WebFiori/Framework/Tests/Writers/LangWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/LangWritterTest.php
index 99cf77370..e4257d4f2 100644
--- a/tests/WebFiori/Framework/Tests/Writers/LangWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/LangWritterTest.php
@@ -1,9 +1,9 @@
assertEquals('LangEN', $writter->getName());
- $this->assertEquals('app\\langs', $writter->getNamespace());
+ $this->assertEquals('App\\Langs', $writter->getNamespace());
$this->assertEquals('', $writter->getSuffix());
$this->assertEquals([
Lang::class
diff --git a/tests/WebFiori/Framework/Tests/Writers/MiddlewareWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/MiddlewareWritterTest.php
index 26b9fd894..9d91cbabc 100644
--- a/tests/WebFiori/Framework/Tests/Writers/MiddlewareWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/MiddlewareWritterTest.php
@@ -1,9 +1,9 @@
assertEquals('NewMiddleware', $writter->getName());
- $this->assertEquals('app\\middleware', $writter->getNamespace());
+ $this->assertEquals('App\\Middleware', $writter->getNamespace());
$this->assertEquals('Middleware', $writter->getSuffix());
$this->assertEquals([
- "webfiori\\framework\\middleware\\AbstractMiddleware",
- "webfiori\\framework\\session\\SessionsManager",
+ "WebFiori\\Framework\\Middleware\\AbstractMiddleware",
+ "WebFiori\\Framework\\Session\\SessionsManager",
"WebFiori\\Http\\Request",
"WebFiori\\Http\\Response",
], $writter->getUseStatements());
@@ -39,11 +39,11 @@ public function test01() {
$writter->addGroup('two-group');
$writter->addGroup('global');
$this->assertEquals('XMdMiddleware', $writter->getName());
- $this->assertEquals('app\\middleware', $writter->getNamespace());
+ $this->assertEquals('App\\Middleware', $writter->getNamespace());
$this->assertEquals('Middleware', $writter->getSuffix());
$this->assertEquals([
- "webfiori\\framework\\middleware\\AbstractMiddleware",
- "webfiori\\framework\\session\\SessionsManager",
+ "WebFiori\\Framework\\Middleware\\AbstractMiddleware",
+ "WebFiori\\Framework\\Session\\SessionsManager",
"WebFiori\\Http\\Request",
"WebFiori\\Http\\Response",
], $writter->getUseStatements());
diff --git a/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
index 966e6aa3f..05e37ec97 100644
--- a/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
@@ -1,11 +1,11 @@
assertEquals('NewTable', $writter->getName());
- $this->assertEquals('app\\database', $writter->getNamespace());
+ $this->assertEquals('App\\Database', $writter->getNamespace());
$this->assertEquals('Table', $writter->getSuffix());
$this->assertEquals([
@@ -34,15 +34,15 @@ public function test00() {
public function test01() {
$writter = new TableClassWriter();
$writter->setClassName('CoolT');
- $writter->setEntityInfo('MyEntity', 'app\\entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
+ $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
$this->assertEquals('CoolTTable', $writter->getName());
- $this->assertEquals('app\\database', $writter->getNamespace());
+ $this->assertEquals('App\\Database', $writter->getNamespace());
$this->assertEquals('Table', $writter->getSuffix());
$this->assertEquals([
], $writter->getUseStatements());
$this->assertEquals('MyEntity', $writter->getEntityName());
- $this->assertEquals('app\\entity', $writter->getEntityNamespace());
+ $this->assertEquals('App\\Entity', $writter->getEntityNamespace());
$this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'entity', $writter->getEntityPath());
$this->assertTrue($writter->getTable() instanceof MySQLTable);
$this->assertFalse($writter->getTable() instanceof MSSQLTable);
@@ -54,7 +54,7 @@ public function test01() {
$this->assertTrue($clazzObj instanceof MySQLTable);
$this->assertEquals('`new_table`', $clazzObj->getName());
$this->assertEquals(0, $clazzObj->getColsCount());
- $this->removeClass('app\\entity\\MyEntity');
+ $this->removeClass('App\\Entity\\MyEntity');
}
/**
* @test
@@ -63,7 +63,7 @@ public function test02() {
$writter = new TableClassWriter();
$writter->setClassName('CoolT2Table');
$writter->setTableType('mssql');
- $writter->setEntityInfo('MyEntity', 'app\\entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
+ $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
$this->assertEquals('CoolT2Table', $writter->getName());
$this->assertFalse($writter->getTable() instanceof MySQLTable);
@@ -76,7 +76,7 @@ public function test02() {
$this->assertTrue($clazzObj instanceof MSSQLTable);
$this->assertEquals('[new_table]', $clazzObj->getName());
$this->assertEquals(0, $clazzObj->getColsCount());
- $this->removeClass('app\\entity\\MyEntity');
+ $this->removeClass('App\\Entity\\MyEntity');
}
/**
* @test
diff --git a/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
index a34a81687..5d695bb68 100644
--- a/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
@@ -1,9 +1,9 @@
assertEquals('NewWebService', $writter->getName());
- $this->assertEquals('app\\apis', $writter->getNamespace());
+ $this->assertEquals('App\\Apis', $writter->getNamespace());
$this->assertEquals('Service', $writter->getSuffix());
$this->assertEquals([
"WebFiori\Http\AbstractWebService",
@@ -30,7 +30,7 @@ public function test01() {
$writter = new WebServiceWriter();
$writter->setClassName('SuperService');
$this->assertEquals('SuperService', $writter->getName());
- $this->assertEquals('app\\apis', $writter->getNamespace());
+ $this->assertEquals('App\\Apis', $writter->getNamespace());
$this->assertEquals('Service', $writter->getSuffix());
$this->assertEquals([
"WebFiori\Http\AbstractWebService",
@@ -58,7 +58,7 @@ public function test02() {
$writter = new WebServiceWriter();
$writter->setClassName('Super2Service');
$this->assertEquals('Super2Service', $writter->getName());
- $this->assertEquals('app\\apis', $writter->getNamespace());
+ $this->assertEquals('App\\Apis', $writter->getNamespace());
$this->assertEquals('Service', $writter->getSuffix());
$this->assertEquals([
"WebFiori\Http\AbstractWebService",
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index cf9903efa..204332d08 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -9,12 +9,12 @@
use WebFiori\Database\ConnectionInfo;
use WebFiori\Database\Schema\SchemaRunner;
-use webfiori\framework\App;
-use webfiori\framework\autoload\ClassLoader;
-use webfiori\framework\config\JsonDriver;
-use webfiori\framework\ThemeManager;
-use themes\fioriTheme\NewFTestTheme;
-use themes\fioriTheme2\NewTestTheme2;
+use WebFiori\Framework\App;
+use WebFiori\Framework\Autoload\ClassLoader;
+use WebFiori\Framework\Config\JsonDriver;
+use WebFiori\Framework\ThemeManager;
+use Themes\FioriTheme\NewFTestTheme;
+use Themes\FioriTheme2\NewTestTheme2;
$DS = DIRECTORY_SEPARATOR;
@@ -30,8 +30,8 @@
//WebFiori Framework might exist.
//Add and remove directories as needed.
$WebFioriFrameworkDirs = [
- __DIR__.$DS.'..'.$DS.'webfiori',
- __DIR__.$DS.'..'.$DS.'vendor'.$DS.'webfiori'.$DS.'webfiori'
+ __DIR__.$DS.'..'.$DS.'WebFiori',
+ __DIR__.$DS.'..'.$DS.'vendor'.$DS.'WebFiori'.$DS.'WebFiori'
];
fprintf(STDOUT, "PHP Version: '".PHP_VERSION."'\n");
fprintf(STDOUT, "Version ID: '".PHP_VERSION_ID."'\n");
@@ -48,7 +48,7 @@
foreach ($WebFioriFrameworkDirs as $dir) {
//linux
- $file = $DS.$dir.'framework'.$DS.'autoload'.$DS.'ClassLoader.php';
+ $file = $DS.$dir.$DS.'Framework'.$DS.'Autoload'.$DS.'ClassLoader.php';
fprintf(STDOUT,"Checking if file '$file' is exist...\n");
if (file_exists($file)) {
@@ -62,7 +62,7 @@
foreach ($WebFioriFrameworkDirs as $dir) {
//other
- $file = $dir.$DS.'framework'.$DS.'autoload'.$DS.'ClassLoader.php';
+ $file = $dir.$DS.'Framework'.$DS.'Autoload'.$DS.'ClassLoader.php';
fprintf(STDOUT,"Checking if file '$file' is exist...\n");
if (file_exists($file)) {
@@ -83,9 +83,10 @@
ClassLoader::get([
'search-folders' => [
'tests',
- 'webfiori',
+ 'WebFiori',
'vendor',
- 'app'
+ 'app',
+ 'Themes'
],
'define-root' => true,
'root' => $ROOT,
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index 720bfee7f..c20d678c1 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -5,82 +5,82 @@
- ../webfiori/framework/Access.php
- ../webfiori/framework/DB.php
- ../webfiori/framework/Language.php
+ ../WebFiori/Framework/Access.php
+ ../WebFiori/Framework/DB.php
+ ../WebFiori/Framework/Language.php
- ../webfiori/framework/config/JsonDriver.php
- ../webfiori/framework/config/ClassDriver.php
+ ../WebFiori/Framework/config/JsonDriver.php
+ ../WebFiori/Framework/config/ClassDriver.php
- ../webfiori/framework/Privilege.php
- ../webfiori/framework/PrivilegesGroup.php
- ../webfiori/framework/User.php
- ../webfiori/framework/Theme.php
+ ../WebFiori/Framework/Privilege.php
+ ../WebFiori/Framework/PrivilegesGroup.php
+ ../WebFiori/Framework/User.php
+ ../WebFiori/Framework/Theme.php
- ../webfiori/framework/ui/BeforeRenderCallback.php
- ../webfiori/framework/ui/WebPage.php
+ ../WebFiori/Framework/ui/BeforeRenderCallback.php
+ ../WebFiori/Framework/ui/WebPage.php
- ../webfiori/framework/scheduler/BaseTask.php
- ../webfiori/framework/scheduler/AbstractTask.php
- ../webfiori/framework/scheduler/TasksManager.php
- ../webfiori/framework/scheduler/TaskArgument.php
+ ../WebFiori/Framework/scheduler/BaseTask.php
+ ../WebFiori/Framework/scheduler/AbstractTask.php
+ ../WebFiori/Framework/scheduler/TasksManager.php
+ ../WebFiori/Framework/scheduler/TaskArgument.php
- ../webfiori/framework/router/RouterUri.php
- ../webfiori/framework/router/Router.php
+ ../WebFiori/Framework/router/RouterUri.php
+ ../WebFiori/Framework/router/Router.php
- ../webfiori/framework/middleware/AbstractMiddleware.php
- ../webfiori/framework/middleware/MiddlewareManager.php
- ../webfiori/framework/middleware/CacheMiddleware.php
- ../webfiori/framework/middleware/StartSessionMiddleware.php
+ ../WebFiori/Framework/middleware/AbstractMiddleware.php
+ ../WebFiori/Framework/middleware/MiddlewareManager.php
+ ../WebFiori/Framework/middleware/CacheMiddleware.php
+ ../WebFiori/Framework/middleware/StartSessionMiddleware.php
- ../webfiori/framework/session/Session.php
- ../webfiori/framework/session/SessionsManager.php
- ../webfiori/framework/session/DefaultSessionStorage.php
- ../webfiori/framework/session/DatabaseSessionStorage.php
- ../webfiori/framework/session/SessionDB.php
+ ../WebFiori/Framework/session/Session.php
+ ../WebFiori/Framework/session/SessionsManager.php
+ ../WebFiori/Framework/session/DefaultSessionStorage.php
+ ../WebFiori/Framework/session/DatabaseSessionStorage.php
+ ../WebFiori/Framework/session/SessionDB.php
- ../webfiori/framework/cli/commands/AddCommand.php
- ../webfiori/framework/cli/commands/CreateCommand.php
- ../webfiori/framework/cli/commands/ListRoutesCommand.php
- ../webfiori/framework/cli/commands/ListThemesCommand.php
- ../webfiori/framework/cli/commands/RunSQLQueryCommand.php
- ../webfiori/framework/cli/commands/SchedulerCommand.php
- ../webfiori/framework/cli/commands/SettingsCommand.php
- ../webfiori/framework/cli/commands/UpdateSettingsCommand.php
- ../webfiori/framework/cli/commands/UpdateTableCommand.php
- ../webfiori/framework/cli/commands/VersionCommand.php
- ../webfiori/framework/cli/commands/WHelpCommand.php
- ../webfiori/framework/cli/commands/RunMigrationsCommand.php
- ../webfiori/framework/cli/CLITestCase.php
- ../webfiori/framework/cli/CLIUtils.php
+ ../WebFiori/Framework/cli/commands/AddCommand.php
+ ../WebFiori/Framework/cli/commands/CreateCommand.php
+ ../WebFiori/Framework/cli/commands/ListRoutesCommand.php
+ ../WebFiori/Framework/cli/commands/ListThemesCommand.php
+ ../WebFiori/Framework/cli/commands/RunSQLQueryCommand.php
+ ../WebFiori/Framework/cli/commands/SchedulerCommand.php
+ ../WebFiori/Framework/cli/commands/SettingsCommand.php
+ ../WebFiori/Framework/cli/commands/UpdateSettingsCommand.php
+ ../WebFiori/Framework/cli/commands/UpdateTableCommand.php
+ ../WebFiori/Framework/cli/commands/VersionCommand.php
+ ../WebFiori/Framework/cli/commands/WHelpCommand.php
+ ../WebFiori/Framework/cli/commands/RunMigrationsCommand.php
+ ../WebFiori/Framework/cli/CLITestCase.php
+ ../WebFiori/Framework/cli/CLIUtils.php
- ../webfiori/framework/cli/helpers/ClassInfoReader.php
- ../webfiori/framework/cli/helpers/CreateBackgroundTask.php
- ../webfiori/framework/cli/helpers/CreateCLIClassHelper.php
- ../webfiori/framework/cli/helpers/CreateClassHelper.php
- ../webfiori/framework/cli/helpers/CreateDBAccessHelper.php
- ../webfiori/framework/cli/helpers/CreateFullRESTHelper.php
- ../webfiori/framework/cli/helpers/CreateMiddleware.php
- ../webfiori/framework/cli/helpers/CreateTableObj.php
- ../webfiori/framework/cli/helpers/CreateThemeHelper.php
- ../webfiori/framework/cli/helpers/CreateWebService.php
- ../webfiori/framework/cli/helpers/TableObjHelper.php
- ../webfiori/framework/cli/helpers/CreateAPITestCase.php
- ../webfiori/framework/cli/helpers/CreateMigration.php
+ ../WebFiori/Framework/cli/helpers/ClassInfoReader.php
+ ../WebFiori/Framework/cli/helpers/CreateBackgroundTask.php
+ ../WebFiori/Framework/cli/helpers/CreateCLIClassHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateClassHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateDBAccessHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateFullRESTHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateMiddleware.php
+ ../WebFiori/Framework/cli/helpers/CreateTableObj.php
+ ../WebFiori/Framework/cli/helpers/CreateThemeHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateWebService.php
+ ../WebFiori/Framework/cli/helpers/TableObjHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateAPITestCase.php
+ ../WebFiori/Framework/cli/helpers/CreateMigration.php
- ../webfiori/framework/writers/CLICommandClassWriter.php
- ../webfiori/framework/writers/ClassWriter.php
- ../webfiori/framework/writers/DBClassWriter.php
- ../webfiori/framework/writers/LangClassWriter.php
- ../webfiori/framework/writers/MiddlewareClassWriter.php
- ../webfiori/framework/writers/SchedulerTaskClassWriter.php
- ../webfiori/framework/writers/TableClassWriter.php
- ../webfiori/framework/writers/ThemeClassWriter.php
- ../webfiori/framework/writers/ThemeComponentWriter.php
- ../webfiori/framework/writers/WebServiceWriter.php
- ../webfiori/framework/writers/APITestCaseWriter.php
- ../webfiori/framework/writers/DatabaseMigrationWriter.php
+ ../WebFiori/Framework/writers/CLICommandClassWriter.php
+ ../WebFiori/Framework/writers/ClassWriter.php
+ ../WebFiori/Framework/writers/DBClassWriter.php
+ ../WebFiori/Framework/writers/LangClassWriter.php
+ ../WebFiori/Framework/writers/MiddlewareClassWriter.php
+ ../WebFiori/Framework/writers/SchedulerTaskClassWriter.php
+ ../WebFiori/Framework/writers/TableClassWriter.php
+ ../WebFiori/Framework/writers/ThemeClassWriter.php
+ ../WebFiori/Framework/writers/ThemeComponentWriter.php
+ ../WebFiori/Framework/writers/WebServiceWriter.php
+ ../WebFiori/Framework/writers/APITestCaseWriter.php
+ ../WebFiori/Framework/writers/DatabaseMigrationWriter.php
@@ -89,42 +89,42 @@
- ./webfiori/framework/test
- ./webfiori/framework/test/langs
- ./webfiori/framework/test/router
- ./webfiori/framework/test/mail
- ./webfiori/framework/test/writers
- ./webfiori/framework/test/cli
- ./webfiori/framework/test/theme
- ./webfiori/framework/test/scheduler
- ./webfiori/framework/test/session
+ ./WebFiori/Framework/Tests
+ ./WebFiori/Framework/Tests/Langs
+ ./WebFiori/Framework/Tests/Router
+ ./WebFiori/Framework/Tests/Mail
+ ./WebFiori/Framework/Tests/Writers
+ ./WebFiori/Framework/Tests/Cli
+ ./WebFiori/Framework/Tests/Theme
+ ./WebFiori/Framework/Tests/Scheduler
+ ./WebFiori/Framework/Tests/Session
- ./webfiori/framework/test/DBTest.php
+ ./WebFiori/Framework/Tests/DBTest.php
- ./webfiori/framework/test/langs
+ ./WebFiori/Framework/Tests/Langs
- ./webfiori/framework/test/router
+ ./WebFiori/Framework/Tests/Router
- ./webfiori/framework/test/mail
+ ./WebFiori/Framework/Tests/Mail
- ./webfiori/framework/test/writers
+ ./WebFiori/Framework/Tests/Writers
- ./webfiori/framework/test/cli
+ ./WebFiori/Framework/Tests/Cli
- ./webfiori/framework/test/theme
+ ./WebFiori/Framework/Tests/Theme
- ./webfiori/framework/test/scheduler
+ ./WebFiori/Framework/Tests/Scheduler
- ./webfiori/framework/test/session
+ ./WebFiori/Framework/Tests/Session
\ No newline at end of file
diff --git a/tests/phpunit10.xml b/tests/phpunit10.xml
index b9b55e805..2860fdfcf 100644
--- a/tests/phpunit10.xml
+++ b/tests/phpunit10.xml
@@ -10,111 +10,111 @@
- ./webfiori/framework/test
- ./webfiori/framework/test/theme
- ./webfiori/framework/test/cli
- ./webfiori/framework/test/langs
- ./webfiori/framework/test/router
- ./webfiori/framework/test/mail
- ./webfiori/framework/test/writers
- ./webfiori/framework/test/scheduler
- ./webfiori/framework/test/session
+ ./WebFiori/Framework/Tests
+ ./WebFiori/Framework/Tests/Theme
+ ./WebFiori/Framework/Tests/Cli
+ ./WebFiori/Framework/Tests/Langs
+ ./WebFiori/Framework/Tests/Router
+ ./WebFiori/Framework/Tests/Mail
+ ./WebFiori/Framework/Tests/Writers
+ ./WebFiori/Framework/Tests/Scheduler
+ ./WebFiori/Framework/Tests/Session
- ./webfiori/framework/test/DBTest.php
+ ./WebFiori/Framework/Tests/DBTest.php
- ./webfiori/framework/test/langs
+ ./WebFiori/Framework/Tests/Langs
- ./webfiori/framework/test/router
+ ./WebFiori/Framework/Tests/Router
- ./webfiori/framework/test/mail
+ ./WebFiori/Framework/Tests/Mail
- ./webfiori/framework/test/writers
+ ./WebFiori/Framework/Tests/Writers
- ./webfiori/framework/test/cli
+ ./WebFiori/Framework/Tests/Cli
- ./webfiori/framework/test/theme
+ ./WebFiori/Framework/Tests/Theme
- ./webfiori/framework/test/scheduler
+ ./WebFiori/Framework/Tests/Scheduler
- ./webfiori/framework/test/session
+ ./WebFiori/Framework/Tests/Session
- ../webfiori/framework/Access.php
- ../webfiori/framework/DB.php
- ../webfiori/framework/Language.php
- ../webfiori/framework/config/JsonDriver.php
- ../webfiori/framework/config/ClassDriver.php
- ../webfiori/framework/Privilege.php
- ../webfiori/framework/PrivilegesGroup.php
- ../webfiori/framework/User.php
- ../webfiori/framework/Theme.php
- ../webfiori/framework/ui/BeforeRenderCallback.php
- ../webfiori/framework/ui/WebPage.php
- ../webfiori/framework/scheduler/BaseTask.php
- ../webfiori/framework/scheduler/AbstractTask.php
- ../webfiori/framework/scheduler/TasksManager.php
- ../webfiori/framework/scheduler/TaskArgument.php
- ../webfiori/framework/router/RouterUri.php
- ../webfiori/framework/router/Router.php
- ../webfiori/framework/middleware/AbstractMiddleware.php
- ../webfiori/framework/middleware/MiddlewareManager.php
- ../webfiori/framework/middleware/CacheMiddleware.php
- ../webfiori/framework/middleware/StartSessionMiddleware.php
- ../webfiori/framework/session/Session.php
- ../webfiori/framework/session/SessionsManager.php
- ../webfiori/framework/session/DefaultSessionStorage.php
- ../webfiori/framework/session/DatabaseSessionStorage.php
- ../webfiori/framework/session/SessionDB.php
- ../webfiori/framework/cli/commands/AddCommand.php
- ../webfiori/framework/cli/commands/CreateCommand.php
- ../webfiori/framework/cli/commands/ListRoutesCommand.php
- ../webfiori/framework/cli/commands/ListThemesCommand.php
- ../webfiori/framework/cli/commands/RunSQLQueryCommand.php
- ../webfiori/framework/cli/commands/SchedulerCommand.php
- ../webfiori/framework/cli/commands/SettingsCommand.php
- ../webfiori/framework/cli/commands/UpdateSettingsCommand.php
- ../webfiori/framework/cli/commands/UpdateTableCommand.php
- ../webfiori/framework/cli/commands/VersionCommand.php
- ../webfiori/framework/cli/commands/WHelpCommand.php
- ../webfiori/framework/cli/commands/RunMigrationsCommand.php
- ../webfiori/framework/cli/CLITestCase.php
- ../webfiori/framework/cli/CLIUtils.php
- ../webfiori/framework/cli/helpers/ClassInfoReader.php
- ../webfiori/framework/cli/helpers/CreateBackgroundTask.php
- ../webfiori/framework/cli/helpers/CreateCLIClassHelper.php
- ../webfiori/framework/cli/helpers/CreateClassHelper.php
- ../webfiori/framework/cli/helpers/CreateDBAccessHelper.php
- ../webfiori/framework/cli/helpers/CreateFullRESTHelper.php
- ../webfiori/framework/cli/helpers/CreateMiddleware.php
- ../webfiori/framework/cli/helpers/CreateTableObj.php
- ../webfiori/framework/cli/helpers/CreateThemeHelper.php
- ../webfiori/framework/cli/helpers/CreateWebService.php
- ../webfiori/framework/cli/helpers/TableObjHelper.php
- ../webfiori/framework/cli/helpers/CreateAPITestCase.php
- ../webfiori/framework/cli/helpers/CreateMigration.php
- ../webfiori/framework/writers/CLICommandClassWriter.php
- ../webfiori/framework/writers/ClassWriter.php
- ../webfiori/framework/writers/DBClassWriter.php
- ../webfiori/framework/writers/LangClassWriter.php
- ../webfiori/framework/writers/MiddlewareClassWriter.php
- ../webfiori/framework/writers/SchedulerTaskClassWriter.php
- ../webfiori/framework/writers/TableClassWriter.php
- ../webfiori/framework/writers/ThemeClassWriter.php
- ../webfiori/framework/writers/ThemeComponentWriter.php
- ../webfiori/framework/writers/WebServiceWriter.php
- ../webfiori/framework/writers/APITestCaseWriter.php
- ../webfiori/framework/writers/DatabaseMigrationWriter.php
+ ../WebFiori/Framework/Access.php
+ ../WebFiori/Framework/DB.php
+ ../WebFiori/Framework/Language.php
+ ../WebFiori/Framework/config/JsonDriver.php
+ ../WebFiori/Framework/config/ClassDriver.php
+ ../WebFiori/Framework/Privilege.php
+ ../WebFiori/Framework/PrivilegesGroup.php
+ ../WebFiori/Framework/User.php
+ ../WebFiori/Framework/Theme.php
+ ../WebFiori/Framework/ui/BeforeRenderCallback.php
+ ../WebFiori/Framework/ui/WebPage.php
+ ../WebFiori/Framework/scheduler/BaseTask.php
+ ../WebFiori/Framework/scheduler/AbstractTask.php
+ ../WebFiori/Framework/scheduler/TasksManager.php
+ ../WebFiori/Framework/scheduler/TaskArgument.php
+ ../WebFiori/Framework/router/RouterUri.php
+ ../WebFiori/Framework/router/Router.php
+ ../WebFiori/Framework/middleware/AbstractMiddleware.php
+ ../WebFiori/Framework/middleware/MiddlewareManager.php
+ ../WebFiori/Framework/middleware/CacheMiddleware.php
+ ../WebFiori/Framework/middleware/StartSessionMiddleware.php
+ ../WebFiori/Framework/session/Session.php
+ ../WebFiori/Framework/session/SessionsManager.php
+ ../WebFiori/Framework/session/DefaultSessionStorage.php
+ ../WebFiori/Framework/session/DatabaseSessionStorage.php
+ ../WebFiori/Framework/session/SessionDB.php
+ ../WebFiori/Framework/cli/commands/AddCommand.php
+ ../WebFiori/Framework/cli/commands/CreateCommand.php
+ ../WebFiori/Framework/cli/commands/ListRoutesCommand.php
+ ../WebFiori/Framework/cli/commands/ListThemesCommand.php
+ ../WebFiori/Framework/cli/commands/RunSQLQueryCommand.php
+ ../WebFiori/Framework/cli/commands/SchedulerCommand.php
+ ../WebFiori/Framework/cli/commands/SettingsCommand.php
+ ../WebFiori/Framework/cli/commands/UpdateSettingsCommand.php
+ ../WebFiori/Framework/cli/commands/UpdateTableCommand.php
+ ../WebFiori/Framework/cli/commands/VersionCommand.php
+ ../WebFiori/Framework/cli/commands/WHelpCommand.php
+ ../WebFiori/Framework/cli/commands/RunMigrationsCommand.php
+ ../WebFiori/Framework/cli/CLITestCase.php
+ ../WebFiori/Framework/cli/CLIUtils.php
+ ../WebFiori/Framework/cli/helpers/ClassInfoReader.php
+ ../WebFiori/Framework/cli/helpers/CreateBackgroundTask.php
+ ../WebFiori/Framework/cli/helpers/CreateCLIClassHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateClassHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateDBAccessHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateFullRESTHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateMiddleware.php
+ ../WebFiori/Framework/cli/helpers/CreateTableObj.php
+ ../WebFiori/Framework/cli/helpers/CreateThemeHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateWebService.php
+ ../WebFiori/Framework/cli/helpers/TableObjHelper.php
+ ../WebFiori/Framework/cli/helpers/CreateAPITestCase.php
+ ../WebFiori/Framework/cli/helpers/CreateMigration.php
+ ../WebFiori/Framework/writers/CLICommandClassWriter.php
+ ../WebFiori/Framework/writers/ClassWriter.php
+ ../WebFiori/Framework/writers/DBClassWriter.php
+ ../WebFiori/Framework/writers/LangClassWriter.php
+ ../WebFiori/Framework/writers/MiddlewareClassWriter.php
+ ../WebFiori/Framework/writers/SchedulerTaskClassWriter.php
+ ../WebFiori/Framework/writers/TableClassWriter.php
+ ../WebFiori/Framework/writers/ThemeClassWriter.php
+ ../WebFiori/Framework/writers/ThemeComponentWriter.php
+ ../WebFiori/Framework/writers/WebServiceWriter.php
+ ../WebFiori/Framework/writers/APITestCaseWriter.php
+ ../WebFiori/Framework/writers/DatabaseMigrationWriter.php
From 91b29d9ae912bbe211272442b58bdf69000f1894 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Tue, 7 Oct 2025 23:02:34 +0300
Subject: [PATCH 06/45] Update index.php
---
public/index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/index.php b/public/index.php
index 8e8db2dcf..88e752ebc 100644
--- a/public/index.php
+++ b/public/index.php
@@ -13,7 +13,7 @@
*
* @since 2.3.0
*/
-define('APP_DIR', 'app');
+define('APP_DIR', 'App');
/**
From ab65faabf6cdb4b012d61a81dc670c8a9fbb2f16 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Tue, 7 Oct 2025 23:06:08 +0300
Subject: [PATCH 07/45] test: Renamed `apis` to `Apis`
---
tests/{Apiss => Apis}/EmptyService/EmptyServicesManager.php | 0
tests/{Apiss => Apis}/Multiple/ServicesManager00.php | 0
tests/{Apiss => Apis}/Multiple/WebService00.php | 0
tests/{Apiss => Apis}/Multiple/WebService01.php | 0
4 files changed, 0 insertions(+), 0 deletions(-)
rename tests/{Apiss => Apis}/EmptyService/EmptyServicesManager.php (100%)
rename tests/{Apiss => Apis}/Multiple/ServicesManager00.php (100%)
rename tests/{Apiss => Apis}/Multiple/WebService00.php (100%)
rename tests/{Apiss => Apis}/Multiple/WebService01.php (100%)
diff --git a/tests/Apiss/EmptyService/EmptyServicesManager.php b/tests/Apis/EmptyService/EmptyServicesManager.php
similarity index 100%
rename from tests/Apiss/EmptyService/EmptyServicesManager.php
rename to tests/Apis/EmptyService/EmptyServicesManager.php
diff --git a/tests/Apiss/Multiple/ServicesManager00.php b/tests/Apis/Multiple/ServicesManager00.php
similarity index 100%
rename from tests/Apiss/Multiple/ServicesManager00.php
rename to tests/Apis/Multiple/ServicesManager00.php
diff --git a/tests/Apiss/Multiple/WebService00.php b/tests/Apis/Multiple/WebService00.php
similarity index 100%
rename from tests/Apiss/Multiple/WebService00.php
rename to tests/Apis/Multiple/WebService00.php
diff --git a/tests/Apiss/Multiple/WebService01.php b/tests/Apis/Multiple/WebService01.php
similarity index 100%
rename from tests/Apiss/Multiple/WebService01.php
rename to tests/Apis/Multiple/WebService01.php
From bb2271665778a41162c27faf584b2b481f63c333 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Tue, 7 Oct 2025 23:07:11 +0300
Subject: [PATCH 08/45] test: Renamed `tables` to `Tables`
---
tests/{Tabless => Tables}/EmployeeInfoTable.php | 0
tests/{Tabless => Tables}/PositionInfoTable.php | 0
tests/{Tabless => Tables}/Schema.php | 0
tests/{Tabless => Tables}/Schema2.php | 0
tests/{Tabless => Tables}/Schema3.php | 0
tests/{Tabless => Tables}/UserInfoTable.php | 0
6 files changed, 0 insertions(+), 0 deletions(-)
rename tests/{Tabless => Tables}/EmployeeInfoTable.php (100%)
rename tests/{Tabless => Tables}/PositionInfoTable.php (100%)
rename tests/{Tabless => Tables}/Schema.php (100%)
rename tests/{Tabless => Tables}/Schema2.php (100%)
rename tests/{Tabless => Tables}/Schema3.php (100%)
rename tests/{Tabless => Tables}/UserInfoTable.php (100%)
diff --git a/tests/Tabless/EmployeeInfoTable.php b/tests/Tables/EmployeeInfoTable.php
similarity index 100%
rename from tests/Tabless/EmployeeInfoTable.php
rename to tests/Tables/EmployeeInfoTable.php
diff --git a/tests/Tabless/PositionInfoTable.php b/tests/Tables/PositionInfoTable.php
similarity index 100%
rename from tests/Tabless/PositionInfoTable.php
rename to tests/Tables/PositionInfoTable.php
diff --git a/tests/Tabless/Schema.php b/tests/Tables/Schema.php
similarity index 100%
rename from tests/Tabless/Schema.php
rename to tests/Tables/Schema.php
diff --git a/tests/Tabless/Schema2.php b/tests/Tables/Schema2.php
similarity index 100%
rename from tests/Tabless/Schema2.php
rename to tests/Tables/Schema2.php
diff --git a/tests/Tabless/Schema3.php b/tests/Tables/Schema3.php
similarity index 100%
rename from tests/Tabless/Schema3.php
rename to tests/Tables/Schema3.php
diff --git a/tests/Tabless/UserInfoTable.php b/tests/Tables/UserInfoTable.php
similarity index 100%
rename from tests/Tabless/UserInfoTable.php
rename to tests/Tables/UserInfoTable.php
From e9cb3c6e548d9c3b20591e1e976ad164b9a8d285 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Tue, 7 Oct 2025 23:24:59 +0300
Subject: [PATCH 09/45] refactor: Few Fixes
---
WebFiori/Framework/App.php | 4 +--
WebFiori/Framework/Autoload/ClassLoader.php | 25 ++++++++---------
WebFiori/Framework/Ini.php | 28 +++++++++----------
tests/WebFiori/Benchmark/RouterBench.php | 2 +-
tests/WebFiori/Framework/Tests/PageTest.php | 4 +--
.../Framework/Tests/Theme/ThemeTest.php | 6 ++--
6 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index f71d97570..06c92604b 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -417,7 +417,7 @@ public static function getRunner() : Runner {
self::$CliRunner->setBeforeStart(function (Runner $r)
{
$commands = [
- '\\WebFiori\\Framework\\Cli\commands\\WHelpCommand',
+ '\\WebFiori\\Framework\\Cli\\Commands\\WHelpCommand',
'\\WebFiori\\Framework\\Cli\\Commands\\VersionCommand',
'\\WebFiori\\Framework\\Cli\\Commands\\SettingsCommand',
'\\WebFiori\\Framework\\Cli\\Commands\\SchedulerCommand',
@@ -519,7 +519,7 @@ private function checkAppDir() {
*
* @since 2.2.1
*/
- define('APP_DIR','app');
+ define('APP_DIR','App');
}
if (strpos(APP_DIR, ' ') !== false || strpos(APP_DIR, '-')) {
diff --git a/WebFiori/Framework/Autoload/ClassLoader.php b/WebFiori/Framework/Autoload/ClassLoader.php
index 809b09dd3..61add8bea 100644
--- a/WebFiori/Framework/Autoload/ClassLoader.php
+++ b/WebFiori/Framework/Autoload/ClassLoader.php
@@ -232,23 +232,22 @@ public static function get(array $options = [
if (self::$loader === null) {
if (!defined('APP_DIR')) {
- define('APP_DIR', 'app');
+ define('APP_DIR', 'App');
}
$appFolder = APP_DIR;
$frameworkSearchFolders = [
'',
- $DS.'WebFiori'.$DS.'framework',
- $DS.'framework'.$DS.'exceptions',
- $DS.'framework'.$DS.'cli',
- $DS.'framework'.$DS.'ui',
- $DS.'framework',
- $DS.'themes',
- $DS.'logic',
- $DS.'apis',
- $DS.'pages',
- $DS.'ini',
- $DS.'libs',
- $DS.'config',
+ $DS.'WebFiori'.$DS.'Framework',
+ $DS.'Framework'.$DS.'Exceptions',
+ $DS.'Framework'.$DS.'Cli',
+ $DS.'Framework'.$DS.'Ui',
+ $DS.'Framework',
+ $DS.'Themes',
+ $DS.'Apis',
+ $DS.'Pages',
+ $DS.'Ini',
+ $DS.'Libs',
+ $DS.'Config',
$DS.$appFolder
];
diff --git a/WebFiori/Framework/Ini.php b/WebFiori/Framework/Ini.php
index 86cf53caf..053c8b96c 100644
--- a/WebFiori/Framework/Ini.php
+++ b/WebFiori/Framework/Ini.php
@@ -48,15 +48,15 @@ private function __construct() {
public static function createAppDirs() {
$DS = DIRECTORY_SEPARATOR;
self::mkdir(ROOT_PATH.$DS.APP_DIR);
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'ini');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'ini'.$DS.'routes');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'pages');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'commands');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'tasks');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'middleware');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'langs');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'apis');
- self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'config');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Init');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Init'.$DS.'Routes');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Pages');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Commands');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Tasks');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Middleware');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Langs');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Apis');
+ self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'Config');
self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'sto');
self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'sto'.$DS.'uploads');
self::mkdir(ROOT_PATH.$DS.APP_DIR.$DS.'sto'.$DS.'logs');
@@ -79,13 +79,13 @@ public static function createAppDirs() {
* @throws FileException
*/
public function createIniClass(string $className, string $comment) {
- $cFile = new File("$className.php", APP_PATH.'ini');
+ $cFile = new File("$className.php", APP_PATH.'Init');
$cFile->remove();
$cFile->create();
ClassDriver::a($cFile, [
"create(true);
$cFile->write();
- require_once APP_PATH.'ini'.DS."$className.php";
+ require_once APP_PATH.'Init'.DS."$className.php";
}
/**
@@ -117,11 +117,11 @@ public function createIniClass(string $className, string $comment) {
* @throws FileException
*/
public function createRoutesClass(string $className) {
- $cFile = new File("$className.php", APP_PATH.'ini'.DS.'routes');
+ $cFile = new File("$className.php", APP_PATH.'Init'.DS.'Routes');
$cFile->remove();
ClassDriver::a($cFile, " 'hello',
diff --git a/tests/WebFiori/Framework/Tests/PageTest.php b/tests/WebFiori/Framework/Tests/PageTest.php
index a946a01af..a67981fd9 100644
--- a/tests/WebFiori/Framework/Tests/PageTest.php
+++ b/tests/WebFiori/Framework/Tests/PageTest.php
@@ -27,7 +27,7 @@ protected function setUp(): void {
$themeNames = array_keys($registeredThemes);
if (!in_array('New Theme 2', $themeNames)) {
- ThemeManager::register(new \themes\fioriTheme2\NewTestTheme2());
+ ThemeManager::register(new \Themes\FioriTheme2\NewTestTheme2());
}
if (!in_array('New Super Theme', $themeNames)) {
@@ -40,7 +40,7 @@ protected function tearDown(): void {
$assetsPath = ROOT_PATH . DS . PUBLIC_FOLDER . DS . 'assets';
if (is_dir($assetsPath)) {
// Only remove theme directories, not the entire assets folder
- $themeDirs = ['fioriTheme', 'fioriTheme2', 'NewTestTheme2', 'NewFTestTheme'];
+ $themeDirs = ['FioriTheme', 'FioriTheme2', 'NewTestTheme2', 'NewFTestTheme'];
foreach ($themeDirs as $themeDir) {
$themePath = $assetsPath . DS . $themeDir;
if (is_dir($themePath)) {
diff --git a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
index e28e26899..cbfd38d84 100644
--- a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
@@ -60,7 +60,7 @@ public function testToJson00() {
public function testUseTheme00() {
$themeName = 'New Theme 2';
ThemeManager::resetRegistered();
- ThemeManager::register(new \themes\fioriTheme2\NewTestTheme2());
+ ThemeManager::register(new \Themes\FioriTheme2\NewTestTheme2());
//$this->assertFalse(Theme::isThemeLoaded($themeName));
$theme = ThemeManager::usingTheme($themeName);
$this->assertTrue($theme instanceof Theme);
@@ -71,9 +71,9 @@ public function testUseTheme00() {
$this->assertEquals('https://opensource.org/licenses/MIT',$theme->getLicenseUrl());
$this->assertEquals('MIT',$theme->getLicenseName());
$this->assertEquals(1,count(ThemeManager::getRegisteredThemes()));
- $this->assertEquals('fioriTheme2', $theme->getDirectoryName());
+ $this->assertEquals('FioriTheme2', $theme->getDirectoryName());
$this->assertEquals('https://my-theme-side.com', $theme->getUrl());
- $this->assertEquals(ROOT_PATH.DS.'themes'.DS.'fioriTheme2'.DS, $theme->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'themes'.DS.'FioriTheme2'.DS, $theme->getAbsolutePath());
$this->assertEquals('css', $theme->getCssDirName());
$this->assertEquals('js', $theme->getJsDirName());
$this->assertEquals('images', $theme->getImagesDirName());
From 0d489992473fa98ad5d5c0bb4d6cfa20083c8f30 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 01:25:20 +0300
Subject: [PATCH 10/45] refactor: `UI` to `Ui`
---
.../Framework/{Ui => UI - Copy}/BeforeRenderCallback.php | 0
WebFiori/Framework/{Ui => UI - Copy}/HTTPCodeView.php | 2 +-
WebFiori/Framework/{Ui => UI - Copy}/MessageBox.php | 2 +-
.../{Ui => UI - Copy}/ServerErrPage/ServerErrPage.php | 2 +-
.../{Ui => UI - Copy}/ServerErrPage/error-details.php | 0
.../{Ui => UI - Copy}/ServerErrPage/server-err-head.php | 0
.../{Ui => UI - Copy}/ServerErrPage/server-err-header.php | 0
.../ServerErrPage/server-err-stack-trace.php | 0
WebFiori/Framework/{Ui => UI - Copy}/StarterPage.php | 2 +-
WebFiori/Framework/{Ui => UI - Copy}/WebPage.php | 6 +++---
WebFiori/Framework/{Ui => UI - Copy}/ui-functions.php | 2 +-
11 files changed, 8 insertions(+), 8 deletions(-)
rename WebFiori/Framework/{Ui => UI - Copy}/BeforeRenderCallback.php (100%)
rename WebFiori/Framework/{Ui => UI - Copy}/HTTPCodeView.php (97%)
rename WebFiori/Framework/{Ui => UI - Copy}/MessageBox.php (99%)
rename WebFiori/Framework/{Ui => UI - Copy}/ServerErrPage/ServerErrPage.php (98%)
rename WebFiori/Framework/{Ui => UI - Copy}/ServerErrPage/error-details.php (100%)
rename WebFiori/Framework/{Ui => UI - Copy}/ServerErrPage/server-err-head.php (100%)
rename WebFiori/Framework/{Ui => UI - Copy}/ServerErrPage/server-err-header.php (100%)
rename WebFiori/Framework/{Ui => UI - Copy}/ServerErrPage/server-err-stack-trace.php (100%)
rename WebFiori/Framework/{Ui => UI - Copy}/StarterPage.php (99%)
rename WebFiori/Framework/{Ui => UI - Copy}/WebPage.php (99%)
rename WebFiori/Framework/{Ui => UI - Copy}/ui-functions.php (99%)
diff --git a/WebFiori/Framework/Ui/BeforeRenderCallback.php b/WebFiori/Framework/UI - Copy/BeforeRenderCallback.php
similarity index 100%
rename from WebFiori/Framework/Ui/BeforeRenderCallback.php
rename to WebFiori/Framework/UI - Copy/BeforeRenderCallback.php
diff --git a/WebFiori/Framework/Ui/HTTPCodeView.php b/WebFiori/Framework/UI - Copy/HTTPCodeView.php
similarity index 97%
rename from WebFiori/Framework/Ui/HTTPCodeView.php
rename to WebFiori/Framework/UI - Copy/HTTPCodeView.php
index 2539d0b71..d114fbb69 100644
--- a/WebFiori/Framework/Ui/HTTPCodeView.php
+++ b/WebFiori/Framework/UI - Copy/HTTPCodeView.php
@@ -11,7 +11,7 @@
namespace WebFiori\Framework\UI;
use WebFiori\Framework\App;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* A basic view which is used to display HTTP error codes taken from
* language file.
diff --git a/WebFiori/Framework/Ui/MessageBox.php b/WebFiori/Framework/UI - Copy/MessageBox.php
similarity index 99%
rename from WebFiori/Framework/Ui/MessageBox.php
rename to WebFiori/Framework/UI - Copy/MessageBox.php
index 59db37e49..9f5561792 100644
--- a/WebFiori/Framework/Ui/MessageBox.php
+++ b/WebFiori/Framework/UI - Copy/MessageBox.php
@@ -10,7 +10,7 @@
*/
namespace WebFiori\Framework\UI;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* A generic class for showing a floating box in web pages that can have any content
* in its body.
diff --git a/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php b/WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php
similarity index 98%
rename from WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
rename to WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php
index 80851c680..de5b38d88 100644
--- a/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
+++ b/WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php
@@ -12,7 +12,7 @@
use WebFiori\Error\AbstractHandler;
use WebFiori\Framework\UI\WebPage;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* A page which is used to display exception information when it is thrown or
* any other errors.
diff --git a/WebFiori/Framework/Ui/ServerErrPage/error-details.php b/WebFiori/Framework/UI - Copy/ServerErrPage/error-details.php
similarity index 100%
rename from WebFiori/Framework/Ui/ServerErrPage/error-details.php
rename to WebFiori/Framework/UI - Copy/ServerErrPage/error-details.php
diff --git a/WebFiori/Framework/Ui/ServerErrPage/server-err-head.php b/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-head.php
similarity index 100%
rename from WebFiori/Framework/Ui/ServerErrPage/server-err-head.php
rename to WebFiori/Framework/UI - Copy/ServerErrPage/server-err-head.php
diff --git a/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php b/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-header.php
similarity index 100%
rename from WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
rename to WebFiori/Framework/UI - Copy/ServerErrPage/server-err-header.php
diff --git a/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php b/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-stack-trace.php
similarity index 100%
rename from WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
rename to WebFiori/Framework/UI - Copy/ServerErrPage/server-err-stack-trace.php
diff --git a/WebFiori/Framework/Ui/StarterPage.php b/WebFiori/Framework/UI - Copy/StarterPage.php
similarity index 99%
rename from WebFiori/Framework/Ui/StarterPage.php
rename to WebFiori/Framework/UI - Copy/StarterPage.php
index b0122b379..7c83f6703 100644
--- a/WebFiori/Framework/Ui/StarterPage.php
+++ b/WebFiori/Framework/UI - Copy/StarterPage.php
@@ -81,7 +81,7 @@ public function __construct() {
.'basic instructions on how you may help in supporting the framework in many ways.',
$cardsRow->addChild('v-col', ['cols' => 12, 'md' => 6, 'sm' => 12]));
}
- private function createCard($link, $icon, $cardTitle, $paragraph, \WebFiori\UI\HTMLNode $el) {
+ private function createCard($link, $icon, $cardTitle, $paragraph, \WebFiori\Ui\HTMLNode $el) {
$card = $el->addChild('v-card', [
'hover',
'height' => '220px',
diff --git a/WebFiori/Framework/Ui/WebPage.php b/WebFiori/Framework/UI - Copy/WebPage.php
similarity index 99%
rename from WebFiori/Framework/Ui/WebPage.php
rename to WebFiori/Framework/UI - Copy/WebPage.php
index 219ac76fb..f85b4ea5b 100644
--- a/WebFiori/Framework/Ui/WebPage.php
+++ b/WebFiori/Framework/UI - Copy/WebPage.php
@@ -29,9 +29,9 @@
use WebFiori\Http\Request;
use WebFiori\Http\Response;
use WebFiori\Json\Json;
-use WebFiori\UI\HeadNode;
-use WebFiori\UI\HTMLDoc;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HeadNode;
+use WebFiori\Ui\HTMLDoc;
+use WebFiori\Ui\HTMLNode;
require_once 'ui-functions.php';
/**
* A base class that can be used to implement web pages.
diff --git a/WebFiori/Framework/Ui/ui-functions.php b/WebFiori/Framework/UI - Copy/ui-functions.php
similarity index 99%
rename from WebFiori/Framework/Ui/ui-functions.php
rename to WebFiori/Framework/UI - Copy/ui-functions.php
index 21fe2b876..e51e50fcf 100644
--- a/WebFiori/Framework/Ui/ui-functions.php
+++ b/WebFiori/Framework/UI - Copy/ui-functions.php
@@ -14,7 +14,7 @@
use WebFiori\Framework\UI\WebPage;
use WebFiori\Http\Response;
use WebFiori\Json\JsonI;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* This file contains functions that can be used inside PHP templates. The
From a45554f103637b1a967b7fae67a9bf5b0988a2c9 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 01:27:01 +0300
Subject: [PATCH 11/45] refactor: `UI` to `Ui`
---
Themes/FioriTheme/AsideSection.php | 2 +-
Themes/FioriTheme/FooterSection.php | 2 +-
Themes/FioriTheme/HeadSection.php | 2 +-
Themes/FioriTheme/HeaderSection.php | 2 +-
Themes/FioriTheme/NewFTestTheme.php | 4 ++--
Themes/FioriTheme2/AsideSection.php | 2 +-
Themes/FioriTheme2/FooterSection.php | 2 +-
Themes/FioriTheme2/HeadSection.php | 2 +-
Themes/FioriTheme2/HeaderSection.php | 2 +-
Themes/FioriTheme2/NewTestTheme2.php | 4 ++--
WebFiori/Framework/App.php | 2 +-
WebFiori/Framework/Router/Router.php | 2 +-
WebFiori/Framework/Router/RouterUri.php | 2 +-
WebFiori/Framework/Scheduler/TaskStatusEmail.php | 4 ++--
WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php | 4 ++--
WebFiori/Framework/Scheduler/WebUI/TasksTable.php | 4 ++--
WebFiori/Framework/Theme.php | 6 +++---
WebFiori/Framework/Writers/ThemeClassWriter.php | 4 ++--
tests/WebFiori/Framework/Tests/PageTest.php | 2 +-
19 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/Themes/FioriTheme/AsideSection.php b/Themes/FioriTheme/AsideSection.php
index 5234e22d7..971b953a3 100644
--- a/Themes/FioriTheme/AsideSection.php
+++ b/Themes/FioriTheme/AsideSection.php
@@ -1,7 +1,7 @@
'WebFiori\\Collections\\Node',
- 'WebFiori/ui' => 'WebFiori\\UI\\HTMLNode',
+ 'WebFiori/ui' => 'WebFiori\\Ui\\HTMLNode',
'WebFiori/jsonx' => 'WebFiori\\Json\\Json',
'WebFiori/database' => 'WebFiori\\Database\\ResultSet',
'WebFiori/http' => 'WebFiori\\Http\\Response',
diff --git a/WebFiori/Framework/Router/Router.php b/WebFiori/Framework/Router/Router.php
index cc8cf02d4..36ef763c9 100644
--- a/WebFiori/Framework/Router/Router.php
+++ b/WebFiori/Framework/Router/Router.php
@@ -24,7 +24,7 @@
use WebFiori\Http\Uri;
use WebFiori\Http\WebServicesManager;
use WebFiori\Json\Json;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* The basic class that is used to route user requests to the correct
* location.
diff --git a/WebFiori/Framework/Router/RouterUri.php b/WebFiori/Framework/Router/RouterUri.php
index ad73058a1..1651116a4 100644
--- a/WebFiori/Framework/Router/RouterUri.php
+++ b/WebFiori/Framework/Router/RouterUri.php
@@ -14,7 +14,7 @@
use InvalidArgumentException;
use WebFiori\Framework\Middleware\MiddlewareManager;
use WebFiori\Http\Uri;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* A class that is used to split URIs and get their parameters.
*
diff --git a/WebFiori/Framework/Scheduler/TaskStatusEmail.php b/WebFiori/Framework/Scheduler/TaskStatusEmail.php
index 372a19c9f..2f4f42288 100644
--- a/WebFiori/Framework/Scheduler/TaskStatusEmail.php
+++ b/WebFiori/Framework/Scheduler/TaskStatusEmail.php
@@ -13,8 +13,8 @@
use WebFiori\File\File;
use WebFiori\Framework\App;
use WebFiori\Framework\EmailMessage;
-use WebFiori\UI\HTMLNode;
-use WebFiori\UI\TableRow;
+use WebFiori\Ui\HTMLNode;
+use WebFiori\Ui\TableRow;
/**
* A class which can be used to send an email regarding the status of
* background task execution.
diff --git a/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php b/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
index 08d124846..b27c805ff 100644
--- a/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
+++ b/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
@@ -13,8 +13,8 @@
use WebFiori\Framework\App;
use WebFiori\Framework\UI\WebPage;
use WebFiori\Json\Json;
-use WebFiori\UI\HTMLNode;
-use WebFiori\UI\JsCode;
+use WebFiori\Ui\HTMLNode;
+use WebFiori\Ui\JsCode;
/**
* A generic view for scheduler related operations.
*
diff --git a/WebFiori/Framework/Scheduler/WebUI/TasksTable.php b/WebFiori/Framework/Scheduler/WebUI/TasksTable.php
index 81ab58b62..5293d2cf6 100644
--- a/WebFiori/Framework/Scheduler/WebUI/TasksTable.php
+++ b/WebFiori/Framework/Scheduler/WebUI/TasksTable.php
@@ -10,8 +10,8 @@
*/
namespace WebFiori\Framework\Scheduler\WebUI;
-use WebFiori\UI\exceptions\InvalidNodeNameException;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\exceptions\InvalidNodeNameException;
+use WebFiori\Ui\HTMLNode;
/**
* A table which is used to list all scheduled background tasks.
diff --git a/WebFiori/Framework/Theme.php b/WebFiori/Framework/Theme.php
index 2fa685c0b..38ff1196f 100644
--- a/WebFiori/Framework/Theme.php
+++ b/WebFiori/Framework/Theme.php
@@ -14,9 +14,9 @@
use WebFiori\Framework\UI\WebPage;
use WebFiori\Json\Json;
use WebFiori\Json\JsonI;
-use WebFiori\UI\exceptions\InvalidNodeNameException;
-use WebFiori\UI\HeadNode;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\exceptions\InvalidNodeNameException;
+use WebFiori\Ui\HeadNode;
+use WebFiori\Ui\HTMLNode;
/**
* A base class that is used to construct website UI.
*
diff --git a/WebFiori/Framework/Writers/ThemeClassWriter.php b/WebFiori/Framework/Writers/ThemeClassWriter.php
index 33754993b..1268a0046 100644
--- a/WebFiori/Framework/Writers/ThemeClassWriter.php
+++ b/WebFiori/Framework/Writers/ThemeClassWriter.php
@@ -12,8 +12,8 @@
use WebFiori\File\File;
use WebFiori\Framework\Theme;
-use WebFiori\UI\HeadNode;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HeadNode;
+use WebFiori\Ui\HTMLNode;
/**
* A class which is used to create basic theme skeleton.
diff --git a/tests/WebFiori/Framework/Tests/PageTest.php b/tests/WebFiori/Framework/Tests/PageTest.php
index a67981fd9..ee6825077 100644
--- a/tests/WebFiori/Framework/Tests/PageTest.php
+++ b/tests/WebFiori/Framework/Tests/PageTest.php
@@ -11,7 +11,7 @@
use WebFiori\Framework\ThemeManager;
use WebFiori\Framework\UI\WebPage;
use WebFiori\Framework\User;
-use WebFiori\UI\HTMLNode;
+use WebFiori\Ui\HTMLNode;
/**
* Description of PageTest
*
From 1a9a8a51b2340542788ec91c2cf80c8c48e3b95e Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 01:28:28 +0300
Subject: [PATCH 12/45] Update composer.json
---
composer.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/composer.json b/composer.json
index 9acd5db7b..9fa4d3792 100644
--- a/composer.json
+++ b/composer.json
@@ -26,11 +26,11 @@
"webfiori/http": "v4.0.*",
"webfiori/file": "v2.0.*",
"webfiori/jsonx": "v4.0.*",
- "webfiori/ui": "v3.0.*",
+ "webfiori/ui": "v4.0.*",
"webfiori/collections": "v2.0.*",
"webfiori/database": "v1.1.*",
"webfiori/cli": "v2.0.*",
- "webfiori/mailer": "v2.0.*",
+ "webfiori/mailer": "v2.1.*",
"webfiori/err": "v2.0.*"
},
"scripts": {
From 13aba92b69ae525b9455f90b02a1172b1ac94dc8 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 01:37:58 +0300
Subject: [PATCH 13/45] refactor: Namespaces Correction
---
App/Init/InitAutoLoad.php | 7 +++---
App/Init/InitCommands.php | 7 +++---
App/Init/InitMiddleware.php | 9 +++----
App/Init/InitPrivileges.php | 7 +++---
App/Init/InitTasks.php | 7 +++---
WebFiori/Framework/App.php | 24 +++++++++----------
.../Framework/Handlers/HTTPErrHandler.php | 2 +-
WebFiori/Framework/Router/Router.php | 6 ++---
.../Scheduler/WebUI/BaseTasksPage.php | 2 +-
WebFiori/Framework/Theme.php | 2 +-
.../BeforeRenderCallback.php | 2 +-
.../{UI - Copy => Ui}/HTTPCodeView.php | 2 +-
.../{UI - Copy => Ui}/MessageBox.php | 2 +-
.../ServerErrPage/ServerErrPage.php | 4 ++--
.../ServerErrPage/error-details.php | 2 +-
.../ServerErrPage/server-err-head.php | 2 +-
.../ServerErrPage/server-err-header.php | 2 +-
.../ServerErrPage/server-err-stack-trace.php | 2 +-
.../{UI - Copy => Ui}/StarterPage.php | 2 +-
.../Framework/{UI - Copy => Ui}/WebPage.php | 2 +-
.../{UI - Copy => Ui}/ui-functions.php | 2 +-
WebFiori/Framework/Util.php | 2 +-
.../Tests/Cli/ListRoutesCommandTest.php | 2 +-
tests/WebFiori/Framework/Tests/PageTest.php | 2 +-
24 files changed, 54 insertions(+), 49 deletions(-)
rename WebFiori/Framework/{UI - Copy => Ui}/BeforeRenderCallback.php (99%)
rename WebFiori/Framework/{UI - Copy => Ui}/HTTPCodeView.php (97%)
rename WebFiori/Framework/{UI - Copy => Ui}/MessageBox.php (99%)
rename WebFiori/Framework/{UI - Copy => Ui}/ServerErrPage/ServerErrPage.php (96%)
rename WebFiori/Framework/{UI - Copy => Ui}/ServerErrPage/error-details.php (97%)
rename WebFiori/Framework/{UI - Copy => Ui}/ServerErrPage/server-err-head.php (95%)
rename WebFiori/Framework/{UI - Copy => Ui}/ServerErrPage/server-err-header.php (92%)
rename WebFiori/Framework/{UI - Copy => Ui}/ServerErrPage/server-err-stack-trace.php (93%)
rename WebFiori/Framework/{UI - Copy => Ui}/StarterPage.php (99%)
rename WebFiori/Framework/{UI - Copy => Ui}/WebPage.php (99%)
rename WebFiori/Framework/{UI - Copy => Ui}/ui-functions.php (98%)
diff --git a/App/Init/InitAutoLoad.php b/App/Init/InitAutoLoad.php
index 39995d729..463d2d4c3 100644
--- a/App/Init/InitAutoLoad.php
+++ b/App/Init/InitAutoLoad.php
@@ -1,12 +1,13 @@
initThemesPath();
- if (!class_exists(APP_DIR.'\ini\InitPrivileges')) {
+ if (!class_exists(APP_DIR.'\\Init\\InitPrivileges')) {
Ini::get()->createIniClass('InitPrivileges', 'Initialize user groups and privileges.');
}
//Initialize privileges.
//This step must be done before initializing anything.
- self::call(APP_DIR.'\ini\InitPrivileges::init');
+ self::call(APP_DIR.'\\Init\\InitPrivileges::init');
$this->initMiddleware();
$this->initRoutes();
@@ -384,7 +384,7 @@ public static function initiate(string $appFolder = 'app', string $publicFolder
* @throws FileException
*/
public static function getRunner() : Runner {
- if (!class_exists(APP_DIR.'\ini\InitCommands')) {
+ if (!class_exists(APP_DIR.'\Init\InitCommands')) {
Ini::get()->createIniClass('InitCommands', 'A method that can be used to initialize CLI commands.');
}
@@ -435,7 +435,7 @@ public static function getRunner() : Runner {
$r->register(new $c());
}
$r->setDefaultCommand('help');
- self::call(APP_DIR.'\ini\InitCommands::init');
+ self::call(APP_DIR.'\Init\InitCommands::init');
});
}
@@ -621,11 +621,11 @@ private static function initAutoLoader() {
}
self::$AU = ClassLoader::get();
- if (!class_exists(APP_DIR.'\ini\InitAutoLoad')) {
+ if (!class_exists(APP_DIR.'\\Init\\InitAutoLoad')) {
Ini::createAppDirs();
Ini::get()->createIniClass('InitAutoLoad', 'Add user-defined directories to the set of directories at which the framework will search for classes.');
}
- self::call(APP_DIR.'\ini\InitAutoLoad::init');
+ self::call(APP_DIR.'\\Init\\InitAutoLoad::init');
}
/**
* Initialize global constants which has information about framework version.
@@ -671,11 +671,11 @@ private function initMiddleware() {
MiddlewareManager::register($inst);
});
- if (!class_exists(APP_DIR.'\ini\InitMiddleware')) {
+ if (!class_exists(APP_DIR.'\Init\InitMiddleware')) {
Ini::get()->createIniClass('InitMiddleware', 'Register middleware which are created outside the folder \'[APP_DIR]/middleware\'.');
}
MiddlewareManager::register(new StartSessionMiddleware());
- self::call(APP_DIR.'\ini\InitMiddleware::init');
+ self::call(APP_DIR.'\Init\InitMiddleware::init');
}
/**
* @throws FileException
@@ -684,10 +684,10 @@ private function initRoutes() {
$routesClasses = ['APIsRoutes', 'PagesRoutes', 'ClosureRoutes', 'OtherRoutes'];
foreach ($routesClasses as $className) {
- if (!class_exists(APP_DIR.'\\ini\\routes\\'.$className)) {
+ if (!class_exists(APP_DIR.'\\Init\\routes\\'.$className)) {
Ini::get()->createRoutesClass($className);
}
- self::call(APP_DIR.'\ini\routes\\'.$className.'::create');
+ self::call(APP_DIR.'\Init\routes\\'.$className.'::create');
}
if (Router::routesCount() != 0) {
@@ -706,7 +706,7 @@ private function initScheduler() {
$uriObj = new RouterUri(Request::getRequestedURI(), '');
$pathArr = $uriObj->getPathArray();
- if (!class_exists(APP_DIR.'\ini\InitTasks')) {
+ if (!class_exists(APP_DIR.'\Init\InitTasks')) {
Ini::get()->createIniClass('InitTasks', 'A method that can be used to register background tasks.');
}
@@ -716,7 +716,7 @@ private function initScheduler() {
}
TasksManager::getPassword(self::getConfig()->getSchedulerPassword());
//initialize scheduler tasks only if in CLI or scheduler is enabled through HTTP.
- self::call(APP_DIR.'\ini\InitTasks::init');
+ self::call(APP_DIR.'\Init\InitTasks::init');
TasksManager::registerTasks();
}
}
diff --git a/WebFiori/Framework/Handlers/HTTPErrHandler.php b/WebFiori/Framework/Handlers/HTTPErrHandler.php
index 30e0dfbfc..bd8de0c38 100644
--- a/WebFiori/Framework/Handlers/HTTPErrHandler.php
+++ b/WebFiori/Framework/Handlers/HTTPErrHandler.php
@@ -13,7 +13,7 @@
use WebFiori\Error\AbstractHandler;
use WebFiori\Framework\App;
use WebFiori\Framework\Router\Router;
-use WebFiori\Framework\UI\ServerErrPage\ServerErrPage;
+use WebFiori\Framework\Ui\ServerErrPage\ServerErrPage;
use WebFiori\Http\Request;
use WebFiori\Http\Response;
/**
diff --git a/WebFiori/Framework/Router/Router.php b/WebFiori/Framework/Router/Router.php
index 36ef763c9..e59ac5034 100644
--- a/WebFiori/Framework/Router/Router.php
+++ b/WebFiori/Framework/Router/Router.php
@@ -16,9 +16,9 @@
use WebFiori\File\exceptions\FileException;
use WebFiori\File\File;
use WebFiori\Framework\Exceptions\RoutingException;
-use WebFiori\Framework\UI\HTTPCodeView;
-use WebFiori\Framework\UI\StarterPage;
-use WebFiori\Framework\UI\WebPage;
+use WebFiori\Framework\Ui\HTTPCodeView;
+use WebFiori\Framework\Ui\StarterPage;
+use WebFiori\Framework\Ui\WebPage;
use WebFiori\Http\Request;
use WebFiori\Http\Response;
use WebFiori\Http\Uri;
diff --git a/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php b/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
index b27c805ff..543942495 100644
--- a/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
+++ b/WebFiori/Framework/Scheduler/WebUI/BaseTasksPage.php
@@ -11,7 +11,7 @@
namespace WebFiori\Framework\Scheduler\WebUI;
use WebFiori\Framework\App;
-use WebFiori\Framework\UI\WebPage;
+use WebFiori\Framework\Ui\WebPage;
use WebFiori\Json\Json;
use WebFiori\Ui\HTMLNode;
use WebFiori\Ui\JsCode;
diff --git a/WebFiori/Framework/Theme.php b/WebFiori/Framework/Theme.php
index 38ff1196f..a5dafc576 100644
--- a/WebFiori/Framework/Theme.php
+++ b/WebFiori/Framework/Theme.php
@@ -11,7 +11,7 @@
namespace WebFiori\Framework;
use ReflectionClass;
-use WebFiori\Framework\UI\WebPage;
+use WebFiori\Framework\Ui\WebPage;
use WebFiori\Json\Json;
use WebFiori\Json\JsonI;
use WebFiori\Ui\exceptions\InvalidNodeNameException;
diff --git a/WebFiori/Framework/UI - Copy/BeforeRenderCallback.php b/WebFiori/Framework/Ui/BeforeRenderCallback.php
similarity index 99%
rename from WebFiori/Framework/UI - Copy/BeforeRenderCallback.php
rename to WebFiori/Framework/Ui/BeforeRenderCallback.php
index 106bea5b2..059c34066 100644
--- a/WebFiori/Framework/UI - Copy/BeforeRenderCallback.php
+++ b/WebFiori/Framework/Ui/BeforeRenderCallback.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace WebFiori\Framework\UI;
+namespace WebFiori\Framework\Ui;
use WebFiori\Collections\Comparable;
/**
diff --git a/WebFiori/Framework/UI - Copy/HTTPCodeView.php b/WebFiori/Framework/Ui/HTTPCodeView.php
similarity index 97%
rename from WebFiori/Framework/UI - Copy/HTTPCodeView.php
rename to WebFiori/Framework/Ui/HTTPCodeView.php
index d114fbb69..6c3e8c989 100644
--- a/WebFiori/Framework/UI - Copy/HTTPCodeView.php
+++ b/WebFiori/Framework/Ui/HTTPCodeView.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace WebFiori\Framework\UI;
+namespace WebFiori\Framework\Ui;
use WebFiori\Framework\App;
use WebFiori\Ui\HTMLNode;
diff --git a/WebFiori/Framework/UI - Copy/MessageBox.php b/WebFiori/Framework/Ui/MessageBox.php
similarity index 99%
rename from WebFiori/Framework/UI - Copy/MessageBox.php
rename to WebFiori/Framework/Ui/MessageBox.php
index 9f5561792..6b562711c 100644
--- a/WebFiori/Framework/UI - Copy/MessageBox.php
+++ b/WebFiori/Framework/Ui/MessageBox.php
@@ -8,7 +8,7 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace WebFiori\Framework\UI;
+namespace WebFiori\Framework\Ui;
use WebFiori\Ui\HTMLNode;
/**
diff --git a/WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php b/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
similarity index 96%
rename from WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php
rename to WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
index de5b38d88..3f4525e25 100644
--- a/WebFiori/Framework/UI - Copy/ServerErrPage/ServerErrPage.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/ServerErrPage.php
@@ -8,10 +8,10 @@
* https://github.com/WebFiori/.github/blob/main/LICENSE
*
*/
-namespace WebFiori\Framework\UI\ServerErrPage;
+namespace WebFiori\Framework\Ui\ServerErrPage;
use WebFiori\Error\AbstractHandler;
-use WebFiori\Framework\UI\WebPage;
+use WebFiori\Framework\Ui\WebPage;
use WebFiori\Ui\HTMLNode;
/**
* A page which is used to display exception information when it is thrown or
diff --git a/WebFiori/Framework/UI - Copy/ServerErrPage/error-details.php b/WebFiori/Framework/Ui/ServerErrPage/error-details.php
similarity index 97%
rename from WebFiori/Framework/UI - Copy/ServerErrPage/error-details.php
rename to WebFiori/Framework/Ui/ServerErrPage/error-details.php
index bde2da28d..3cd680f8a 100644
--- a/WebFiori/Framework/UI - Copy/ServerErrPage/error-details.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/error-details.php
@@ -1,5 +1,5 @@
diff --git a/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-header.php b/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
similarity index 92%
rename from WebFiori/Framework/UI - Copy/ServerErrPage/server-err-header.php
rename to WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
index 88fef9d5e..ef7813919 100644
--- a/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-header.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/server-err-header.php
@@ -1,5 +1,5 @@
diff --git a/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-stack-trace.php b/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
similarity index 93%
rename from WebFiori/Framework/UI - Copy/ServerErrPage/server-err-stack-trace.php
rename to WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
index 7b62f964d..2b871f1b8 100644
--- a/WebFiori/Framework/UI - Copy/ServerErrPage/server-err-stack-trace.php
+++ b/WebFiori/Framework/Ui/ServerErrPage/server-err-stack-trace.php
@@ -1,5 +1,5 @@
Date: Wed, 8 Oct 2025 01:50:25 +0300
Subject: [PATCH 14/45] refactor: Namespaces Correction
---
WebFiori/Framework/App.php | 4 ++--
WebFiori/Framework/Scheduler/TasksManager.php | 2 +-
WebFiori/Framework/Writers/APITestCaseWriter.php | 2 +-
WebFiori/Framework/Writers/CommandClassWriter.php | 4 ++--
WebFiori/Framework/Writers/DatabaseMigrationWriter.php | 2 +-
WebFiori/Framework/Writers/MiddlewareClassWriter.php | 2 +-
WebFiori/Framework/Writers/SchedulerTaskClassWriter.php | 2 +-
WebFiori/Framework/Writers/TableClassWriter.php | 2 +-
WebFiori/Framework/Writers/ThemeClassWriter.php | 2 +-
WebFiori/Framework/Writers/WebServiceWriter.php | 2 +-
.../WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php | 4 ++--
tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php | 2 +-
.../WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php | 4 ++--
tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php | 6 +++---
tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php | 8 ++++----
.../WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php | 6 +++---
tests/WebFiori/Framework/Tests/Session/SessionTest.php | 2 +-
.../WebFiori/Framework/Tests/Writers/TableWritterTest.php | 6 +++---
tests/bootstrap.php | 2 +-
19 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index d515be27d..ace32b652 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -291,7 +291,7 @@ public static function handle() {
if (self::$ClassStatus == self::STATUS_NONE) {
$publicFolderName = 'public';
- self::initiate('app', $publicFolderName, self::getRoot().DIRECTORY_SEPARATOR.$publicFolderName);
+ self::initiate('App', $publicFolderName, self::getRoot().DIRECTORY_SEPARATOR.$publicFolderName);
}
if (self::$ClassStatus == self::STATUS_INITIATED) {
self::start();
@@ -321,7 +321,7 @@ public static function handle() {
* @param string $indexDir The directory at which index file exist at.
* Usually, its the value of the constant __DIR__.
*/
- public static function initiate(string $appFolder = 'app', string $publicFolder = 'public', string $indexDir = __DIR__) {
+ public static function initiate(string $appFolder = 'App', string $publicFolder = 'public', string $indexDir = __DIR__) {
/**
* Change encoding of mb_ functions to UTF-8
*/
diff --git a/WebFiori/Framework/Scheduler/TasksManager.php b/WebFiori/Framework/Scheduler/TasksManager.php
index 621cac630..cb61da33d 100644
--- a/WebFiori/Framework/Scheduler/TasksManager.php
+++ b/WebFiori/Framework/Scheduler/TasksManager.php
@@ -586,7 +586,7 @@ public static function monthlyTask(int $dayNumber, string $time, string $name, c
*/
public static function registerTasks() {
if (Runner::isCLI() || (defined('SCHEDULER_THROUGH_HTTP') && SCHEDULER_THROUGH_HTTP === true)) {
- App::autoRegister('tasks', function (AbstractTask $task)
+ App::autoRegister('Tasks', function (AbstractTask $task)
{
TasksManager::scheduleTask($task);
});
diff --git a/WebFiori/Framework/Writers/APITestCaseWriter.php b/WebFiori/Framework/Writers/APITestCaseWriter.php
index cdd46eb8f..770b7c2a2 100644
--- a/WebFiori/Framework/Writers/APITestCaseWriter.php
+++ b/WebFiori/Framework/Writers/APITestCaseWriter.php
@@ -31,7 +31,7 @@ class APITestCaseWriter extends ClassWriter {
* will be based on.
*/
public function __construct(?WebServicesManager $manager = null, null|string|AbstractWebService $service = null) {
- parent::__construct('WebService', ROOT_PATH.DS.'tests'.DS.'apis', 'tests\\apis');
+ parent::__construct('WebService', ROOT_PATH.DS.'tests'.DS.'Apis', 'tests\\Apis');
$this->setSuffix('Test');
if ($manager !== null) {
diff --git a/WebFiori/Framework/Writers/CommandClassWriter.php b/WebFiori/Framework/Writers/CommandClassWriter.php
index 0bd7573de..cbbb39649 100644
--- a/WebFiori/Framework/Writers/CommandClassWriter.php
+++ b/WebFiori/Framework/Writers/CommandClassWriter.php
@@ -41,12 +41,12 @@ class CommandClassWriter extends ClassWriter {
* the command will have.
*/
public function __construct() {
- parent::__construct('NewCommand', APP_PATH.'commands', APP_DIR.'\\commands');
+ parent::__construct('NewCommand', APP_PATH.'Commands', APP_DIR.'\\Commands');
$this->name = 'new-command';
$this->args = [];
$this->desc = '';
$this->setSuffix('Command');
- $this->setNamespace(APP_DIR.'\\commands');
+ $this->setNamespace(APP_DIR.'\\Commands');
$this->addUseStatement([
'WebFiori\\Cli\\Command'
]);
diff --git a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
index dba8ead9b..28d833adf 100644
--- a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
+++ b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
@@ -35,7 +35,7 @@ public function __construct(?SchemaRunner $runner) {
$this->setClassName($name);
- parent::__construct($name, APP_PATH.'database'.DS.'migrations', APP_DIR.'\\database\\migrations');
+ parent::__construct($name, APP_PATH.'Database'.DS.'migrations', APP_DIR.'\\Database\\migrations');
$this->addUseStatement([
Database::class,
AbstractMigration::class,
diff --git a/WebFiori/Framework/Writers/MiddlewareClassWriter.php b/WebFiori/Framework/Writers/MiddlewareClassWriter.php
index 4efc9228e..3eb89a583 100644
--- a/WebFiori/Framework/Writers/MiddlewareClassWriter.php
+++ b/WebFiori/Framework/Writers/MiddlewareClassWriter.php
@@ -47,7 +47,7 @@ class MiddlewareClassWriter extends ClassWriter {
* will be added to.
*/
public function __construct($middlewareName = '', $priority = 0, array $groupsArr = []) {
- parent::__construct('NewMiddleware', APP_PATH.'middleware', APP_DIR.'\\middleware');
+ parent::__construct('NewMiddleware', APP_PATH.'Middleware', APP_DIR.'\\Middleware');
$this->setSuffix('Middleware');
$this->addUseStatement([
AbstractMiddleware::class,
diff --git a/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php b/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
index 928384105..e4438c8b3 100644
--- a/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
+++ b/WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
@@ -37,7 +37,7 @@ class SchedulerTaskClassWriter extends ClassWriter {
* the task needs.
*/
public function __construct(string $className = 'NewTask', $taskName = '', $taskDesc = '', array $argsArr = []) {
- parent::__construct($className, APP_PATH.'tasks', APP_DIR.'\\tasks');
+ parent::__construct($className, APP_PATH.'Tasks', APP_DIR.'\\Tasks');
$this->task = new BaseTask();
if (!$this->setTaskName($taskName)) {
diff --git a/WebFiori/Framework/Writers/TableClassWriter.php b/WebFiori/Framework/Writers/TableClassWriter.php
index 3a2a52223..13aec8e6b 100644
--- a/WebFiori/Framework/Writers/TableClassWriter.php
+++ b/WebFiori/Framework/Writers/TableClassWriter.php
@@ -76,7 +76,7 @@ class TableClassWriter extends ClassWriter {
* @since 1.0
*/
public function __construct(?Table $tableObj = null) {
- parent::__construct('NewTable', APP_PATH.'database', APP_DIR.'\\database');
+ parent::__construct('NewTable', APP_PATH.'Database', APP_DIR.'\\Database');
$this->setSuffix('Table');
if ($tableObj === null) {
diff --git a/WebFiori/Framework/Writers/ThemeClassWriter.php b/WebFiori/Framework/Writers/ThemeClassWriter.php
index 1268a0046..959c33bf4 100644
--- a/WebFiori/Framework/Writers/ThemeClassWriter.php
+++ b/WebFiori/Framework/Writers/ThemeClassWriter.php
@@ -34,7 +34,7 @@ class ThemeClassWriter extends ClassWriter {
*
*/
public function __construct(string $themeName = '') {
- parent::__construct('NewTheme', APP_PATH.'themes', APP_DIR.'\\themes\\new');
+ parent::__construct('NewTheme', APP_PATH.'Themes', APP_DIR.'\\Themes\\new');
if (!$this->setThemeName($themeName)) {
$this->setThemeName('New Theme');
diff --git a/WebFiori/Framework/Writers/WebServiceWriter.php b/WebFiori/Framework/Writers/WebServiceWriter.php
index cae3c03b7..ff34e67a5 100644
--- a/WebFiori/Framework/Writers/WebServiceWriter.php
+++ b/WebFiori/Framework/Writers/WebServiceWriter.php
@@ -47,7 +47,7 @@ class WebServiceWriter extends ClassWriter {
*
*/
public function __construct(?AbstractWebService $webServicesObj = null) {
- parent::__construct('NewWebService', APP_PATH.'apis', APP_DIR.'\\apis');
+ parent::__construct('NewWebService', APP_PATH.'Apis', APP_DIR.'\\Apis');
$this->setSuffix('Service');
$this->addUseStatement(AbstractWebService::class);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
index 835806d43..142266a87 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
@@ -46,7 +46,7 @@ public function testCreateCommand00() {
"Enter a name for the command:\n",
"Give a short description of the command:\n",
"Would you like to add arguments to the command?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."commands\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."commands\".\n",
], $output);
$this->assertTrue(class_exists('\\app\\commands\\NewCLICommand'));
$this->removeClass('\\app\\commands\\NewCLICommand');
@@ -105,7 +105,7 @@ public function testCreateCommand01() {
"Is this argument optional or not?(Y/n)\n",
"Enter default value:\n",
"Would you like to add more arguments?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."commands\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."commands\".\n",
], $output);
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
index 0c155d31c..d03c12545 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
@@ -13,7 +13,7 @@ public function testCreateEntity00() {
$output = $this->executeSingleCommand(new CreateCommand(), [
'WebFiori',
'create',
- '--c' => 'entity',
+ '--c' => 'Entity',
'--table' => TestTable::class
], [
'NeEntity',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
index 63c137a04..0e9897320 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
@@ -48,7 +48,7 @@ public function testCreateMiddleware00() {
"Enter a name for the middleware:\n",
"Enter middleware priority: Enter = '0'\n",
"Would you like to add the middleware to a group?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."middleware\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."middleware\".\n",
], $output);
$this->assertTrue(class_exists('\\App\\Middleware\\NewCoolMdMiddleware'));
$this->removeClass('\\App\\Middleware\\NewCoolMdMiddleware');
@@ -84,7 +84,7 @@ public function testCreateMiddleware01() {
"Would you like to add the middleware to a group?(y/N)\n",
"Enter group name:\n",
"Would you like to add the middleware to another group?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'app'.DS."middleware\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."middleware\".\n",
], $output);
$clazz = '\\App\\Middleware\\NewCoolMiddleware';
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
index 2e2ab4570..45084a699 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
@@ -120,7 +120,7 @@ public function testCreateTable00() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."database\".\n",
]), $output);
}
@@ -184,7 +184,7 @@ public function testCreateTable01() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."database\".\n",
]), $output);
}
@@ -272,7 +272,7 @@ public function testCreateTable02() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."database\".\n",
]), $output);
}
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
index 1c3197e2e..053d463f7 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
@@ -49,7 +49,7 @@ public function test00() {
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SuperCoolTask';
$this->assertTrue(class_exists($clazz));
@@ -98,7 +98,7 @@ public function test01() {
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SuperCool2Task';
$this->assertTrue(class_exists($clazz));
@@ -152,7 +152,7 @@ public function test02() {
"Error: Invalid input is given. Try again.\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\NewRoundTask';
$this->assertTrue(class_exists($clazz));
@@ -208,7 +208,7 @@ public function test03() {
"Enter argument name:\n",
"Error: Invalid argument name: \n",
"Would you like to add more arguments?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'app'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SendDailyReportTask';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
index f620ee3e0..7ef11a668 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
@@ -87,7 +87,7 @@ public function test00() {
"Success: New parameter added.\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: 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",
], $output);
@@ -186,7 +186,7 @@ public function test01() {
"Success: New parameter added.\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: 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",
], $output);
@@ -285,7 +285,7 @@ public function test02() {
"Success: New parameter added.\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: 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",
], $output);
diff --git a/tests/WebFiori/Framework/Tests/Session/SessionTest.php b/tests/WebFiori/Framework/Tests/Session/SessionTest.php
index 8db6ba28a..1b6475a40 100644
--- a/tests/WebFiori/Framework/Tests/Session/SessionTest.php
+++ b/tests/WebFiori/Framework/Tests/Session/SessionTest.php
@@ -26,7 +26,7 @@ protected function setUp(): void {
*/
public function testClose00($session) {
$session->close();
- $filePath = ROOT_PATH.DS.'app'.DS.'sto'.DS.'sessions'.DS.$session->getId();
+ $filePath = ROOT_PATH.DS.'App'.DS.'sto'.DS.'sessions'.DS.$session->getId();
$this->assertTrue(File::isFileExist($filePath));
$this->assertFalse($session->isRunning());
$this->assertEquals(0,$session->getStartedAt());
diff --git a/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
index 05e37ec97..1f4d76278 100644
--- a/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/TableWritterTest.php
@@ -34,7 +34,7 @@ public function test00() {
public function test01() {
$writter = new TableClassWriter();
$writter->setClassName('CoolT');
- $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
+ $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'Entity', true);
$this->assertEquals('CoolTTable', $writter->getName());
$this->assertEquals('App\\Database', $writter->getNamespace());
$this->assertEquals('Table', $writter->getSuffix());
@@ -43,7 +43,7 @@ public function test01() {
], $writter->getUseStatements());
$this->assertEquals('MyEntity', $writter->getEntityName());
$this->assertEquals('App\\Entity', $writter->getEntityNamespace());
- $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'entity', $writter->getEntityPath());
+ $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Entity', $writter->getEntityPath());
$this->assertTrue($writter->getTable() instanceof MySQLTable);
$this->assertFalse($writter->getTable() instanceof MSSQLTable);
$writter->writeClass();
@@ -63,7 +63,7 @@ public function test02() {
$writter = new TableClassWriter();
$writter->setClassName('CoolT2Table');
$writter->setTableType('mssql');
- $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'entity', true);
+ $writter->setEntityInfo('MyEntity', 'App\\Entity', ROOT_PATH.DS.APP_DIR.DS.'Entity', true);
$this->assertEquals('CoolT2Table', $writter->getName());
$this->assertFalse($writter->getTable() instanceof MySQLTable);
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 204332d08..16ef1fe6e 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -85,7 +85,7 @@
'tests',
'WebFiori',
'vendor',
- 'app',
+ 'App',
'Themes'
],
'define-root' => true,
From 62a721ab331406054bb47b4a70116ce611e95138 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 02:00:09 +0300
Subject: [PATCH 15/45] test: Namespaces Correction
---
tests/TestEntities/UserContactInfo.php | 2 +-
.../Framework/Tests/Cli/CreateMiddlewareTest.php | 2 +-
.../Framework/Tests/Cli/CreateMigrationTest.php | 4 ++--
.../Framework/Tests/Cli/CreateThemeTest.php | 14 +++++++-------
tests/WebFiori/Framework/Tests/DBTest.php | 4 ++--
tests/WebFiori/Framework/Tests/PageTest.php | 2 +-
.../WebFiori/Framework/Tests/Router/RouterTest.php | 4 ++--
tests/WebFiori/Framework/Tests/Theme/ThemeTest.php | 2 +-
.../Tests/Writers/CLICommandClassWriterTest.php | 6 +++---
.../Tests/Writers/DatabaseMigrationWriterTest.php | 10 +++++-----
.../Framework/Tests/Writers/ThemeWritterTest.php | 8 ++++----
.../Tests/Writers/WebServiceTestCaseWriterTest.php | 6 +++---
12 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/tests/TestEntities/UserContactInfo.php b/tests/TestEntities/UserContactInfo.php
index 2760b2877..8d46b1436 100644
--- a/tests/TestEntities/UserContactInfo.php
+++ b/tests/TestEntities/UserContactInfo.php
@@ -29,7 +29,7 @@ public function __construct() {
$this->getCol('contact-type')->setIsUnique(false);
$this->getCol('contact-type')->setIsPrimary(true);
$this->table->addColumn('contact-info', new MySQLColumn('contact_info', 'varchar',320));
- $this->table->addReference('WebFiori\tests\database\UsersQuery', [
+ $this->table->addReference('WebFiori\Tests\Database\UsersQuery', [
'user-id' => 'user-id'
], 'user_contact_info_fk', 'cadcade', 'cascade');
$this->setTable($this->table);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
index 0e9897320..3bec6c1e8 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
@@ -61,7 +61,7 @@ public function testCreateMiddleware01() {
$output = $this->executeSingleCommand(new CreateCommand(), [
'WebFiori',
'create',
- '--c' => 'middleware'
+ '--c' => 'Middleware'
], [
'NewCool',
'App\Middleware',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index 841fa27ca..55c08f262 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -11,7 +11,7 @@ class CreateMigrationTest extends CLITestCase {
protected function tearDown(): void {
// Clean up only specific migration files created by this test
- $migrationsDir = APP_PATH . DS . 'database' . DS . 'migrations';
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'migrations';
if (is_dir($migrationsDir)) {
// Only remove Migration files directly in the migrations directory
$files = glob($migrationsDir . DS . 'Migration[0-9][0-9][0-9].php');
@@ -41,7 +41,7 @@ public function testCreateMigration01() {
$this->assertEquals([
"Migration namespace: Enter = 'app\database\migrations'\n",
"Provide a name for the class that will have migration logic:\n",
- 'Info: New class was created at "'. APP_PATH .'database'.DS.'migrations".'."\n",
+ 'Info: New class was created at "'. APP_PATH .'Database'.DS.'migrations".'."\n",
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'migration',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
index c3e66729a..27f24f21a 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
@@ -41,9 +41,9 @@ public function testCreateTheme00() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'themes'\n",
- 'Creating theme at "'.ROOT_PATH.DS.'themes'.DS."fiori\"...\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'themes'.DS."fiori\".\n",
+ "Enter an optional namespace for the class: Enter = 'Themes'\n",
+ 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."fiori\"...\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."fiori\".\n",
], $output);
$this->assertTrue(class_exists('\\themes\\fiori\\NewTestTheme'));
@@ -94,12 +94,12 @@ public function testCreateThemeWithExistingName() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'themes'\n",
+ "Enter an optional namespace for the class: Enter = 'Themes'\n",
"Error: A class in the given namespace which has the given name was found.\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'themes'\n",
- 'Creating theme at "'.ROOT_PATH.DS.'themes'.DS."cool\"...\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'themes'.DS."cool\".\n",
+ "Enter an optional namespace for the class: Enter = 'Themes'\n",
+ 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."cool\"...\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."cool\".\n",
], $output);
$this->assertEquals(0, $this->getExitCode());
$this->removeClass($ns2.'\\'.$name2);
diff --git a/tests/WebFiori/Framework/Tests/DBTest.php b/tests/WebFiori/Framework/Tests/DBTest.php
index 21bb34ac7..57dd6de40 100644
--- a/tests/WebFiori/Framework/Tests/DBTest.php
+++ b/tests/WebFiori/Framework/Tests/DBTest.php
@@ -52,7 +52,7 @@ public function test03() {
$conn = new ConnectionInfo('mysql', 'root', '123456', 'testing_db');
$db = new DB($conn);
$this->assertEquals(0, count($db->getTables()));
- $db->register('database');
+ $db->register('Database');
$this->assertEquals(2, count($db->getTables()));
}
/**
@@ -64,7 +64,7 @@ public function test04() {
App::getConfig()->addOrUpdateDBConnection($conn);
$db = new DB('default-conn');
$this->assertEquals(0, count($db->getTables()));
- $db->register('database');
+ $db->register('Database');
$this->assertEquals(2, count($db->getTables()));
App::getConfig()->removeAllDBConnections();
}
diff --git a/tests/WebFiori/Framework/Tests/PageTest.php b/tests/WebFiori/Framework/Tests/PageTest.php
index 9b31c533f..493767024 100644
--- a/tests/WebFiori/Framework/Tests/PageTest.php
+++ b/tests/WebFiori/Framework/Tests/PageTest.php
@@ -31,7 +31,7 @@ protected function setUp(): void {
}
if (!in_array('New Super Theme', $themeNames)) {
- ThemeManager::register(new \themes\fioriTheme\NewFTestTheme());
+ ThemeManager::register(new \Themes\FioriTheme\NewFTestTheme());
}
}
diff --git a/tests/WebFiori/Framework/Tests/Router/RouterTest.php b/tests/WebFiori/Framework/Tests/Router/RouterTest.php
index 5cf2f0117..d63919f1f 100644
--- a/tests/WebFiori/Framework/Tests/Router/RouterTest.php
+++ b/tests/WebFiori/Framework/Tests/Router/RouterTest.php
@@ -500,7 +500,7 @@ public function testClassRoute00() {
Response::clear();
Router::addRoute([
RouteOption::PATH => 'home',
- RouteOption::TO => \app\apis\RoutingTestClass::class
+ RouteOption::TO => \App\Apis\RoutingTestClass::class
]);
Router::route('https://127.0.0.1/home');
@@ -514,7 +514,7 @@ public function testClassRoute02() {
Router::removeAll();
Router::addRoute([
RouteOption::PATH => 'home',
- RouteOption::TO => \app\apis\RoutingTestClass::class,
+ RouteOption::TO => \App\Apis\RoutingTestClass::class,
RouteOption::ACTION => 'doSomething'
]);
Router::route('https://127.0.0.1/home');
diff --git a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
index cbfd38d84..4783a7338 100644
--- a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
@@ -73,7 +73,7 @@ public function testUseTheme00() {
$this->assertEquals(1,count(ThemeManager::getRegisteredThemes()));
$this->assertEquals('FioriTheme2', $theme->getDirectoryName());
$this->assertEquals('https://my-theme-side.com', $theme->getUrl());
- $this->assertEquals(ROOT_PATH.DS.'themes'.DS.'FioriTheme2'.DS, $theme->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'Themes'.DS.'FioriTheme2'.DS, $theme->getAbsolutePath());
$this->assertEquals('css', $theme->getCssDirName());
$this->assertEquals('js', $theme->getJsDirName());
$this->assertEquals('images', $theme->getImagesDirName());
diff --git a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
index 3541f1c1c..165df1b7d 100644
--- a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
@@ -12,7 +12,7 @@ class CLICommandClassWriterTest extends TestCase {
public function test00() {
$writer = new CommandClassWriter();
$this->assertEquals('NewCommand', $writer->getName());
- $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'commands'.DS.'NewCommand.php', $writer->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'NewCommand.php', $writer->getAbsolutePath());
$this->assertEquals('app\\commands', $writer->getNamespace());
$this->assertEquals('new-command', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
@@ -37,7 +37,7 @@ public function test01() {
$this->assertFalse($writer->setClassName(' '));
$this->assertTrue($writer->setClassName('DoItXCommand'));
$this->assertEquals('DoItXCommand', $writer->getName());
- $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'commands'.DS.'DoItXCommand.php', $writer->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'DoItXCommand.php', $writer->getAbsolutePath());
$this->assertEquals('app\\commands', $writer->getNamespace());
$this->assertEquals('Lets-Do-It', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
@@ -80,7 +80,7 @@ public function test02() {
$this->assertFalse($writer->setClassName(' '));
$this->assertTrue($writer->setClassName('DoItX2Command'));
$this->assertEquals('DoItX2Command', $writer->getName());
- $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'commands'.DS.'DoItX2Command.php', $writer->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'DoItX2Command.php', $writer->getAbsolutePath());
$this->assertEquals('app\\commands', $writer->getNamespace());
$this->assertEquals('Lets-Do-It', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index ba87f4786..82ea557b5 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -14,7 +14,7 @@ class DatabaseMigrationWriterTest extends TestCase {
protected function tearDown(): void {
// Clean up only the Migration files created by this test (Migration000, Migration001, etc.)
- $migrationsDir = APP_PATH . DS . 'database' . DS . 'migrations';
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'migrations';
if (is_dir($migrationsDir)) {
// Only remove Migration files directly in the migrations directory, not in subdirectories
$files = glob($migrationsDir . DS . 'Migration[0-9][0-9][0-9].php');
@@ -31,7 +31,7 @@ protected function tearDown(): void {
*/
public function test00() {
DatabaseMigrationWriter::resetCounter();
- $path = APP_PATH.DS.'database'.DS.'migrations';
+ $path = APP_PATH.DS.'Database'.DS.'migrations';
$ns = '\\App\\Database\\migrations';
$clazz = "\\App\\Database\\migrations\\Migration000";
$this->removeClass($clazz);
@@ -63,7 +63,7 @@ public function test00() {
public function test01() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'database'.DS.'migrations';
+ $path = APP_PATH.DS.'Database'.DS.'migrations';
$ns = '\\App\\Database\\migrations';
$writter = new DatabaseMigrationWriter($runner);
$writter->setClassName('MyMigration');
@@ -89,7 +89,7 @@ public function test01() {
public function test02() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'database'.DS.'migrations';
+ $path = APP_PATH.DS.'Database'.DS.'migrations';
$ns = '\\App\\Database\\migrations';
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
@@ -131,7 +131,7 @@ public function test02() {
public function test03() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'database'.DS.'migrations';
+ $path = APP_PATH.DS.'Database'.DS.'migrations';
$ns = '\\App\\Database\\migrations';
$allClasses = [];
for ($x = 0 ; $x < 110 ; $x++) {
diff --git a/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php b/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
index 5d695bb68..596c220a6 100644
--- a/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/ThemeWritterTest.php
@@ -15,7 +15,7 @@ class ThemeWritterTest extends TestCase {
public function test00() {
$writter = new ThemeClassWriter();
$this->assertEquals('NewTheme', $writter->getName());
- $this->assertEquals('app\\themes\\new', $writter->getNamespace());
+ $this->assertEquals('App\\Themes\\new', $writter->getNamespace());
$this->assertEquals('Theme', $writter->getSuffix());
$this->assertEquals([
], $writter->getUseStatements());
@@ -29,9 +29,9 @@ public function test01() {
$writter->setClassName('SuperHotNew');
$writter->setThemeName('Cool Theme');
$this->assertEquals('SuperHotNewTheme', $writter->getName());
- $writter->setNamespace('app\\themes\\cool');
- $writter->setPath(ROOT_PATH.DS.APP_DIR.DS.'themes'.DS.'cool');
- $this->assertEquals('app\\themes\\cool', $writter->getNamespace());
+ $writter->setNamespace('App\\Themes\\cool');
+ $writter->setPath(ROOT_PATH.DS.APP_DIR.DS.'Themes'.DS.'cool');
+ $this->assertEquals('App\\Themes\\cool', $writter->getNamespace());
$this->assertEquals('Theme', $writter->getSuffix());
$this->assertEquals([
], $writter->getUseStatements());
diff --git a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
index 1666a0f88..30df30828 100644
--- a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
@@ -17,7 +17,7 @@ public function test00() {
$w = new APITestCaseWriter(new TasksServicesManager(), ForceTaskExecutionService::class);
$this->assertEquals('tests\\apis\\WebServiceTest', $w->getName(true));
$this->assertEquals(9, $w->getPhpUnitVersion());
- $this->assertEquals(ROOT_PATH.DS.'tests'.DS.'apis'.DS.'WebServiceTest.php', $w->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'Tests'.DS.'Apis'.DS.'WebServiceTest.php', $w->getAbsolutePath());
$w->writeClass();
$this->assertTrue(class_exists('\\'.$w->getName(true)));
unlink($w->getAbsolutePath());
@@ -29,10 +29,10 @@ public function test01() {
$w = new APITestCaseWriter(new TasksServicesManager(), new ForceTaskExecutionService());
$w->setClassName('Cool');
$w->setNamespace('\\tests\\cool');
- $w->setPath(ROOT_PATH.DS.'tests'.DS.'cool');
+ $w->setPath(ROOT_PATH.DS.'Tests'.DS.'cool');
$this->assertEquals('tests\\cool\\CoolTest', $w->getName(true));
$w->writeClass();
- $this->assertEquals(ROOT_PATH.DS.'tests'.DS.'cool'.DS.'CoolTest.php', $w->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'Tests'.DS.'cool'.DS.'CoolTest.php', $w->getAbsolutePath());
$this->assertTrue(file_exists($w->getAbsolutePath()));
require_once $w->getAbsolutePath();
$this->assertTrue(class_exists('\\'.$w->getName(true)));
From 43177486a78dc7686d5e42cba75bfd3520fd304d Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 14:28:09 +0300
Subject: [PATCH 16/45] Delete .gitkeep
---
Themes/fiori/.gitkeep | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 Themes/fiori/.gitkeep
diff --git a/Themes/fiori/.gitkeep b/Themes/fiori/.gitkeep
deleted file mode 100644
index 8b1378917..000000000
--- a/Themes/fiori/.gitkeep
+++ /dev/null
@@ -1 +0,0 @@
-
From 60179cd16890edadb5e08fc136f35a9896de4eda Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 14:29:00 +0300
Subject: [PATCH 17/45] Create .gitkeep
---
Themes/Fiori/.gitkeep | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 Themes/Fiori/.gitkeep
diff --git a/Themes/Fiori/.gitkeep b/Themes/Fiori/.gitkeep
new file mode 100644
index 000000000..e69de29bb
From 35d7b3848ac8481f67eafbfa7307d0dc8945b0b7 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 14:33:37 +0300
Subject: [PATCH 18/45] refactor: Namespaces Correction
---
WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php | 2 +-
WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php | 2 +-
WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php | 4 ++--
WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php | 6 +++---
WebFiori/Framework/Cli/Helpers/CreateMiddleware.php | 2 +-
WebFiori/Framework/Cli/Helpers/CreateMigration.php | 2 +-
WebFiori/Framework/Cli/Helpers/CreateTableObj.php | 2 +-
WebFiori/Framework/Cli/Helpers/CreateWebService.php | 2 +-
WebFiori/Framework/Writers/LangClassWriter.php | 2 +-
9 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php b/WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php
index 5eeda1add..26d6b1cc3 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php
@@ -38,7 +38,7 @@ public function __construct(CreateCommand $command) {
$this->taskWriter = $this->getWriter();
}
public function readClassInfo() {
- $this->setClassInfo(APP_DIR.'\\tasks', 'Task');
+ $this->setClassInfo(APP_DIR.'\\Tasks', 'Task');
$taskName = $this->getTaskName();
$taskDesc = $this->getTaskDesc();
diff --git a/WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php b/WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php
index 688803a01..7b05ff331 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php
@@ -35,7 +35,7 @@ public function __construct(CreateCommand $command) {
$this->cliWriter = $this->getWriter();
}
public function readClassInfo() {
- $this->setClassInfo(APP_DIR.'\\commands', 'Command');
+ $this->setClassInfo(APP_DIR.'\\Commands', 'Command');
$commandName = $this->getCommandName();
$commandDesc = $this->getInput('Give a short description of the command:');
diff --git a/WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php b/WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php
index 963805677..a7b592991 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php
@@ -51,7 +51,7 @@ public function getTable() : Table {
* the namespace at which the class will be added to.
*/
public function readDbClassInfo() {
- $info = $this->getClassInfo(APP_DIR.'\\database', 'DB');
+ $info = $this->getClassInfo(APP_DIR.'\\Database', 'DB');
$this->getWriter()->setNamespace($info['namespace']);
$this->getWriter()->setPath(ROOT_PATH.DS.$info['namespace']);
$this->getWriter()->setClassName($info['name']);
@@ -62,7 +62,7 @@ public function readEntityInfo() {
$t = $this->getTable();
$m = $t->getEntityMapper();
$m->setEntityName($this->getCommand()->readClassName('Entity class name:', null));
- $m->setNamespace($this->getCommand()->readNamespace('Entity namespace:', APP_DIR.'\\entity'));
+ $m->setNamespace($this->getCommand()->readNamespace('Entity namespace:', APP_DIR.'\\Entity'));
}
public function readTable() {
$tableClassNameValidity = false;
diff --git a/WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php b/WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php
index 7f67c056e..a15324ece 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php
@@ -207,11 +207,11 @@ private function IncludeAPISetProps(WebServiceWriter $w, $type) {
}
private function readAPIInfo() {
- $this->apisNs = CLIUtils::readNamespace($this->getCommand(), APP_DIR.'\\apis',"Last thing needed is to provide us with namespace for web services:");
+ $this->apisNs = CLIUtils::readNamespace($this->getCommand(), APP_DIR.'\\Apis',"Last thing needed is to provide us with namespace for web services:");
}
private function readEntityInfo() {
$this->println("First thing, we need entity class information.");
- $entityInfo = $this->getClassInfo(APP_DIR.'\\entity');
+ $entityInfo = $this->getClassInfo(APP_DIR.'\\Entity');
$entityInfo['implement-jsoni'] = $this->confirm('Would you like from your entity class to implement the interface JsonI?', true);
$this->tableObjWriter->setEntityInfo($entityInfo['name'], $entityInfo['namespace'], $entityInfo['path'], $entityInfo['implement-jsoni']);
@@ -230,7 +230,7 @@ private function readEntityInfo() {
}
private function readTableInfo() {
$this->println("Now, time to collect database table information.");
- $ns = CLIUtils::readNamespace($this->getCommand(), APP_DIR.'\\database', 'Provide us with a namespace for table class:');
+ $ns = CLIUtils::readNamespace($this->getCommand(), APP_DIR.'\\Database', 'Provide us with a namespace for table class:');
$this->tableObjWriter->setNamespace($ns);
$this->tableObjWriter->setPath(ROOT_PATH.DS.$ns);
diff --git a/WebFiori/Framework/Cli/Helpers/CreateMiddleware.php b/WebFiori/Framework/Cli/Helpers/CreateMiddleware.php
index 49db8bee4..32b7fbe35 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateMiddleware.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateMiddleware.php
@@ -35,7 +35,7 @@ public function __construct(CreateCommand $command) {
$this->mdWriter = $this->getWriter();
}
public function readClassInfo() {
- $this->setClassInfo(APP_DIR.'\\middleware', 'Middleware');
+ $this->setClassInfo(APP_DIR.'\\Middleware', 'Middleware');
$middlewareName = $this->getMiddlewareName();
$priority = $this->getCommand()->readInteger('Enter middleware priority:', 0);
diff --git a/WebFiori/Framework/Cli/Helpers/CreateMigration.php b/WebFiori/Framework/Cli/Helpers/CreateMigration.php
index f433de140..b208ce1e8 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateMigration.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateMigration.php
@@ -29,7 +29,7 @@ class CreateMigration extends CreateClassHelper {
* @param CreateCommand $command A command that is used to call the class.
*/
public function __construct(CreateCommand $command) {
- $ns = APP_DIR.'\\database\\migrations';
+ $ns = APP_DIR.'\\Database\\migrations';
if (!$command->isArgProvided('--defaults')) {
$ns = CLIUtils::readNamespace($command, $ns , 'Migration namespace:');
}
diff --git a/WebFiori/Framework/Cli/Helpers/CreateTableObj.php b/WebFiori/Framework/Cli/Helpers/CreateTableObj.php
index aa7a3960e..2d0111eee 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateTableObj.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateTableObj.php
@@ -43,7 +43,7 @@ public function readClassInfo() {
$tempTable = new MSSQLTable();
}
$this->getWriter()->setTable($tempTable);
- $this->setClassInfo(APP_DIR.'\\database', 'Table');
+ $this->setClassInfo(APP_DIR.'\\Database', 'Table');
$tableHelper = new TableObjHelper($this, $tempTable);
$tableHelper->setTableName(CaseConverter::toSnakeCase($this->getWriter()->getName()));
diff --git a/WebFiori/Framework/Cli/Helpers/CreateWebService.php b/WebFiori/Framework/Cli/Helpers/CreateWebService.php
index b49acf925..6792c0e72 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateWebService.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateWebService.php
@@ -49,7 +49,7 @@ public function addRequestMethods() {
}
}
public function readClassInfo() {
- $this->setClassInfo(APP_DIR.'\\apis', 'Service');
+ $this->setClassInfo(APP_DIR.'\\Apis', 'Service');
$this->setServiceName();
$this->serviceObj->setDescription($this->getInput('Description:'));
diff --git a/WebFiori/Framework/Writers/LangClassWriter.php b/WebFiori/Framework/Writers/LangClassWriter.php
index de71ccb67..9b9514ffa 100644
--- a/WebFiori/Framework/Writers/LangClassWriter.php
+++ b/WebFiori/Framework/Writers/LangClassWriter.php
@@ -34,7 +34,7 @@ class LangClassWriter extends ClassWriter {
* @since 1.0
*/
public function __construct($langCode, $writingDir) {
- parent::__construct('Lang'.$langCode, APP_PATH.'langs', APP_DIR."\\langs");
+ parent::__construct('Lang'.$langCode, APP_PATH.'Langs', APP_DIR."\\Langs");
$this->code = $langCode;
$this->dir = $writingDir;
$this->addUseStatement(Lang::class);
From 1d4d2529248fb79e6bf04ce57556c9aa324a4b9d Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 14:34:56 +0300
Subject: [PATCH 19/45] Update TableObjHelper.php
---
WebFiori/Framework/Cli/Helpers/TableObjHelper.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/WebFiori/Framework/Cli/Helpers/TableObjHelper.php b/WebFiori/Framework/Cli/Helpers/TableObjHelper.php
index 411dc0478..fbff68dc6 100644
--- a/WebFiori/Framework/Cli/Helpers/TableObjHelper.php
+++ b/WebFiori/Framework/Cli/Helpers/TableObjHelper.php
@@ -189,7 +189,7 @@ public function copyCheck() {
$helper = $this->getCreateHelper();
if ($helper->confirm('Would you like to update same class or create a copy with the update?', false)) {
- $info = $helper->getClassInfo(APP_DIR.'\\database', 'Table');
+ $info = $helper->getClassInfo(APP_DIR.'\\Database', 'Table');
$helper->setClassName($info['name']);
$helper->setNamespace($info['namespace']);
$helper->setPath($info['path']);
@@ -203,7 +203,7 @@ public function copyCheck() {
*/
public function createEntity() {
$helper = $this->getCreateHelper();
- $entityInfo = $helper->getClassInfo(APP_DIR.'\\entity');
+ $entityInfo = $helper->getClassInfo(APP_DIR.'\\Entity');
$entityInfo['implement-jsoni'] = $helper->confirm('Would you like from your entity class to implement the interface JsonI?', true);
$helper->getWriter()->setEntityInfo($entityInfo['name'], $entityInfo['namespace'], $entityInfo['path'], $entityInfo['implement-jsoni']);
From 18bdfb7640e5a7a3d12d264dc872252b327ab79e Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 14:48:12 +0300
Subject: [PATCH 20/45] refactor: Namespaces Correction
---
WebFiori/Framework/Cli/Commands/WHelpCommand.php | 2 +-
.../Framework/Tests/Cli/CreateAPITestCaseTest.php | 12 ++++++------
.../Framework/Tests/Cli/CreateCLICommandTest.php | 14 +++++++-------
.../Framework/Tests/Cli/CreateDBAccessTest.php | 10 +++++-----
.../Framework/Tests/Cli/CreateMigrationTest.php | 6 +++---
.../Framework/Tests/Cli/CreateTableTest.php | 6 +++---
.../Framework/Tests/Cli/CreateWebServiceTest.php | 6 +++---
.../Framework/Tests/Cli/UpdateTableCommandTest.php | 6 +++---
.../Tests/Writers/CLICommandClassWriterTest.php | 6 +++---
.../Tests/Writers/WebServiceTestCaseWriterTest.php | 2 +-
10 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/WebFiori/Framework/Cli/Commands/WHelpCommand.php b/WebFiori/Framework/Cli/Commands/WHelpCommand.php
index b743fed15..f0ddf589f 100644
--- a/WebFiori/Framework/Cli/Commands/WHelpCommand.php
+++ b/WebFiori/Framework/Cli/Commands/WHelpCommand.php
@@ -10,7 +10,7 @@
*/
namespace WebFiori\Framework\Cli\Commands;
-use WebFiori\Cli\commands\HelpCommand;
+use WebFiori\Cli\Commands\HelpCommand;
/**
* Description of WHelpCommand
*
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index b6c9b0992..c0f7797a0 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -119,17 +119,17 @@ public function testCreateAPITestCase03() {
* @test
*/
public function testCreateAPITestCase04() {
- $path = ROOT_PATH.DS."tests".DS."tests".DS."apis".DS."multiple";
+ $path = ROOT_PATH.DS."tests".DS."tests".DS."Apis".DS."Multiple";
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\tests\apis\multiple\WebService00Test'."\n",
+ 'Name: tests\tests\Apis\Multiple\WebService00Test'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\\tests\apis\multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\\tests\Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -175,12 +175,12 @@ public function testCreateAPITestCase06() {
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\tests\apis\multiple\WebService00Test'."\n",
+ 'Name: tests\tests\Apis\Multiple\WebService00Test'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\\tests\apis\multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\\tests\Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -218,7 +218,7 @@ public function testCreateAPITestCase07() {
* @test
*/
public function testCreateAPITestCase08() {
- $path = ROOT_PATH.DS."tests".DS."tests".DS."apis".DS."multiple";
+ $path = ROOT_PATH.DS."tests".DS."tests".DS."Apis".DS."Multiple";
$this->assertEquals([
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
index 142266a87..14180d78f 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
@@ -19,7 +19,7 @@ public function testCreateCommand00() {
], [
'5',
'NewCLI',
- 'app\commands',
+ 'App\Commands',
'print-hello',
'Prints \'Hello World\' in the console.',
'N',
@@ -42,21 +42,21 @@ public function testCreateCommand00() {
"10: Database migration.\n",
"11: Quit. <--\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\commands'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Commands'\n",
"Enter a name for the command:\n",
"Give a short description of the command:\n",
"Would you like to add arguments to the command?(y/N)\n",
'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."commands\".\n",
], $output);
- $this->assertTrue(class_exists('\\app\\commands\\NewCLICommand'));
- $this->removeClass('\\app\\commands\\NewCLICommand');
+ $this->assertTrue(class_exists('\\App\\Commands\\NewCLICommand'));
+ $this->removeClass('\\App\\Commands\\NewCLICommand');
}
/**
* @test
*/
public function testCreateCommand01() {
- $clazz = '\\app\\commands\\DoItCommand';
+ $clazz = '\\App\\Commands\\DoItCommand';
if (class_exists($clazz)) {
$this->removeClass($clazz);
}
@@ -67,7 +67,7 @@ public function testCreateCommand01() {
'--c' => 'command'
], [
'DoIt',
- 'app\commands',
+ 'App\Commands',
'do-it',
'Do something amazing.',
'y',
@@ -88,7 +88,7 @@ public function testCreateCommand01() {
$this->assertEquals(0, $this->getExitCode());
$this->assertEquals([
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'app\commands'\n",
+ "Enter an optional namespace for the class: Enter = 'App\Commands'\n",
"Enter a name for the command:\n",
"Give a short description of the command:\n",
"Would you like to add arguments to the command?(y/N)\n",
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
index 241d59b0b..b0421c70f 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
@@ -25,9 +25,9 @@ public function test00() {
], [
'Tables\\EmployeeInfoTable',
'EmployeeOperations',
- "\n", // Hit Enter to pick default value (app\database)
+ "\n", // Hit Enter to pick default value (App\database)
'SuperUser',
- "\n", // Hit Enter to pick default value (app\entity)
+ "\n", // Hit Enter to pick default value (App\entity)
'n'
]);
@@ -60,9 +60,9 @@ public function test01() {
], [
'Tables\\EmployeeInfoTable',
'EmployeeS',
- 'App\\Database\\empl',
+ 'App\\Database\\Empl',
'SuperHero',
- 'App\\Entity\\subs',
+ 'App\\Entity\\Subs',
'y'
]);
@@ -79,7 +79,7 @@ public function test01() {
"Would you like to have update methods for every single column?(y/N)\n",
"Info: New class was created at \"". ROOT_PATH.DS."app".DS."database".DS."empl\".\n"
], $output);
- $clazz = '\\App\\Database\\empl\\EmployeeSDB';
+ $clazz = '\\App\\Database\\Empl\\EmployeeSDB';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index 55c08f262..6546590e5 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -11,7 +11,7 @@ class CreateMigrationTest extends CLITestCase {
protected function tearDown(): void {
// Clean up only specific migration files created by this test
- $migrationsDir = APP_PATH . DS . 'Database' . DS . 'migrations';
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
if (is_dir($migrationsDir)) {
// Only remove Migration files directly in the migrations directory
$files = glob($migrationsDir . DS . 'Migration[0-9][0-9][0-9].php');
@@ -36,10 +36,10 @@ protected function tearDown(): void {
public function testCreateMigration01() {
$name = 'CoolMigration';
- $clazz = '\\App\\Database\\migrations\\'.$name;
+ $clazz = '\\App\\Database\\Migrations\\'.$name;
$this->assertEquals([
- "Migration namespace: Enter = 'app\database\migrations'\n",
+ "Migration namespace: Enter = 'App\Database\Migrations'\n",
"Provide a name for the class that will have migration logic:\n",
'Info: New class was created at "'. APP_PATH .'Database'.DS.'migrations".'."\n",
], $this->executeMultiCommand([
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
index 45084a699..ad8447b23 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
@@ -72,7 +72,7 @@ public function testCreateTable00() {
], [
'mysql',
'Cool00Table',
- "\n", // Hit Enter to pick default value (app\database)
+ "\n", // Hit Enter to pick default value (App\database)
'cool_table_00',
'This is the first cool table that was created using CLI.',
'id',
@@ -135,7 +135,7 @@ public function testCreateTable01() {
], [
'mssql',
'Cool01Table',
- "\n", // Hit Enter to pick default value (app\database)
+ "\n", // Hit Enter to pick default value (App\database)
'cool_table_01',
'This is the first cool table that was created using CLI.',
'id',
@@ -199,7 +199,7 @@ public function testCreateTable02() {
], [
'mysql',
'Cool02Table',
- "\n", // Hit Enter to pick default value (app\database)
+ "\n", // Hit Enter to pick default value (App\database)
'cool_table_02',
"\n", // Hit Enter to pick default value (empty comment)
'id',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
index 7ef11a668..42ed696ea 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
@@ -24,7 +24,7 @@ public function test00() {
], [
'2',
'NewWeb',
- "\n", // Hit Enter to pick default value (app\apis)
+ "\n", // Hit Enter to pick default value (App\Apis)
'get-hello',
'Service Desc',
"\n", // Hit Enter to pick default value (GET method)
@@ -125,7 +125,7 @@ public function test01() {
'--c' => 'web-service'
], [
'NewWeb2',
- "\n", // Hit Enter to pick default value (app\apis)
+ "\n", // Hit Enter to pick default value (App\Apis)
'get-hello-2',
'Service\'s Desc',
"\n", // Hit Enter to pick default value (GET method)
@@ -224,7 +224,7 @@ public function test02() {
'--c' => 'web-service'
], [
'NewWeb3',
- "\n", // Hit Enter to pick default value (app\apis)
+ "\n", // Hit Enter to pick default value (App\Apis)
'get-hello-3',
'Service\'s Desc',
"\n", // Hit Enter to pick default value (GET method)
diff --git a/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
index 8171040fd..cfa412ef4 100644
--- a/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/UpdateTableCommandTest.php
@@ -26,7 +26,7 @@ public function test00() {
'Cool new column.',
'y',
'ModifiedO',
- "\n" // Hit Enter to pick default value (app\database)
+ "\n" // Hit Enter to pick default value (App\database)
]);
$this->assertEquals(0, $this->getExitCode());
@@ -107,7 +107,7 @@ public function test01() {
'Cool modifiyed column.',
'y',
'Modified',
- "\n" // Hit Enter to pick default value (app\database)
+ "\n" // Hit Enter to pick default value (App\database)
]);
$this->assertEquals(0, $this->getExitCode());
@@ -175,7 +175,7 @@ public function test02() {
'0',
'y',
'Modified2',
- "\n" // Hit Enter to pick default value (app\database)
+ "\n" // Hit Enter to pick default value (App\database)
]);
$this->assertEquals(0, $this->getExitCode());
diff --git a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
index 165df1b7d..9c02dc46a 100644
--- a/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/CLICommandClassWriterTest.php
@@ -13,7 +13,7 @@ public function test00() {
$writer = new CommandClassWriter();
$this->assertEquals('NewCommand', $writer->getName());
$this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'NewCommand.php', $writer->getAbsolutePath());
- $this->assertEquals('app\\commands', $writer->getNamespace());
+ $this->assertEquals('App\\Commands', $writer->getNamespace());
$this->assertEquals('new-command', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
$this->assertEquals([], $writer->getArgs());
@@ -38,7 +38,7 @@ public function test01() {
$this->assertTrue($writer->setClassName('DoItXCommand'));
$this->assertEquals('DoItXCommand', $writer->getName());
$this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'DoItXCommand.php', $writer->getAbsolutePath());
- $this->assertEquals('app\\commands', $writer->getNamespace());
+ $this->assertEquals('App\\Commands', $writer->getNamespace());
$this->assertEquals('Lets-Do-It', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
$this->assertEquals([], $writer->getArgs());
@@ -81,7 +81,7 @@ public function test02() {
$this->assertTrue($writer->setClassName('DoItX2Command'));
$this->assertEquals('DoItX2Command', $writer->getName());
$this->assertEquals(ROOT_PATH.DS.APP_DIR.DS.'Commands'.DS.'DoItX2Command.php', $writer->getAbsolutePath());
- $this->assertEquals('app\\commands', $writer->getNamespace());
+ $this->assertEquals('App\\Commands', $writer->getNamespace());
$this->assertEquals('Lets-Do-It', $writer->getCommandName());
$this->assertEquals('', $writer->getDescription());
$this->assertEquals([], $writer->getArgs());
diff --git a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
index 30df30828..6e409bf07 100644
--- a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
@@ -15,7 +15,7 @@ class WebServiceTestCaseWriterTest extends CLITestCase {
*/
public function test00() {
$w = new APITestCaseWriter(new TasksServicesManager(), ForceTaskExecutionService::class);
- $this->assertEquals('tests\\apis\\WebServiceTest', $w->getName(true));
+ $this->assertEquals('tests\\Apis\\WebServiceTest', $w->getName(true));
$this->assertEquals(9, $w->getPhpUnitVersion());
$this->assertEquals(ROOT_PATH.DS.'Tests'.DS.'Apis'.DS.'WebServiceTest.php', $w->getAbsolutePath());
$w->writeClass();
From b3f602ec0d42e233cfaa363bef6e8b32c0e57279 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 15:07:01 +0300
Subject: [PATCH 21/45] refactor: Correction of Namespaces
---
WebFiori/Framework/Cli/Commands/AddCommand.php | 2 +-
WebFiori/Framework/Config/ClassDriver.php | 2 +-
WebFiori/Framework/Lang.php | 2 +-
.../Framework/Tests/Cli/AddCommandTest.php | 2 +-
.../Framework/Tests/Cli/CreateAPITestCaseTest.php | 14 +++++++-------
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/WebFiori/Framework/Cli/Commands/AddCommand.php b/WebFiori/Framework/Cli/Commands/AddCommand.php
index 6727899f8..60c08c4b6 100644
--- a/WebFiori/Framework/Cli/Commands/AddCommand.php
+++ b/WebFiori/Framework/Cli/Commands/AddCommand.php
@@ -128,7 +128,7 @@ private function addLang(): int {
$writer = new LangClassWriter($langCode, $writingDir);
$writer->writeClass();
$this->success('Language added. Also, a class for the language '
- .'is created at "'.APP_DIR.'\langs" for that language.');
+ .'is created at "'.APP_DIR.'\Langs" for that language.');
return 0;
}
diff --git a/WebFiori/Framework/Config/ClassDriver.php b/WebFiori/Framework/Config/ClassDriver.php
index 0757cd1a5..bc3880708 100644
--- a/WebFiori/Framework/Config/ClassDriver.php
+++ b/WebFiori/Framework/Config/ClassDriver.php
@@ -1302,7 +1302,7 @@ private function writeSiteTitles($cFile) {
$title = str_replace("'", "\'", $title);
self::a($cFile, " '$langCode' => '$title',");
- if (!class_exists(APP_DIR.'\\langs\\Lang'.$langCode)) {
+ if (!class_exists(APP_DIR.'\\Langs\\Lang'.$langCode)) {
//This requires a fix in the future
$dir = $langCode == 'AR' ? 'rtl' : 'ltr';
diff --git a/WebFiori/Framework/Lang.php b/WebFiori/Framework/Lang.php
index af83c2493..54113e361 100644
--- a/WebFiori/Framework/Lang.php
+++ b/WebFiori/Framework/Lang.php
@@ -310,7 +310,7 @@ public static function loadTranslation(string $langCode) {
return self::getActive();
}
- $langClassName = APP_DIR.'\\langs\\Lang'.$uLangCode;
+ $langClassName = APP_DIR.'\\Langs\\Lang'.$uLangCode;
if (!class_exists($langClassName)) {
throw new MissingLangException('No language class was found for the language \''.$uLangCode.'\'.');
diff --git a/tests/WebFiori/Framework/Tests/Cli/AddCommandTest.php b/tests/WebFiori/Framework/Tests/Cli/AddCommandTest.php
index 26a77267d..35559ab3d 100644
--- a/tests/WebFiori/Framework/Tests/Cli/AddCommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/AddCommandTest.php
@@ -196,7 +196,7 @@ public function testAddLang00() {
"Select writing direction:\n",
"0: ltr\n",
"1: rtl\n",
- "Success: Language added. Also, a class for the language is created at \"".APP_DIR."\langs\" for that language.\n"
+ "Success: Language added. Also, a class for the language is created at \"".APP_DIR."\Langs\" for that language.\n"
], $output);
$this->assertTrue(class_exists('\\App\\Langs\\Lang' . $langCode));
$this->removeClass('\\App\\Langs\\Lang' . $langCode);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index c0f7797a0..b77370ecb 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -38,7 +38,7 @@ public function testCreateAPITestCase01() {
"4: set-password\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\WebFiori\\Framework\scheduler\webServices\\TasksLoginServiceTest'."\n",
+ 'Name: tests\WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"Info: New class was created at \"".$path."\".\n"
@@ -53,7 +53,7 @@ public function testCreateAPITestCase01() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\TasksLoginServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest';
$this->assertTrue(file_exists($path.DS.'TasksLoginServiceTest.php'));
require_once $path.DS.'TasksLoginServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -74,7 +74,7 @@ public function testCreateAPITestCase02() {
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -89,19 +89,19 @@ public function testCreateAPITestCase03() {
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest'."\n",
+ 'Name: tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\WebFiori\\Framework\scheduler\webServices'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\WebFiori\\Framework\Scheduler\WebServices'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
'--service' => 'get-tasks',
], [
- '\WebFiori\\Framework\scheduler\webServices\\TasksServicesManager',
+ '\WebFiori\\Framework\Scheduler\WebServices\\TasksServicesManager',
'n',
'10',
'',
@@ -109,7 +109,7 @@ public function testCreateAPITestCase03() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\scheduler\webServices\\GetTasksServiceTest';
+ $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
From b28b10be4ae1af5c68ed1dd236fc8f0befbacea9 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 15:11:23 +0300
Subject: [PATCH 22/45] Update App.php
---
WebFiori/Framework/App.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index ace32b652..ae888933d 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -168,8 +168,7 @@ private function __construct() {
* Register CLI commands or background tasks.
*
* @param string $folder The name of the folder that contains the jobs or
- * commands. It must be a folder inside 'app' folder or the folder which is defined
- * by the constant 'APP_DIR'.
+ * commands. It must be a folder inside [APP_DIR].
*
* @param callable $regCallback A callback which is used to register the
* classes of the folder.
From 94e16a72ff37f9bce736facfa145cb6c2ced264f Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 15:29:00 +0300
Subject: [PATCH 23/45] refactor: Path and Namespace Correction
---
WebFiori/Framework/App.php | 10 +++++-----
.../Cli/Helpers/CreateThemeHelper.php | 2 +-
.../Framework/Session/SessionsManager.php | 4 ++--
tests/WebFiori/Framework/Tests/AccessTest.php | 2 +-
.../Tests/Cli/CreateAPITestCaseTest.php | 20 +++++++++----------
.../Framework/Tests/Cli/CreateThemeTest.php | 16 +++++++--------
.../Framework/Tests/Langs/LanguageTest.php | 4 ++--
.../Framework/Tests/Mail/EmailMessageTest.php | 2 +-
tests/WebFiori/Framework/Tests/PageTest.php | 2 +-
.../Framework/Tests/PrivilegeTest.php | 2 +-
tests/WebFiori/Framework/Tests/UserTest.php | 2 +-
tests/WebFiori/Framework/Tests/UtilTest.php | 2 +-
.../Writers/WebServiceTestCaseWriterTest.php | 6 +++---
13 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index ae888933d..350bdc84d 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -273,10 +273,10 @@ public static function getConfigDriver() : string {
}
private static function getRoot() {
//Following lines of code assumes that the class exist on the folder:
- //\vendor\WebFiori\framework\WebFiori\framework
+ //\vendor\WebFiori\framework\WebFiori\Framework
//Its used to construct the folder at which index file will exist at
$DS = DIRECTORY_SEPARATOR;
- $vendorPath = $DS.'vendor'.$DS.'WebFiori'.$DS.'framework'.$DS.'WebFiori'.$DS.'framework';
+ $vendorPath = $DS.'vendor'.$DS.'webFiori'.$DS.'framework'.$DS.'WebFiori'.$DS.'Framework';
$rootPath = substr(__DIR__, 0, strlen(__DIR__) - strlen($vendorPath));
return $rootPath;
}
@@ -614,8 +614,8 @@ private static function initAutoLoader() {
/**
* Initialize autoloader.
*/
- if (!class_exists('WebFiori\framework\autoload\ClassLoader',false)) {
- $autoloader = WF_CORE_PATH.DIRECTORY_SEPARATOR.'autoload'.DIRECTORY_SEPARATOR.'ClassLoader.php';
+ if (!class_exists('WebFiori\Framework\Autoload\ClassLoader',false)) {
+ $autoloader = WF_CORE_PATH.DIRECTORY_SEPARATOR.'Autoload'.DIRECTORY_SEPARATOR.'ClassLoader.php';
require_once $autoloader;
}
self::$AU = ClassLoader::get();
@@ -721,7 +721,7 @@ private function initScheduler() {
}
private function initThemesPath() {
if (!defined('THEMES_PATH')) {
- $themesDirName = 'themes';
+ $themesDirName = 'Themes';
$themesPath = ROOT_PATH.DS.$themesDirName;
/**
* This constant represents the directory at which themes exist.
diff --git a/WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php b/WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php
index 9c2248a13..5a487d7cf 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php
@@ -27,7 +27,7 @@ public function __construct(CreateCommand $command) {
parent::__construct($command, new ThemeClassWriter('New Theme'));
}
public function readClassInfo() {
- $this->setClassInfo('themes', 'Theme');
+ $this->setClassInfo('Themes', 'Theme');
$this->println('Creating theme at "'.$this->getWriter()->getPath().'"...');
$this->writeClass();
diff --git a/WebFiori/Framework/Session/SessionsManager.php b/WebFiori/Framework/Session/SessionsManager.php
index b67cd53e3..6d9905559 100644
--- a/WebFiori/Framework/Session/SessionsManager.php
+++ b/WebFiori/Framework/Session/SessionsManager.php
@@ -65,10 +65,10 @@ private function __construct() {
$constructor = WF_SESSION_STORAGE.'';
$classObj = new $constructor();
- if (is_subclass_of($classObj, '\WebFiori\framework\session\SessionStorage')) {
+ if (is_subclass_of($classObj, '\WebFiori\Framework\Session\SessionStorage')) {
$this->sessionStorage = $classObj;
} else {
- throw new SessionException('The class "'.WF_SESSION_STORAGE.'" does not implement "\WebFiori\framework\session\SessionStorage".');
+ throw new SessionException('The class "'.WF_SESSION_STORAGE.'" does not implement "\WebFiori\Framework\Session\SessionStorage".');
}
}
diff --git a/tests/WebFiori/Framework/Tests/AccessTest.php b/tests/WebFiori/Framework/Tests/AccessTest.php
index b205ea2f3..1cd487788 100644
--- a/tests/WebFiori/Framework/Tests/AccessTest.php
+++ b/tests/WebFiori/Framework/Tests/AccessTest.php
@@ -5,7 +5,7 @@
use WebFiori\Framework\Access;
use WebFiori\Framework\User;
/**
- * A test class for testing the class 'WebFiori\framework\Access'.
+ * A test class for testing the class 'WebFiori\Framework\Access'.
*
* @author Ibrahim
*/
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index b77370ecb..816a5c935 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -136,7 +136,7 @@ public function testCreateAPITestCase04() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\Tests\\Apis\\Multiple\\ServicesManager00',
+ '\\tests\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
@@ -144,7 +144,7 @@ public function testCreateAPITestCase04() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -160,7 +160,7 @@ public function testCreateAPITestCase05() {
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\Tests\\Apis\\EmptyService\\EmptyServicesManager',
+ '--manager' => '\\tests\\Apis\\EmptyService\\EmptyServicesManager',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -187,15 +187,15 @@ public function testCreateAPITestCase06() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\Tests\\Apis\\Multiple\\WebService00',
- '\\Tests\\Apis\\Multiple\\ServicesManager00',
+ '\\tests\\Apis\\Multiple\\WebService00',
+ '\\tests\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
'',
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -206,11 +206,11 @@ public function testCreateAPITestCase06() {
*/
public function testCreateAPITestCase07() {
$this->assertEquals([
- "Error: The argument --manager has invalid value: Not a class: \\Tests\\Apis\\EmptyService\\Xyz\n",
+ "Error: The argument --manager has invalid value: Not a class: \\tests\\Apis\\EmptyService\\Xyz\n",
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\Tests\\Apis\\EmptyService\\Xyz',
+ '--manager' => '\\tests\\Apis\\EmptyService\\Xyz',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -225,11 +225,11 @@ public function testCreateAPITestCase08() {
CreateCommand::class,
'--c' => 'api-test',
'--service' => 'say-hi-service-2',
- '--manager' => '\\Tests\\Apis\\Multiple\\ServicesManager00',
+ '--manager' => '\\tests\\Apis\\Multiple\\ServicesManager00',
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Tests\\Apis\\Multiple\\WebService01Test';
+ $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService01Test';
$this->assertTrue(file_exists($path.DS.'WebService01Test.php'));
require_once $path.DS.'WebService01Test.php';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
index 27f24f21a..d8325b7be 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
@@ -22,7 +22,7 @@ public function testCreateTheme00() {
], [
'6',
'NewTest',
- 'themes\\fiori',
+ 'Themes\\Fiori',
"\n", // Hit Enter to pick default value
]);
$this->assertEquals(0, $this->getExitCode());
@@ -46,13 +46,13 @@ public function testCreateTheme00() {
'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."fiori\".\n",
], $output);
- $this->assertTrue(class_exists('\\themes\\fiori\\NewTestTheme'));
+ $this->assertTrue(class_exists('\\Themes\\Fiori\\NewTestTheme'));
- $this->removeClass('\\themes\\fiori\\NewTestTheme');
- $this->removeClass('\\themes\\fiori\\AsideSection');
- $this->removeClass('\\themes\\fiori\\FooterSection');
- $this->removeClass('\\themes\\fiori\\HeadSection');
- $this->removeClass('\\themes\\fiori\\HeaderSection');
+ $this->removeClass('\\Themes\\Fiori\\NewTestTheme');
+ $this->removeClass('\\Themes\\Fiori\\AsideSection');
+ $this->removeClass('\\Themes\\Fiori\\FooterSection');
+ $this->removeClass('\\Themes\\Fiori\\HeadSection');
+ $this->removeClass('\\Themes\\Fiori\\HeaderSection');
}
/**
@@ -63,7 +63,7 @@ public function testCreateThemeWithExistingName() {
$ns = '\\Themes\\FioriTheme';
$name = 'NewFTestTheme';
- $ns2 = '\\themes\\cool';
+ $ns2 = '\\Themes\\Cool';
$name2 = 'NewFTestTheme';
$output = $this->executeSingleCommand(new CreateCommand(), [
diff --git a/tests/WebFiori/Framework/Tests/Langs/LanguageTest.php b/tests/WebFiori/Framework/Tests/Langs/LanguageTest.php
index 6ea4d38f1..c51562374 100644
--- a/tests/WebFiori/Framework/Tests/Langs/LanguageTest.php
+++ b/tests/WebFiori/Framework/Tests/Langs/LanguageTest.php
@@ -210,7 +210,7 @@ public function testLoadTranslation01() {
*/
public function testLoadTranslation02() {
$this->expectException(Exception::class);
- $this->expectExceptionMessage('A language class for the language \'FR\' was found. But it is not a sub class of \'WebFiori\framework\Lang\'.');
+ $this->expectExceptionMessage('A language class for the language \'FR\' was found. But it is not a sub class of \'WebFiori\Framework\Lang\'.');
Lang::loadTranslation('fr');
}
/**
@@ -221,7 +221,7 @@ public function testLoadTranslation02() {
*/
public function testLoadTranslation03() {
$this->expectException(Exception::class);
- $this->expectExceptionMessage('The translation file was found. But no object of type \'WebFiori\framework\Lang\' is stored. Make sure that the parameter '
+ $this->expectExceptionMessage('The translation file was found. But no object of type \'WebFiori\Framework\Lang\' is stored. Make sure that the parameter '
.'$addtoLoadedAfterCreate is set to true when creating the language object.');
Lang::loadTranslation('Jp');
}
diff --git a/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php b/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
index 03cedf51e..4049abfc0 100644
--- a/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
+++ b/tests/WebFiori/Framework/Tests/Mail/EmailMessageTest.php
@@ -8,7 +8,7 @@
use WebFiori\Framework\EmailMessage;
use WebFiori\Framework\Exceptions\MissingLangException;
/**
- * A test class for testing the class 'WebFiori\framework\mail\EmailMessage'.
+ * A test class for testing the class 'WebFiori\Framework\Mail\EmailMessage'.
*
* @author Ibrahim
*/
diff --git a/tests/WebFiori/Framework/Tests/PageTest.php b/tests/WebFiori/Framework/Tests/PageTest.php
index 493767024..98490a19d 100644
--- a/tests/WebFiori/Framework/Tests/PageTest.php
+++ b/tests/WebFiori/Framework/Tests/PageTest.php
@@ -764,7 +764,7 @@ public function testTheme02() {
$page->setTheme(' New Super Theme ');
$theme3 = $page->getTheme();
- $this->assertTrue($theme3 instanceof \WebFiori\framework\Theme);
+ $this->assertTrue($theme3 instanceof \WebFiori\Framework\Theme);
}
/**
* @test
diff --git a/tests/WebFiori/Framework/Tests/PrivilegeTest.php b/tests/WebFiori/Framework/Tests/PrivilegeTest.php
index dfb71ba8c..b60755797 100644
--- a/tests/WebFiori/Framework/Tests/PrivilegeTest.php
+++ b/tests/WebFiori/Framework/Tests/PrivilegeTest.php
@@ -4,7 +4,7 @@
use PHPUnit\Framework\TestCase;
use WebFiori\Framework\Privilege;
/**
- * A test class for testing the class 'WebFiori\framework\Privilege'.
+ * A test class for testing the class 'WebFiori\Framework\Privilege'.
*
* @author Ibrahim
*/
diff --git a/tests/WebFiori/Framework/Tests/UserTest.php b/tests/WebFiori/Framework/Tests/UserTest.php
index 57cded44c..4577872b2 100644
--- a/tests/WebFiori/Framework/Tests/UserTest.php
+++ b/tests/WebFiori/Framework/Tests/UserTest.php
@@ -5,7 +5,7 @@
use WebFiori\Framework\Access;
use WebFiori\Framework\User;
/**
- * A test class for testing the class 'WebFiori\framework\User'.
+ * A test class for testing the class 'WebFiori\Framework\User'.
*
* @author Ibrahim
*/
diff --git a/tests/WebFiori/Framework/Tests/UtilTest.php b/tests/WebFiori/Framework/Tests/UtilTest.php
index 33189db33..673da9222 100644
--- a/tests/WebFiori/Framework/Tests/UtilTest.php
+++ b/tests/WebFiori/Framework/Tests/UtilTest.php
@@ -4,7 +4,7 @@
use PHPUnit\Framework\TestCase;
use WebFiori\Framework\Util;
/**
- * A test class for testing the class 'WebFiori\framework\Util'.
+ * A test class for testing the class 'WebFiori\Framework\Util'.
*
* @author Ibrahim
*/
diff --git a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
index 6e409bf07..c7c75435a 100644
--- a/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/WebServiceTestCaseWriterTest.php
@@ -17,7 +17,7 @@ public function test00() {
$w = new APITestCaseWriter(new TasksServicesManager(), ForceTaskExecutionService::class);
$this->assertEquals('tests\\Apis\\WebServiceTest', $w->getName(true));
$this->assertEquals(9, $w->getPhpUnitVersion());
- $this->assertEquals(ROOT_PATH.DS.'Tests'.DS.'Apis'.DS.'WebServiceTest.php', $w->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'tests'.DS.'Apis'.DS.'WebServiceTest.php', $w->getAbsolutePath());
$w->writeClass();
$this->assertTrue(class_exists('\\'.$w->getName(true)));
unlink($w->getAbsolutePath());
@@ -29,10 +29,10 @@ public function test01() {
$w = new APITestCaseWriter(new TasksServicesManager(), new ForceTaskExecutionService());
$w->setClassName('Cool');
$w->setNamespace('\\tests\\cool');
- $w->setPath(ROOT_PATH.DS.'Tests'.DS.'cool');
+ $w->setPath(ROOT_PATH.DS.'tests'.DS.'cool');
$this->assertEquals('tests\\cool\\CoolTest', $w->getName(true));
$w->writeClass();
- $this->assertEquals(ROOT_PATH.DS.'Tests'.DS.'cool'.DS.'CoolTest.php', $w->getAbsolutePath());
+ $this->assertEquals(ROOT_PATH.DS.'tests'.DS.'cool'.DS.'CoolTest.php', $w->getAbsolutePath());
$this->assertTrue(file_exists($w->getAbsolutePath()));
require_once $w->getAbsolutePath();
$this->assertTrue(class_exists('\\'.$w->getName(true)));
From 0d7d9ae60883e4d75540de5745e34a33d38d041b Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 17:15:34 +0300
Subject: [PATCH 24/45] refactor: Namespaces Correction
---
.gitignore | 8 +-
App/Init/InitMiddleware.php | 2 +-
WebFiori/Framework/App.php | 6 +-
WebFiori/Framework/Config/ClassDriver.php | 6 +-
WebFiori/Framework/Config/JsonDriver.php | 6 +-
.../Middleware/AbstractMiddleware.php | 2 +-
.../Tests/Cli/CreateAPITestCaseTest.php | 26 ++--
tests/phpunit.xml | 108 ++++++++---------
tests/phpunit10.xml | 112 +++++++++---------
9 files changed, 137 insertions(+), 139 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4d3b6a20e..713406857 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,14 +7,12 @@ composer.lock
*.cache
cs-fixer.phar
*.log
-src/app/storage
-app/storage
/release/
php-cs-fixer-v2.phar
-app/sto
-app/config/*
+App/sto
+App/Config/*
.idea/*
-!/app/config/config-with-err-00.json
+!/App/Config/config-with-err-00.json
*.Identifier
tests/clover.xml
/.vscode
diff --git a/App/Init/InitMiddleware.php b/App/Init/InitMiddleware.php
index 7844ceb64..3f5ed59f4 100644
--- a/App/Init/InitMiddleware.php
+++ b/App/Init/InitMiddleware.php
@@ -4,7 +4,7 @@
class InitMiddleware {
/**
- * Register middleware which are created outside the folder '[APP_DIR]/middleware'.
+ * Register middleware which are created outside the folder '[APP_DIR]/Middleware'.
*
**/
public static function init() {
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index 350bdc84d..2ae349276 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -671,7 +671,7 @@ private function initMiddleware() {
});
if (!class_exists(APP_DIR.'\Init\InitMiddleware')) {
- Ini::get()->createIniClass('InitMiddleware', 'Register middleware which are created outside the folder \'[APP_DIR]/middleware\'.');
+ Ini::get()->createIniClass('InitMiddleware', 'Register middleware which are created outside the folder \'[APP_DIR]/Middleware\'.');
}
MiddlewareManager::register(new StartSessionMiddleware());
self::call(APP_DIR.'\Init\InitMiddleware::init');
@@ -683,10 +683,10 @@ private function initRoutes() {
$routesClasses = ['APIsRoutes', 'PagesRoutes', 'ClosureRoutes', 'OtherRoutes'];
foreach ($routesClasses as $className) {
- if (!class_exists(APP_DIR.'\\Init\\routes\\'.$className)) {
+ if (!class_exists(APP_DIR.'\\Init\\Routes\\'.$className)) {
Ini::get()->createRoutesClass($className);
}
- self::call(APP_DIR.'\Init\routes\\'.$className.'::create');
+ self::call(APP_DIR.'\Init\Routes\\'.$className.'::create');
}
if (Router::routesCount() != 0) {
diff --git a/WebFiori/Framework/Config/ClassDriver.php b/WebFiori/Framework/Config/ClassDriver.php
index bc3880708..3c4647836 100644
--- a/WebFiori/Framework/Config/ClassDriver.php
+++ b/WebFiori/Framework/Config/ClassDriver.php
@@ -12,14 +12,14 @@
* A configuration driver which is used to store configuration on PHP class.
*
* This driver will
- * create a class called 'AppConfig' on the directory APP_DIR/config and
+ * create a class called 'AppConfig' on the directory APP_DIR/Config and
* use it to read and write configurations.
*
* @author Ibrahim
*/
class ClassDriver implements ConfigurationDriver {
- const CONFIG_FILE_PATH = APP_PATH.'config'.DIRECTORY_SEPARATOR.'AppConfig.php';
- const CONFIG_NS = APP_DIR.'\\config\\AppConfig';
+ const CONFIG_FILE_PATH = APP_PATH.'Config'.DIRECTORY_SEPARATOR.'AppConfig.php';
+ const CONFIG_NS = APP_DIR.'\\Config\\AppConfig';
const NL = "\n";
private $blockEnd;
private $configVars;
diff --git a/WebFiori/Framework/Config/JsonDriver.php b/WebFiori/Framework/Config/JsonDriver.php
index 9d6701137..831a0594d 100644
--- a/WebFiori/Framework/Config/JsonDriver.php
+++ b/WebFiori/Framework/Config/JsonDriver.php
@@ -12,7 +12,7 @@
* Application configuration driver which is used to read and write application
* configuration from JSON file.
*
- * The driver will create a JSON file in the path 'APP_PATH/config' with
+ * The driver will create a JSON file in the path 'APP_PATH/Config' with
* the name 'app-config.json'. The developer can use the file to
* modify application configuration. The name of the file can be changed as needed.
*
@@ -24,7 +24,7 @@ class JsonDriver implements ConfigurationDriver {
* Returns the path to JSON configuration files.
*/
public static function getConfigPath(): string {
- return APP_PATH.'config'.DIRECTORY_SEPARATOR;
+ return APP_PATH.'Config'.DIRECTORY_SEPARATOR;
}
/**
* The name of JSON configuration file.
@@ -597,7 +597,7 @@ public function setBaseURL(string $url) {
/**
* Sets the name of the file that configuration values will be taken from.
*
- * The file must exist on the directory [APP_PATH]/config/ .
+ * The file must exist on the directory [APP_PATH]/Config/ .
*
* @param string $name
*/
diff --git a/WebFiori/Framework/Middleware/AbstractMiddleware.php b/WebFiori/Framework/Middleware/AbstractMiddleware.php
index 4a5d0b138..ef034b0cd 100644
--- a/WebFiori/Framework/Middleware/AbstractMiddleware.php
+++ b/WebFiori/Framework/Middleware/AbstractMiddleware.php
@@ -17,7 +17,7 @@
/**
* An abstract class that can be used to implement custom middleware.
*
- * Every middleware the developer write must be placed in the folder 'app/middleware'
+ * Every middleware the developer write must be placed in the folder '[APP_DIR]/Middleware'
* of the framework in order for the framework to auto-register the middleware.
* If the middleware is placed in another place, then the developer must register
* it manually using the method MiddlewareManager::register() before adding
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index 816a5c935..7897e888e 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -27,7 +27,7 @@ public function testCreateAPITestCase00() {
* @test
*/
public function testCreateAPITestCase01() {
- $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."framework".DS."scheduler".DS."webServices";
+ $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
$this->assertEquals([
"Info: Selected services manager has no service with name 'c'.\n",
"Which service you would like to have a test case for?\n",
@@ -63,7 +63,7 @@ public function testCreateAPITestCase01() {
* @test
*/
public function testCreateAPITestCase02() {
- $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."framework".DS."scheduler".DS."webServices";
+ $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
$this->assertEquals([
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
@@ -84,7 +84,7 @@ public function testCreateAPITestCase02() {
* @test
*/
public function testCreateAPITestCase03() {
- $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."framework".DS."scheduler".DS."webServices";
+ $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
@@ -119,17 +119,17 @@ public function testCreateAPITestCase03() {
* @test
*/
public function testCreateAPITestCase04() {
- $path = ROOT_PATH.DS."tests".DS."tests".DS."Apis".DS."Multiple";
+ $path = ROOT_PATH.DS."tests".DS."Apis".DS."Multiple";
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\tests\Apis\Multiple\WebService00Test'."\n",
+ 'Name: tests\Apis\Multiple\WebService00Test'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\\tests\Apis\Multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -144,7 +144,7 @@ public function testCreateAPITestCase04() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -168,19 +168,19 @@ public function testCreateAPITestCase05() {
* @test
*/
public function testCreateAPITestCase06() {
- $path = ROOT_PATH.DS."tests".DS."tests".DS."apis".DS."multiple";
+ $path = ROOT_PATH.DS."tests".DS."apis".DS."multiple";
$this->assertEquals([
"Please enter services manager information:\n",
"Error: Provided class is not an instance of ".WebServicesManager::class."\n",
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\tests\Apis\Multiple\WebService00Test'."\n",
+ 'Name: tests\Apis\Multiple\WebService00Test'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\\tests\Apis\Multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'tests\Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -195,7 +195,7 @@ public function testCreateAPITestCase06() {
'',
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\tests\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -218,7 +218,7 @@ public function testCreateAPITestCase07() {
* @test
*/
public function testCreateAPITestCase08() {
- $path = ROOT_PATH.DS."tests".DS."tests".DS."Apis".DS."Multiple";
+ $path = ROOT_PATH.DS."tests".DS."Apis".DS."Multiple";
$this->assertEquals([
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
@@ -229,7 +229,7 @@ public function testCreateAPITestCase08() {
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\tests\\Apis\\Multiple\\WebService01Test';
+ $clazz = '\\tests\\Apis\\Multiple\\WebService01Test';
$this->assertTrue(file_exists($path.DS.'WebService01Test.php'));
require_once $path.DS.'WebService01Test.php';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index c20d678c1..61b04087b 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -9,8 +9,8 @@
../WebFiori/Framework/DB.php../WebFiori/Framework/Language.php
- ../WebFiori/Framework/config/JsonDriver.php
- ../WebFiori/Framework/config/ClassDriver.php
+ ../WebFiori/Framework/Config/JsonDriver.php
+ ../WebFiori/Framework/Config/ClassDriver.php../WebFiori/Framework/Privilege.php../WebFiori/Framework/PrivilegesGroup.php
@@ -20,67 +20,67 @@
../WebFiori/Framework/ui/BeforeRenderCallback.php../WebFiori/Framework/ui/WebPage.php
- ../WebFiori/Framework/scheduler/BaseTask.php
- ../WebFiori/Framework/scheduler/AbstractTask.php
- ../WebFiori/Framework/scheduler/TasksManager.php
- ../WebFiori/Framework/scheduler/TaskArgument.php
+ ../WebFiori/Framework/Scheduler/BaseTask.php
+ ../WebFiori/Framework/Scheduler/AbstractTask.php
+ ../WebFiori/Framework/Scheduler/TasksManager.php
+ ../WebFiori/Framework/Scheduler/TaskArgument.php
- ../WebFiori/Framework/router/RouterUri.php
- ../WebFiori/Framework/router/Router.php
+ ../WebFiori/Framework/Router/RouterUri.php
+ ../WebFiori/Framework/Router/Router.php
- ../WebFiori/Framework/middleware/AbstractMiddleware.php
- ../WebFiori/Framework/middleware/MiddlewareManager.php
- ../WebFiori/Framework/middleware/CacheMiddleware.php
- ../WebFiori/Framework/middleware/StartSessionMiddleware.php
+ ../WebFiori/Framework/Middleware/AbstractMiddleware.php
+ ../WebFiori/Framework/Middleware/MiddlewareManager.php
+ ../WebFiori/Framework/Middleware/CacheMiddleware.php
+ ../WebFiori/Framework/Middleware/StartSessionMiddleware.php
- ../WebFiori/Framework/session/Session.php
- ../WebFiori/Framework/session/SessionsManager.php
- ../WebFiori/Framework/session/DefaultSessionStorage.php
- ../WebFiori/Framework/session/DatabaseSessionStorage.php
- ../WebFiori/Framework/session/SessionDB.php
+ ../WebFiori/Framework/Session/Session.php
+ ../WebFiori/Framework/Session/SessionsManager.php
+ ../WebFiori/Framework/Session/DefaultSessionStorage.php
+ ../WebFiori/Framework/Session/DatabaseSessionStorage.php
+ ../WebFiori/Framework/Session/SessionDB.php
- ../WebFiori/Framework/cli/commands/AddCommand.php
- ../WebFiori/Framework/cli/commands/CreateCommand.php
- ../WebFiori/Framework/cli/commands/ListRoutesCommand.php
- ../WebFiori/Framework/cli/commands/ListThemesCommand.php
- ../WebFiori/Framework/cli/commands/RunSQLQueryCommand.php
- ../WebFiori/Framework/cli/commands/SchedulerCommand.php
- ../WebFiori/Framework/cli/commands/SettingsCommand.php
- ../WebFiori/Framework/cli/commands/UpdateSettingsCommand.php
- ../WebFiori/Framework/cli/commands/UpdateTableCommand.php
- ../WebFiori/Framework/cli/commands/VersionCommand.php
- ../WebFiori/Framework/cli/commands/WHelpCommand.php
- ../WebFiori/Framework/cli/commands/RunMigrationsCommand.php
+ ../WebFiori/Framework/Cli/Commands/AddCommand.php
+ ../WebFiori/Framework/Cli/Commands/CreateCommand.php
+ ../WebFiori/Framework/Cli/Commands/ListRoutesCommand.php
+ ../WebFiori/Framework/Cli/Commands/ListThemesCommand.php
+ ../WebFiori/Framework/Cli/Commands/RunSQLQueryCommand.php
+ ../WebFiori/Framework/Cli/Commands/SchedulerCommand.php
+ ../WebFiori/Framework/Cli/Commands/SettingsCommand.php
+ ../WebFiori/Framework/Cli/Commands/UpdateSettingsCommand.php
+ ../WebFiori/Framework/Cli/Commands/UpdateTableCommand.php
+ ../WebFiori/Framework/Cli/Commands/VersionCommand.php
+ ../WebFiori/Framework/Cli/Commands/WHelpCommand.php
+ ../WebFiori/Framework/Cli/Commands/RunMigrationsCommand.php../WebFiori/Framework/cli/CLITestCase.php../WebFiori/Framework/cli/CLIUtils.php
- ../WebFiori/Framework/cli/helpers/ClassInfoReader.php
- ../WebFiori/Framework/cli/helpers/CreateBackgroundTask.php
- ../WebFiori/Framework/cli/helpers/CreateCLIClassHelper.php
- ../WebFiori/Framework/cli/helpers/CreateClassHelper.php
- ../WebFiori/Framework/cli/helpers/CreateDBAccessHelper.php
- ../WebFiori/Framework/cli/helpers/CreateFullRESTHelper.php
- ../WebFiori/Framework/cli/helpers/CreateMiddleware.php
- ../WebFiori/Framework/cli/helpers/CreateTableObj.php
- ../WebFiori/Framework/cli/helpers/CreateThemeHelper.php
- ../WebFiori/Framework/cli/helpers/CreateWebService.php
- ../WebFiori/Framework/cli/helpers/TableObjHelper.php
- ../WebFiori/Framework/cli/helpers/CreateAPITestCase.php
- ../WebFiori/Framework/cli/helpers/CreateMigration.php
+ ../WebFiori/Framework/Cli/Helpers/ClassInfoReader.php
+ ../WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php
+ ../WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateClassHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateMiddleware.php
+ ../WebFiori/Framework/Cli/Helpers/CreateTableObj.php
+ ../WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateWebService.php
+ ../WebFiori/Framework/Cli/Helpers/TableObjHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php
+ ../WebFiori/Framework/Cli/Helpers/CreateMigration.php
- ../WebFiori/Framework/writers/CLICommandClassWriter.php
- ../WebFiori/Framework/writers/ClassWriter.php
- ../WebFiori/Framework/writers/DBClassWriter.php
- ../WebFiori/Framework/writers/LangClassWriter.php
- ../WebFiori/Framework/writers/MiddlewareClassWriter.php
- ../WebFiori/Framework/writers/SchedulerTaskClassWriter.php
- ../WebFiori/Framework/writers/TableClassWriter.php
- ../WebFiori/Framework/writers/ThemeClassWriter.php
- ../WebFiori/Framework/writers/ThemeComponentWriter.php
- ../WebFiori/Framework/writers/WebServiceWriter.php
- ../WebFiori/Framework/writers/APITestCaseWriter.php
- ../WebFiori/Framework/writers/DatabaseMigrationWriter.php
+ ../WebFiori/Framework/Writers/CLICommandClassWriter.php
+ ../WebFiori/Framework/Writers/ClassWriter.php
+ ../WebFiori/Framework/Writers/DBClassWriter.php
+ ../WebFiori/Framework/Writers/LangClassWriter.php
+ ../WebFiori/Framework/Writers/MiddlewareClassWriter.php
+ ../WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
+ ../WebFiori/Framework/Writers/TableClassWriter.php
+ ../WebFiori/Framework/Writers/ThemeClassWriter.php
+ ../WebFiori/Framework/Writers/ThemeComponentWriter.php
+ ../WebFiori/Framework/Writers/WebServiceWriter.php
+ ../WebFiori/Framework/Writers/APITestCaseWriter.php
+ ../WebFiori/Framework/Writers/DatabaseMigrationWriter.php
diff --git a/tests/phpunit10.xml b/tests/phpunit10.xml
index 2860fdfcf..ff5539c00 100644
--- a/tests/phpunit10.xml
+++ b/tests/phpunit10.xml
@@ -53,68 +53,68 @@
../WebFiori/Framework/Access.php../WebFiori/Framework/DB.php../WebFiori/Framework/Language.php
- ../WebFiori/Framework/config/JsonDriver.php
- ../WebFiori/Framework/config/ClassDriver.php
+ ../WebFiori/Framework/Config/JsonDriver.php
+ ../WebFiori/Framework/Config/ClassDriver.php../WebFiori/Framework/Privilege.php../WebFiori/Framework/PrivilegesGroup.php../WebFiori/Framework/User.php../WebFiori/Framework/Theme.php../WebFiori/Framework/ui/BeforeRenderCallback.php../WebFiori/Framework/ui/WebPage.php
- ../WebFiori/Framework/scheduler/BaseTask.php
- ../WebFiori/Framework/scheduler/AbstractTask.php
- ../WebFiori/Framework/scheduler/TasksManager.php
- ../WebFiori/Framework/scheduler/TaskArgument.php
- ../WebFiori/Framework/router/RouterUri.php
- ../WebFiori/Framework/router/Router.php
- ../WebFiori/Framework/middleware/AbstractMiddleware.php
- ../WebFiori/Framework/middleware/MiddlewareManager.php
- ../WebFiori/Framework/middleware/CacheMiddleware.php
- ../WebFiori/Framework/middleware/StartSessionMiddleware.php
- ../WebFiori/Framework/session/Session.php
- ../WebFiori/Framework/session/SessionsManager.php
- ../WebFiori/Framework/session/DefaultSessionStorage.php
- ../WebFiori/Framework/session/DatabaseSessionStorage.php
- ../WebFiori/Framework/session/SessionDB.php
- ../WebFiori/Framework/cli/commands/AddCommand.php
- ../WebFiori/Framework/cli/commands/CreateCommand.php
- ../WebFiori/Framework/cli/commands/ListRoutesCommand.php
- ../WebFiori/Framework/cli/commands/ListThemesCommand.php
- ../WebFiori/Framework/cli/commands/RunSQLQueryCommand.php
- ../WebFiori/Framework/cli/commands/SchedulerCommand.php
- ../WebFiori/Framework/cli/commands/SettingsCommand.php
- ../WebFiori/Framework/cli/commands/UpdateSettingsCommand.php
- ../WebFiori/Framework/cli/commands/UpdateTableCommand.php
- ../WebFiori/Framework/cli/commands/VersionCommand.php
- ../WebFiori/Framework/cli/commands/WHelpCommand.php
- ../WebFiori/Framework/cli/commands/RunMigrationsCommand.php
- ../WebFiori/Framework/cli/CLITestCase.php
- ../WebFiori/Framework/cli/CLIUtils.php
- ../WebFiori/Framework/cli/helpers/ClassInfoReader.php
- ../WebFiori/Framework/cli/helpers/CreateBackgroundTask.php
- ../WebFiori/Framework/cli/helpers/CreateCLIClassHelper.php
- ../WebFiori/Framework/cli/helpers/CreateClassHelper.php
- ../WebFiori/Framework/cli/helpers/CreateDBAccessHelper.php
- ../WebFiori/Framework/cli/helpers/CreateFullRESTHelper.php
- ../WebFiori/Framework/cli/helpers/CreateMiddleware.php
- ../WebFiori/Framework/cli/helpers/CreateTableObj.php
- ../WebFiori/Framework/cli/helpers/CreateThemeHelper.php
- ../WebFiori/Framework/cli/helpers/CreateWebService.php
- ../WebFiori/Framework/cli/helpers/TableObjHelper.php
- ../WebFiori/Framework/cli/helpers/CreateAPITestCase.php
- ../WebFiori/Framework/cli/helpers/CreateMigration.php
- ../WebFiori/Framework/writers/CLICommandClassWriter.php
- ../WebFiori/Framework/writers/ClassWriter.php
- ../WebFiori/Framework/writers/DBClassWriter.php
- ../WebFiori/Framework/writers/LangClassWriter.php
- ../WebFiori/Framework/writers/MiddlewareClassWriter.php
- ../WebFiori/Framework/writers/SchedulerTaskClassWriter.php
- ../WebFiori/Framework/writers/TableClassWriter.php
- ../WebFiori/Framework/writers/ThemeClassWriter.php
- ../WebFiori/Framework/writers/ThemeComponentWriter.php
- ../WebFiori/Framework/writers/WebServiceWriter.php
- ../WebFiori/Framework/writers/APITestCaseWriter.php
- ../WebFiori/Framework/writers/DatabaseMigrationWriter.php
+ ../WebFiori/Framework/Scheduler/BaseTask.php
+ ../WebFiori/Framework/Scheduler/AbstractTask.php
+ ../WebFiori/Framework/Scheduler/TasksManager.php
+ ../WebFiori/Framework/Scheduler/TaskArgument.php
+ ../WebFiori/Framework/Router/RouterUri.php
+ ../WebFiori/Framework/Router/Router.php
+ ../WebFiori/Framework/Middleware/AbstractMiddleware.php
+ ../WebFiori/Framework/Middleware/MiddlewareManager.php
+ ../WebFiori/Framework/Middleware/CacheMiddleware.php
+ ../WebFiori/Framework/Middleware/StartSessionMiddleware.php
+ ../WebFiori/Framework/Session/Session.php
+ ../WebFiori/Framework/Session/SessionsManager.php
+ ../WebFiori/Framework/Session/DefaultSessionStorage.php
+ ../WebFiori/Framework/Session/DatabaseSessionStorage.php
+ ../WebFiori/Framework/Session/SessionDB.php
+ ../WebFiori/Framework/Cli/Commands/AddCommand.php
+ ../WebFiori/Framework/Cli/Commands/CreateCommand.php
+ ../WebFiori/Framework/Cli/Commands/ListRoutesCommand.php
+ ../WebFiori/Framework/Cli/Commands/ListThemesCommand.php
+ ../WebFiori/Framework/Cli/Commands/RunSQLQueryCommand.php
+ ../WebFiori/Framework/Cli/Commands/SchedulerCommand.php
+ ../WebFiori/Framework/Cli/Commands/SettingsCommand.php
+ ../WebFiori/Framework/Cli/Commands/UpdateSettingsCommand.php
+ ../WebFiori/Framework/Cli/Commands/UpdateTableCommand.php
+ ../WebFiori/Framework/Cli/Commands/VersionCommand.php
+ ../WebFiori/Framework/Cli/Commands/WHelpCommand.php
+ ../WebFiori/Framework/Cli/Commands/RunMigrationsCommand.php
+ ../WebFiori/Framework/Cli/CLITestCase.php
+ ../WebFiori/Framework/Cli/CLIUtils.php
+ ../WebFiori/Framework/Cli/Helpers/ClassInfoReader.php
+ ../WebFiori/Framework/Cli/Helpers/CreateBackgroundTask.php
+ ../WebFiori/Framework/Cli/Helpers/CreateCLIClassHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateClassHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateDBAccessHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateFullRESTHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateMiddleware.php
+ ../WebFiori/Framework/Cli/Helpers/CreateTableObj.php
+ ../WebFiori/Framework/Cli/Helpers/CreateThemeHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateWebService.php
+ ../WebFiori/Framework/Cli/Helpers/TableObjHelper.php
+ ../WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php
+ ../WebFiori/Framework/Cli/Helpers/CreateMigration.php
+ ../WebFiori/Framework/Writers/CLICommandClassWriter.php
+ ../WebFiori/Framework/Writers/ClassWriter.php
+ ../WebFiori/Framework/Writers/DBClassWriter.php
+ ../WebFiori/Framework/Writers/LangClassWriter.php
+ ../WebFiori/Framework/Writers/MiddlewareClassWriter.php
+ ../WebFiori/Framework/Writers/SchedulerTaskClassWriter.php
+ ../WebFiori/Framework/Writers/TableClassWriter.php
+ ../WebFiori/Framework/Writers/ThemeClassWriter.php
+ ../WebFiori/Framework/Writers/ThemeComponentWriter.php
+ ../WebFiori/Framework/Writers/WebServiceWriter.php
+ ../WebFiori/Framework/Writers/APITestCaseWriter.php
+ ../WebFiori/Framework/Writers/DatabaseMigrationWriter.php
From be05c5b6b9e5eaf81d60b3b609d5ea63fefe96ce Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 17:26:33 +0300
Subject: [PATCH 25/45] test: Fix Test Cases
---
.../Framework/Tests/Cli/CreateAPITestCaseTest.php | 2 +-
.../WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php | 4 ++--
tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php | 6 +++---
.../WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php | 4 ++--
.../WebFiori/Framework/Tests/Cli/CreateMigrationTest.php | 2 +-
tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php | 6 +++---
tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php | 8 ++++----
tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php | 8 ++++----
.../WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php | 6 +++---
9 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index 7897e888e..03021cee5 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -168,7 +168,7 @@ public function testCreateAPITestCase05() {
* @test
*/
public function testCreateAPITestCase06() {
- $path = ROOT_PATH.DS."tests".DS."apis".DS."multiple";
+ $path = ROOT_PATH.DS."tests".DS."Apis".DS."Multiple";
$this->assertEquals([
"Please enter services manager information:\n",
"Error: Provided class is not an instance of ".WebServicesManager::class."\n",
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
index 14180d78f..8257947b3 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateCLICommandTest.php
@@ -46,7 +46,7 @@ public function testCreateCommand00() {
"Enter a name for the command:\n",
"Give a short description of the command:\n",
"Would you like to add arguments to the command?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."commands\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Commands\".\n",
], $output);
$this->assertTrue(class_exists('\\App\\Commands\\NewCLICommand'));
$this->removeClass('\\App\\Commands\\NewCLICommand');
@@ -105,7 +105,7 @@ public function testCreateCommand01() {
"Is this argument optional or not?(Y/n)\n",
"Enter default value:\n",
"Would you like to add more arguments?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."commands\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Commands\".\n",
], $output);
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
index b0421c70f..8f21908aa 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
@@ -42,7 +42,7 @@ public function test00() {
"Entity class name:\n",
"Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Info: New class was created at \"". ROOT_PATH.DS."app".DS."database\".\n"
+ "Info: New class was created at \"". ROOT_PATH.DS."App".DS."Database\".\n"
], $output);
$clazz = '\\App\\Database\\EmployeeOperationsDB';
$this->assertTrue(class_exists($clazz));
@@ -77,7 +77,7 @@ public function test01() {
"Entity class name:\n",
"Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Info: New class was created at \"". ROOT_PATH.DS."app".DS."database".DS."empl\".\n"
+ "Info: New class was created at \"". ROOT_PATH.DS."App".DS."Database".DS."Empl\".\n"
], $output);
$clazz = '\\App\\Database\\Empl\\EmployeeSDB';
$this->assertTrue(class_exists($clazz));
@@ -120,7 +120,7 @@ public function test02() {
"Entity class name:\n",
"Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Info: New class was created at \"". ROOT_PATH.DS."app".DS."database\".\n"
+ "Info: New class was created at \"". ROOT_PATH.DS."App".DS."Database\".\n"
], $output);
$clazz = '\\App\\Database\\Position2xDB';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
index 3bec6c1e8..cde392827 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMiddlewareTest.php
@@ -48,7 +48,7 @@ public function testCreateMiddleware00() {
"Enter a name for the middleware:\n",
"Enter middleware priority: Enter = '0'\n",
"Would you like to add the middleware to a group?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."middleware\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Middleware\".\n",
], $output);
$this->assertTrue(class_exists('\\App\\Middleware\\NewCoolMdMiddleware'));
$this->removeClass('\\App\\Middleware\\NewCoolMdMiddleware');
@@ -84,7 +84,7 @@ public function testCreateMiddleware01() {
"Would you like to add the middleware to a group?(y/N)\n",
"Enter group name:\n",
"Would you like to add the middleware to another group?(y/N)\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."middleware\".\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Middleware\".\n",
], $output);
$clazz = '\\App\\Middleware\\NewCoolMiddleware';
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index 6546590e5..81676ce48 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -41,7 +41,7 @@ public function testCreateMigration01() {
$this->assertEquals([
"Migration namespace: Enter = 'App\Database\Migrations'\n",
"Provide a name for the class that will have migration logic:\n",
- 'Info: New class was created at "'. APP_PATH .'Database'.DS.'migrations".'."\n",
+ 'Info: New class was created at "'. APP_PATH .'Database'.DS.'Migrations".'."\n",
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'migration',
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
index ad8447b23..0f7d4a28d 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTableTest.php
@@ -120,7 +120,7 @@ public function testCreateTable00() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Database\".\n",
]), $output);
}
@@ -184,7 +184,7 @@ public function testCreateTable01() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Database\".\n",
]), $output);
}
@@ -272,7 +272,7 @@ public function testCreateTable02() {
"Would you like to add another column?(y/N)\n",
"Would you like to add foreign keys to the table?(y/N)\n",
"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",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'App'.DS."Database\".\n",
]), $output);
}
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
index 053d463f7..d09f79541 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateTaskTest.php
@@ -49,7 +49,7 @@ public function test00() {
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."Tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SuperCoolTask';
$this->assertTrue(class_exists($clazz));
@@ -98,7 +98,7 @@ public function test01() {
"Enter a name for the task:\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."Tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SuperCool2Task';
$this->assertTrue(class_exists($clazz));
@@ -152,7 +152,7 @@ public function test02() {
"Error: Invalid input is given. Try again.\n",
"Provide short description of what does the task will do:\n",
"Would you like to add arguments to the task?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."Tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\NewRoundTask';
$this->assertTrue(class_exists($clazz));
@@ -208,7 +208,7 @@ public function test03() {
"Enter argument name:\n",
"Error: Invalid argument name: \n",
"Would you like to add more arguments?(y/N)\n",
- "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."tasks\".\n",
+ "Info: New class was created at \"".ROOT_PATH.DS.'App'.DS."Tasks\".\n",
], $output);
$clazz = '\\App\\Tasks\\SendDailyReportTask';
$this->assertTrue(class_exists($clazz));
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
index d8325b7be..de6f17223 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
@@ -42,8 +42,8 @@ public function testCreateTheme00() {
"11: Quit. <--\n",
"Enter a name for the new class:\n",
"Enter an optional namespace for the class: Enter = 'Themes'\n",
- 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."fiori\"...\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."fiori\".\n",
+ 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."Fiori\"...\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."Fiori\".\n",
], $output);
$this->assertTrue(class_exists('\\Themes\\Fiori\\NewTestTheme'));
@@ -98,8 +98,8 @@ public function testCreateThemeWithExistingName() {
"Error: A class in the given namespace which has the given name was found.\n",
"Enter a name for the new class:\n",
"Enter an optional namespace for the class: Enter = 'Themes'\n",
- 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."cool\"...\n",
- 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."cool\".\n",
+ 'Creating theme at "'.ROOT_PATH.DS.'Themes'.DS."Cool\"...\n",
+ 'Info: New class was created at "'.ROOT_PATH.DS.'Themes'.DS."Cool\".\n",
], $output);
$this->assertEquals(0, $this->getExitCode());
$this->removeClass($ns2.'\\'.$name2);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
index 42ed696ea..8c7f5d941 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateWebServiceTest.php
@@ -87,7 +87,7 @@ public function test00() {
"Success: New parameter added.\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: 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",
], $output);
@@ -186,7 +186,7 @@ public function test01() {
"Success: New parameter added.\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: 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",
], $output);
@@ -285,7 +285,7 @@ public function test02() {
"Success: New parameter added.\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: 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",
], $output);
From e6635400ae0605a933b3447f5c98f48987e8edb8 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 17:38:27 +0300
Subject: [PATCH 26/45] Update DatabaseMigrationWriterTest.php
---
.../Writers/DatabaseMigrationWriterTest.php | 38 +++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index 82ea557b5..dc833bfc7 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -14,7 +14,7 @@ class DatabaseMigrationWriterTest extends TestCase {
protected function tearDown(): void {
// Clean up only the Migration files created by this test (Migration000, Migration001, etc.)
- $migrationsDir = APP_PATH . DS . 'Database' . DS . 'migrations';
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
if (is_dir($migrationsDir)) {
// Only remove Migration files directly in the migrations directory, not in subdirectories
$files = glob($migrationsDir . DS . 'Migration[0-9][0-9][0-9].php');
@@ -31,14 +31,14 @@ protected function tearDown(): void {
*/
public function test00() {
DatabaseMigrationWriter::resetCounter();
- $path = APP_PATH.DS.'Database'.DS.'migrations';
- $ns = '\\App\\Database\\migrations';
- $clazz = "\\App\\Database\\migrations\\Migration000";
+ $path = APP_PATH.DS.'Database'.DS.'Migrations';
+ $ns = '\\App\\Database\\Migrations';
+ $clazz = "\\App\\Database\\Migrations\\Migration000";
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
- $this->assertEquals('App\\Database\\migrations', $writter->getNamespace());
+ $this->assertEquals('App\\Database\\Migrations', $writter->getNamespace());
$this->assertEquals('', $writter->getSuffix());
$this->assertEquals([
"WebFiori\Database\Database",
@@ -53,7 +53,7 @@ public function test00() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('App\\Database\\migrations\\Migration000', $m00->getName());
+ $this->assertEquals('App\\Database\\Migrations\\Migration000', $m00->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
}
@@ -63,8 +63,8 @@ public function test00() {
public function test01() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'Database'.DS.'migrations';
- $ns = '\\App\\Database\\migrations';
+ $path = APP_PATH.DS.'Database'.DS.'Migrations';
+ $ns = '\\App\\Database\\Migrations';
$writter = new DatabaseMigrationWriter($runner);
$writter->setClassName('MyMigration');
$this->assertEquals('MyMigration', $writter->getName());
@@ -79,7 +79,7 @@ public function test01() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('App\\Database\\migrations\\MyMigration', $m00->getName());
+ $this->assertEquals('App\\Database\\Migrations\\MyMigration', $m00->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
}
@@ -89,8 +89,8 @@ public function test01() {
public function test02() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'Database'.DS.'migrations';
- $ns = '\\App\\Database\\migrations';
+ $path = APP_PATH.DS.'Database'.DS.'Migrations';
+ $ns = '\\App\\Database\\Migrations';
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
$writter->writeClass();
@@ -104,12 +104,12 @@ public function test02() {
$this->assertEquals(1, count($migrations));
$m00 = $migrations[0];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('App\\Database\\migrations\\Migration000', $m00->getName());
+ $this->assertEquals('App\\Database\\Migrations\\Migration000', $m00->getName());
$writter2 = new DatabaseMigrationWriter($runner2);
$this->assertEquals('Migration001', $writter2->getName());
$writter2->writeClass();
- $clazz2 = "\\App\\Database\\migrations\\Migration001";
+ $clazz2 = "\\App\\Database\\Migrations\\Migration001";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -120,7 +120,7 @@ public function test02() {
$this->assertEquals(2, count($migrations2));
$m01 = $migrations2[1];
$this->assertTrue($m00 instanceof AbstractMigration);
- $this->assertEquals('App\\Database\\migrations\\Migration001', $m01->getName());
+ $this->assertEquals('App\\Database\\Migrations\\Migration001', $m01->getName());
$this->removeClass($clazz);
$runner = new SchemaRunner(null);
$this->removeClass($clazz2);
@@ -131,8 +131,8 @@ public function test02() {
public function test03() {
DatabaseMigrationWriter::resetCounter();
$runner = new SchemaRunner(null);
- $path = APP_PATH.DS.'Database'.DS.'migrations';
- $ns = '\\App\\Database\\migrations';
+ $path = APP_PATH.DS.'Database'.DS.'Migrations';
+ $ns = '\\App\\Database\\Migrations';
$allClasses = [];
for ($x = 0 ; $x < 110 ; $x++) {
$writter = new DatabaseMigrationWriter($runner);
@@ -145,7 +145,7 @@ public function test03() {
}
$this->assertEquals($name, $writter->getName());
$writter->writeClass();
- $clazz = "\\App\\Database\\migrations\\".$name;
+ $clazz = "\\App\\Database\\Migrations\\".$name;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -158,10 +158,10 @@ public function test03() {
$this->assertEquals($x + 1, count($migrations));
$m = $migrations[$x];
$this->assertTrue($m instanceof AbstractMigration);
- $this->assertEquals("App\\Database\\migrations\\" . $name, $m->getName());
+ $this->assertEquals("App\\Database\\Migrations\\" . $name, $m->getName());
}
foreach ($migrations as $m) {
- $this->removeClass("\\App\\Database\\migrations\\".$m->getName());
+ $this->removeClass("\\App\\Database\\Migrations\\".$m->getName());
}
}
private function removeClass($classPath) {
From 6f9568bfbc4453dde3b0ad30b8f5356718e9931c Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 17:38:45 +0300
Subject: [PATCH 27/45] Update CreateCommand.php
---
WebFiori/Framework/Cli/Commands/CreateCommand.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/WebFiori/Framework/Cli/Commands/CreateCommand.php b/WebFiori/Framework/Cli/Commands/CreateCommand.php
index 8de5eeaa2..718a7ac2d 100644
--- a/WebFiori/Framework/Cli/Commands/CreateCommand.php
+++ b/WebFiori/Framework/Cli/Commands/CreateCommand.php
@@ -138,7 +138,7 @@ private function getWhat() {
$options['api-test'] = 'Web service test case.';
$options['migration'] = 'Database migration.';
$options['q'] = 'Quit.';
- $what = $this->getArgValue('--c');
+ $what = strtolower($this->getArgValue('--c'));
$answer = null;
if ($what !== null) {
From e51d354a2be0843f55e70ced529c45341988ba2e Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 18:50:14 +0300
Subject: [PATCH 28/45] fix: Namespaces
---
WebFiori/Framework/Autoload/ClassLoader.php | 2 +-
WebFiori/Framework/Cli/Commands/CreateCommand.php | 2 +-
.../Framework/Tests/Cli/CreateDBAccessTest.php | 4 ++--
.../Framework/Tests/Cli/CreateEntityTest.php | 2 +-
.../Framework/Tests/Cli/DBClassWritterTest.php | 14 +++++++-------
.../Tests/Writers/DatabaseMigrationWriterTest.php | 6 +++---
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/WebFiori/Framework/Autoload/ClassLoader.php b/WebFiori/Framework/Autoload/ClassLoader.php
index 61add8bea..34715a4a3 100644
--- a/WebFiori/Framework/Autoload/ClassLoader.php
+++ b/WebFiori/Framework/Autoload/ClassLoader.php
@@ -257,7 +257,7 @@ public static function get(array $options = [
}
}
$defineRoot = isset($options['define-root']) && $options['define-root'] === true;
- $root = isset($options['root']) ? trim($options['root'],'\\/') : trim(substr(__DIR__, 0, strlen(__DIR__) - strlen('\entity')),'\\/');
+ $root = isset($options['root']) ? trim($options['root'],'\\/') : trim(substr(__DIR__, 0, strlen(__DIR__) - strlen('\Entity')),'\\/');
if (strlen($root) != 0 && explode($DS, $root)[0] == 'home') {
//linux
diff --git a/WebFiori/Framework/Cli/Commands/CreateCommand.php b/WebFiori/Framework/Cli/Commands/CreateCommand.php
index 718a7ac2d..d346c6c21 100644
--- a/WebFiori/Framework/Cli/Commands/CreateCommand.php
+++ b/WebFiori/Framework/Cli/Commands/CreateCommand.php
@@ -44,7 +44,7 @@ public function __construct() {
}
public function createEntityFromQuery(): int {
$tableObj = CLIUtils::readTable($this);
- $defaultNs = APP_DIR.'\\entity';
+ $defaultNs = APP_DIR.'\\Entity';
$this->println('We need from you to give us entity class information.');
$infoReader = new ClassInfoReader($this);
$classInfo = $infoReader->readClassInfo($defaultNs);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
index 8f21908aa..646a76b5e 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
@@ -25,9 +25,9 @@ public function test00() {
], [
'Tables\\EmployeeInfoTable',
'EmployeeOperations',
- "\n", // Hit Enter to pick default value (App\database)
+ "\n", // Hit Enter to pick default value (App\Database)
'SuperUser',
- "\n", // Hit Enter to pick default value (App\entity)
+ "\n", // Hit Enter to pick default value (App\Entity)
'n'
]);
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
index d03c12545..625099f03 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateEntityTest.php
@@ -17,7 +17,7 @@ public function testCreateEntity00() {
'--table' => TestTable::class
], [
'NeEntity',
- "\n", // Hit Enter to pick default value (app\entity)
+ "\n", // Hit Enter to pick default value (App\Entity)
'y',
'y',
'superNewAttr',
diff --git a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
index f065feb56..bb70aff07 100644
--- a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
@@ -20,8 +20,8 @@ public function test00() {
$table = new UserInfoTable();
$mapper = $table->getEntityMapper();
$mapper->setEntityName('CoolUser');
- $mapper->setNamespace('WebFiori\\entity');
- $writter = new DBClassWriter('UserDBClass', 'WebFiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\Entity');
+ $writter = new DBClassWriter('UserDBClass', 'WebFiori\\Db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -34,8 +34,8 @@ public function test01() {
$table = new EmployeeInfoTable();
$mapper = $table->getEntityMapper();
$mapper->setEntityName('Employee');
- $mapper->setNamespace('WebFiori\\entity');
- $writter = new DBClassWriter('EmployeeDB', 'WebFiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\Entity');
+ $writter = new DBClassWriter('EmployeeDB', 'WebFiori\\Db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -48,8 +48,8 @@ public function test02() {
$table = new PositionInfoTable();
$mapper = $table->getEntityMapper();
$mapper->setEntityName('Position');
- $mapper->setNamespace('WebFiori\\entity');
- $writter = new DBClassWriter('PositionDB', 'WebFiori\\db', $table);
+ $mapper->setNamespace('WebFiori\\Entity');
+ $writter = new DBClassWriter('PositionDB', 'WebFiori\\Db', $table);
$writter->writeClass();
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
@@ -60,7 +60,7 @@ public function test02() {
*/
public function test03() {
$table = new PositionInfoTable();
- $writter = new DBClassWriter('PositionDB2', 'WebFiori\\db', $table);
+ $writter = new DBClassWriter('PositionDB2', 'WebFiori\\Db', $table);
$writter->setConnection(' ');
$this->assertNull($writter->getConnectionName());
$writter->setConnection('ok-connection');
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index dc833bfc7..06195e917 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -68,10 +68,10 @@ public function test01() {
$writter = new DatabaseMigrationWriter($runner);
$writter->setClassName('MyMigration');
$this->assertEquals('MyMigration', $writter->getName());
- $this->assertEquals('App\\Database\\migrations', $writter->getNamespace());
+ $this->assertEquals('App\\Database\\Migrations', $writter->getNamespace());
$writter->writeClass();
- $clazz = "\\App\\Database\\migrations\\MyMigration";
+ $clazz = "\\App\\Database\\Migrations\\MyMigration";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -94,7 +94,7 @@ public function test02() {
$writter = new DatabaseMigrationWriter($runner);
$this->assertEquals('Migration000', $writter->getName());
$writter->writeClass();
- $clazz = "\\App\\Database\\migrations\\Migration000";
+ $clazz = "\\App\\Database\\Migrations\\Migration000";
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
From 0732cd09b158a15ec792e0fe595fac131bc836d8 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 18:54:54 +0300
Subject: [PATCH 29/45] test: Correcting Namespaces
---
.../EmptyService/EmptyServicesManager.php | 2 +-
tests/Apis/Multiple/ServicesManager00.php | 2 +-
tests/Apis/Multiple/WebService00.php | 2 +-
tests/Apis/Multiple/WebService01.php | 2 +-
.../Tests/Cli/CreateAPITestCaseTest.php | 22 +++++++++----------
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/tests/Apis/EmptyService/EmptyServicesManager.php b/tests/Apis/EmptyService/EmptyServicesManager.php
index fbe232001..aba06f4cc 100644
--- a/tests/Apis/EmptyService/EmptyServicesManager.php
+++ b/tests/Apis/EmptyService/EmptyServicesManager.php
@@ -1,5 +1,5 @@
assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest';
+ $clazz = '\\WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest';
$this->assertTrue(file_exists($path.DS.'TasksLoginServiceTest.php'));
require_once $path.DS.'TasksLoginServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -74,7 +74,7 @@ public function testCreateAPITestCase02() {
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
+ $clazz = '\\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -109,7 +109,7 @@ public function testCreateAPITestCase03() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
+ $clazz = '\\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest';
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
@@ -136,7 +136,7 @@ public function testCreateAPITestCase04() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\tests\\Apis\\Multiple\\ServicesManager00',
+ '\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
@@ -144,7 +144,7 @@ public function testCreateAPITestCase04() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -160,7 +160,7 @@ public function testCreateAPITestCase05() {
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\tests\\Apis\\EmptyService\\EmptyServicesManager',
+ '--manager' => '\\Apis\\EmptyService\\EmptyServicesManager',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -187,15 +187,15 @@ public function testCreateAPITestCase06() {
'--c' => 'api-test',
'--service' => 'say-hi-service',
], [
- '\\tests\\Apis\\Multiple\\WebService00',
- '\\tests\\Apis\\Multiple\\ServicesManager00',
+ '\\Apis\\Multiple\\WebService00',
+ '\\Apis\\Multiple\\ServicesManager00',
'n',
'10',
'',
'',
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\Apis\\Multiple\\WebService00Test';
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.'WebService00Test.php';
$this->assertTrue(class_exists($clazz));
@@ -210,7 +210,7 @@ public function testCreateAPITestCase07() {
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\tests\\Apis\\EmptyService\\Xyz',
+ '--manager' => '\\Apis\\EmptyService\\Xyz',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -225,7 +225,7 @@ public function testCreateAPITestCase08() {
CreateCommand::class,
'--c' => 'api-test',
'--service' => 'say-hi-service-2',
- '--manager' => '\\tests\\Apis\\Multiple\\ServicesManager00',
+ '--manager' => '\\Apis\\Multiple\\ServicesManager00',
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
From 7a29c475d79802346579c9ca0e079cf07bfbe1a7 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 19:24:47 +0300
Subject: [PATCH 30/45] Update CreateAPITestCaseTest.php
---
.../Framework/Tests/Cli/CreateAPITestCaseTest.php | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index fa2c56cf4..84e31cb76 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -27,7 +27,7 @@ public function testCreateAPITestCase00() {
* @test
*/
public function testCreateAPITestCase01() {
- $path = ROOT_PATH.DS."tests".DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
+ $path = ROOT_PATH.DS.'tests'.DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
$this->assertEquals([
"Info: Selected services manager has no service with name 'c'.\n",
"Which service you would like to have a test case for?\n",
@@ -38,7 +38,7 @@ public function testCreateAPITestCase01() {
"4: set-password\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest'."\n",
+ 'Name: WebFiori\\Framework\Scheduler\WebServices\\TasksLoginServiceTest'."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"Info: New class was created at \"".$path."\".\n"
@@ -85,16 +85,17 @@ public function testCreateAPITestCase02() {
*/
public function testCreateAPITestCase03() {
$path = ROOT_PATH.DS."tests".DS."WebFiori".DS."Framework".DS."Scheduler".DS."WebServices";
+ $name = 'GetTasksServiceTest';
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\WebFiori\\Framework\Scheduler\WebServices\\GetTasksServiceTest'."\n",
+ 'Name: WebFiori\\Framework\Scheduler\WebServices\\'.$name."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\WebFiori\\Framework\Scheduler\WebServices'\n",
+ "Enter an optional namespace for the class: Enter = 'WebFiori\\Framework\Scheduler\WebServices'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -113,7 +114,7 @@ public function testCreateAPITestCase03() {
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass($path.DS.$name);
}
/**
* @test
From 42f0909fe69507e4d7678bf89ce3651c8a5f3671 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Wed, 8 Oct 2025 19:25:08 +0300
Subject: [PATCH 31/45] Update CreateAPITestCase.php
---
WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php b/WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php
index 64bc40721..6a8d10742 100644
--- a/WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php
+++ b/WebFiori/Framework/Cli/Helpers/CreateAPITestCase.php
@@ -44,7 +44,7 @@ public function readClassInfo() {
array_pop($nsArr);
$ns = implode('\\', $nsArr);
$this->setClassName($this->writer->getServiceName().'Test');
- $this->setNamespace('tests\\'.$ns);
+ $this->setNamespace($ns);
$this->setPath(ROOT_PATH.DS.'tests'.DS.implode(DS, $nsArr));
@@ -67,7 +67,8 @@ private function checkPlace($ns) {
$this->writeClass();
} else {
$this->writer->setPhpUnitVersion($this->getCommand()->readInteger('PHPUnit Version:', 11));
- $this->setClassInfo('tests\\'.$ns, 'Test');
+ $this->setClassInfo($ns, 'Test');
+ $this->setPath(ROOT_PATH.DS.'tests'.DS.$this->writer->getNamespace());
$this->writeClass();
}
}
From 7b62798afbb5f7a18295599ab28d4b54b8285f41 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 11:59:30 +0300
Subject: [PATCH 32/45] Update CreateAPITestCaseTest.php
---
.../Tests/Cli/CreateAPITestCaseTest.php | 35 ++++++++++---------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index 84e31cb76..2f3874e45 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -121,16 +121,17 @@ public function testCreateAPITestCase03() {
*/
public function testCreateAPITestCase04() {
$path = ROOT_PATH.DS."tests".DS."Apis".DS."Multiple";
+ $name = 'WebService00Test';
$this->assertEquals([
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\Apis\Multiple\WebService00Test'."\n",
+ 'Name: Apis\Multiple\\'.$name."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\Apis\Multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -145,11 +146,11 @@ public function testCreateAPITestCase04() {
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\Apis\\Multiple\\WebService00Test';
- $this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
- require_once $path.DS.'WebService00Test.php';
+ $clazz = '\\Apis\\Multiple\\'.$name;
+ $this->assertTrue(file_exists($path.DS.$name.'.php'));
+ require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass($path.DS.$name);
}
/**
@@ -170,18 +171,19 @@ public function testCreateAPITestCase05() {
*/
public function testCreateAPITestCase06() {
$path = ROOT_PATH.DS."tests".DS."Apis".DS."Multiple";
+ $name = 'WebService00Test';
$this->assertEquals([
"Please enter services manager information:\n",
"Error: Provided class is not an instance of ".WebServicesManager::class."\n",
"Please enter services manager information:\n",
"Test case will be created with following parameters:\n",
"PHPUnit Version: 9\n",
- 'Name: tests\Apis\Multiple\WebService00Test'."\n",
+ 'Name: Apis\Multiple\\'.$name."\n",
"Path: ".$path."\n",
"Would you like to use default parameters?(Y/n)\n",
"PHPUnit Version: Enter = '11'\n",
"Enter a name for the new class:\n",
- "Enter an optional namespace for the class: Enter = 'tests\Apis\Multiple'\n",
+ "Enter an optional namespace for the class: Enter = 'Apis\Multiple'\n",
"Info: New class was created at \"".$path."\".\n"
], $this->executeMultiCommand([
CreateCommand::class,
@@ -196,11 +198,11 @@ public function testCreateAPITestCase06() {
'',
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\Apis\\Multiple\\WebService00Test';
+ $clazz = '\\Apis\\Multiple\\'.$name;
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
- require_once $path.DS.'WebService00Test.php';
+ require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass($path.DS.$name);
}
/**
* @test
@@ -211,7 +213,7 @@ public function testCreateAPITestCase07() {
], $this->executeMultiCommand([
CreateCommand::class,
'--c' => 'api-test',
- '--manager' => '\\Apis\\EmptyService\\Xyz',
+ '--manager' => '\\tests\\Apis\\EmptyService\\Xyz',
]));
$this->assertEquals(-1, $this->getExitCode());
}
@@ -230,10 +232,11 @@ public function testCreateAPITestCase08() {
'--defaults'
]));
$this->assertEquals(0, $this->getExitCode());
- $clazz = '\\tests\\Apis\\Multiple\\WebService01Test';
- $this->assertTrue(file_exists($path.DS.'WebService01Test.php'));
- require_once $path.DS.'WebService01Test.php';
+ $name = 'WebService01Test';
+ $clazz = '\\Apis\\Multiple\\'.$name;
+ $this->assertTrue(file_exists($path.DS.$name.'.php'));
+ require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass($path.DS.$name);
}
}
From c01e10cc5e50b056548aa6eee02bfd5e0bd1e960 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:19:19 +0300
Subject: [PATCH 33/45] Update DatabaseMigrationWriter.php
---
WebFiori/Framework/Writers/DatabaseMigrationWriter.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
index 28d833adf..355952ee8 100644
--- a/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
+++ b/WebFiori/Framework/Writers/DatabaseMigrationWriter.php
@@ -35,7 +35,7 @@ public function __construct(?SchemaRunner $runner) {
$this->setClassName($name);
- parent::__construct($name, APP_PATH.'Database'.DS.'migrations', APP_DIR.'\\Database\\migrations');
+ parent::__construct($name, APP_PATH.'Database'.DS.'Migrations', APP_DIR.'\\Database\\Migrations');
$this->addUseStatement([
Database::class,
AbstractMigration::class,
From 713dd660deab266f5b7ccc1a7d6d85048a15f397 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:32:50 +0300
Subject: [PATCH 34/45] Update CreateDBAccessTest.php
---
tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
index 646a76b5e..65a4d38e2 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateDBAccessTest.php
@@ -60,9 +60,9 @@ public function test01() {
], [
'Tables\\EmployeeInfoTable',
'EmployeeS',
- 'App\\Database\\Empl',
+ "\n",
'SuperHero',
- 'App\\Entity\\Subs',
+ "\n",
'y'
]);
@@ -77,9 +77,9 @@ public function test01() {
"Entity class name:\n",
"Entity namespace: Enter = 'App\\Entity'\n",
"Would you like to have update methods for every single column?(y/N)\n",
- "Info: New class was created at \"". ROOT_PATH.DS."App".DS."Database".DS."Empl\".\n"
+ "Info: New class was created at \"". ROOT_PATH.DS."App".DS."Database\".\n"
], $output);
- $clazz = '\\App\\Database\\Empl\\EmployeeSDB';
+ $clazz = '\\App\\Database\\EmployeeSDB';
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
From a148a8be6ae75793f5a27e115a5295168dffaf40 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:33:01 +0300
Subject: [PATCH 35/45] Update CreateMigrationTest.php
---
tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index 81676ce48..f94386bc7 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -39,7 +39,7 @@ public function testCreateMigration01() {
$clazz = '\\App\\Database\\Migrations\\'.$name;
$this->assertEquals([
- "Migration namespace: Enter = 'App\Database\Migrations'\n",
+ "Migration namespace: Enter = 'App\Database\migrations'\n",
"Provide a name for the class that will have migration logic:\n",
'Info: New class was created at "'. APP_PATH .'Database'.DS.'Migrations".'."\n",
], $this->executeMultiCommand([
From 620bfbdc1c3bb220886ced744367bac415c03a47 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:33:20 +0300
Subject: [PATCH 36/45] Update CreateCommand.php
---
WebFiori/Framework/Cli/Commands/CreateCommand.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/WebFiori/Framework/Cli/Commands/CreateCommand.php b/WebFiori/Framework/Cli/Commands/CreateCommand.php
index d346c6c21..bc5c2d3d6 100644
--- a/WebFiori/Framework/Cli/Commands/CreateCommand.php
+++ b/WebFiori/Framework/Cli/Commands/CreateCommand.php
@@ -138,11 +138,11 @@ private function getWhat() {
$options['api-test'] = 'Web service test case.';
$options['migration'] = 'Database migration.';
$options['q'] = 'Quit.';
- $what = strtolower($this->getArgValue('--c'));
+ $what = $this->getArgValue('--c');
$answer = null;
if ($what !== null) {
- $answer = $options[$what] ?? null;
+ $answer = $options[strtolower($what)] ?? null;
if ($answer === null) {
$this->warning('The argument --c has invalid value.');
From 4cdb822c076ec4e1e95e9503699d5057b053b6e2 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:45:03 +0300
Subject: [PATCH 37/45] Update CreateThemeTest.php
---
.../Framework/Tests/Cli/CreateThemeTest.php | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
index de6f17223..30c682b1e 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateThemeTest.php
@@ -12,7 +12,33 @@
* @author Ibrahim
*/
class CreateThemeTest extends CLITestCase {
- /**
+
+ protected function tearDown(): void {
+ // Clean up theme assets from public directory
+ $assetsPath = ROOT_PATH . DS . PUBLIC_FOLDER . DS . 'assets';
+ if (is_dir($assetsPath)) {
+ $themeDirs = ['FioriTheme', 'FioriTheme2', 'Cool'];
+ foreach ($themeDirs as $themeDir) {
+ $themePath = $assetsPath . DS . $themeDir;
+ if (is_dir($themePath)) {
+ $this->removeDirectory($themePath);
+ }
+ }
+ }
+ parent::tearDown();
+ }
+
+ private function removeDirectory($dir) {
+ if (!is_dir($dir)) {
+ return;
+ }
+ $files = array_diff(scandir($dir), ['.', '..']);
+ foreach ($files as $file) {
+ $path = $dir . DS . $file;
+ is_dir($path) ? $this->removeDirectory($path) : unlink($path);
+ }
+ rmdir($dir);
+ } /**
* @test
*/
public function testCreateTheme00() {
From 8c7402342723c1e6498fdd3d0a3a3d7f2aa7762a Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:45:19 +0300
Subject: [PATCH 38/45] Update ThemeTest.php
---
.../Framework/Tests/Theme/ThemeTest.php | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
index 4783a7338..d6b12b88d 100644
--- a/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
+++ b/tests/WebFiori/Framework/Tests/Theme/ThemeTest.php
@@ -14,7 +14,33 @@
* @author Ibrahim
*/
class ThemeTest extends TestCase {
- public function testAvailableThemes00() {
+
+ protected function tearDown(): void {
+ // Clean up theme assets from public directory
+ $assetsPath = ROOT_PATH . DS . PUBLIC_FOLDER . DS . 'assets';
+ if (is_dir($assetsPath)) {
+ $themeDirs = ['FioriTheme', 'FioriTheme2'];
+ foreach ($themeDirs as $themeDir) {
+ $themePath = $assetsPath . DS . $themeDir;
+ if (is_dir($themePath)) {
+ $this->removeDirectory($themePath);
+ }
+ }
+ }
+ parent::tearDown();
+ }
+
+ private function removeDirectory($dir) {
+ if (!is_dir($dir)) {
+ return;
+ }
+ $files = array_diff(scandir($dir), ['.', '..']);
+ foreach ($files as $file) {
+ $path = $dir . DS . $file;
+ is_dir($path) ? $this->removeDirectory($path) : unlink($path);
+ }
+ rmdir($dir);
+ } public function testAvailableThemes00() {
$themes = ThemeManager::getRegisteredThemes();
$this->assertEquals(2, count($themes));
}
From 6a03b801f8f18f46cd0405a5073a589dcaab720e Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 12:58:00 +0300
Subject: [PATCH 39/45] Update CreateAPITestCaseTest.php
---
.../Framework/Tests/Cli/CreateAPITestCaseTest.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
index 2f3874e45..cae0f8241 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateAPITestCaseTest.php
@@ -57,7 +57,7 @@ public function testCreateAPITestCase01() {
$this->assertTrue(file_exists($path.DS.'TasksLoginServiceTest.php'));
require_once $path.DS.'TasksLoginServiceTest.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass('tests\\WebFiori\\Framework\\Scheduler\\WebServices\\TasksLoginServiceTest');
}
/**
* @test
@@ -78,7 +78,7 @@ public function testCreateAPITestCase02() {
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($clazz);
+ $this->removeClass('tests\\WebFiori\\Framework\\Scheduler\\WebServices\\GetTasksServiceTest');
}
/**
* @test
@@ -114,7 +114,7 @@ public function testCreateAPITestCase03() {
$this->assertTrue(file_exists($path.DS.'GetTasksServiceTest.php'));
require_once $path.DS.'GetTasksServiceTest.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($path.DS.$name);
+ $this->removeClass('tests\\WebFiori\\Framework\\Scheduler\\WebServices\\GetTasksServiceTest');
}
/**
* @test
@@ -150,7 +150,7 @@ public function testCreateAPITestCase04() {
$this->assertTrue(file_exists($path.DS.$name.'.php'));
require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($path.DS.$name);
+ $this->removeClass('tests\\Apis\\Multiple\\'.$name);
}
/**
@@ -202,7 +202,7 @@ public function testCreateAPITestCase06() {
$this->assertTrue(file_exists($path.DS.'WebService00Test.php'));
require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($path.DS.$name);
+ $this->removeClass('tests\\Apis\\Multiple\\'.$name);
}
/**
* @test
@@ -237,6 +237,6 @@ public function testCreateAPITestCase08() {
$this->assertTrue(file_exists($path.DS.$name.'.php'));
require_once $path.DS.$name.'.php';
$this->assertTrue(class_exists($clazz));
- $this->removeClass($path.DS.$name);
+ $this->removeClass('tests\\Apis\\Multiple\\'.$name);
}
}
From 2fcb0c5993d7eb47c270d8113f58a2cf13f76046 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 13:46:32 +0300
Subject: [PATCH 40/45] fix: Writing Classes
---
.../Framework/Tests/Cli/CreateMigrationTest.php | 9 +++++++++
.../Framework/Tests/Cli/DBClassWritterTest.php | 14 ++++++++++++++
.../Tests/Writers/DatabaseMigrationWriterTest.php | 9 +++++++++
3 files changed, 32 insertions(+)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index f94386bc7..c38ad604e 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -9,6 +9,15 @@
*/
class CreateMigrationTest extends CLITestCase {
+ protected function setUp(): void {
+ parent::setUp();
+ // Ensure migrations directory exists
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
+ if (!is_dir($migrationsDir)) {
+ mkdir($migrationsDir, 0755, true);
+ }
+ }
+
protected function tearDown(): void {
// Clean up only specific migration files created by this test
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
diff --git a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
index bb70aff07..60fcf8179 100644
--- a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
@@ -13,6 +13,20 @@
* @author Ibrahim
*/
class DBClassWritterTest extends CLITestCase {
+
+ protected function setUp(): void {
+ parent::setUp();
+ // Ensure directories exist for DB classes
+ $dirs = [
+ ROOT_PATH . DS . 'WebFiori' . DS . 'Db',
+ ROOT_PATH . DS . 'WebFiori' . DS . 'Entity'
+ ];
+ foreach ($dirs as $dir) {
+ if (!is_dir($dir)) {
+ mkdir($dir, 0755, true);
+ }
+ }
+ }
/**
* @test
*/
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index 06195e917..7888d77cd 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -12,6 +12,15 @@
*/
class DatabaseMigrationWriterTest extends TestCase {
+ protected function setUp(): void {
+ parent::setUp();
+ // Ensure migrations directory exists
+ $migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
+ if (!is_dir($migrationsDir)) {
+ mkdir($migrationsDir, 0755, true);
+ }
+ }
+
protected function tearDown(): void {
// Clean up only the Migration files created by this test (Migration000, Migration001, etc.)
$migrationsDir = APP_PATH . DS . 'Database' . DS . 'Migrations';
From c59fac072dd9c41861f1effa4ed76137e4906241 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 14:18:48 +0300
Subject: [PATCH 41/45] test: Added Check for Files
---
.../Tests/Cli/DBClassWritterTest.php | 20 +++++++++++++++++++
.../Writers/DatabaseMigrationWriterTest.php | 4 ++++
2 files changed, 24 insertions(+)
diff --git a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
index 60fcf8179..f34ade04b 100644
--- a/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/DBClassWritterTest.php
@@ -37,6 +37,11 @@ public function test00() {
$mapper->setNamespace('WebFiori\\Entity');
$writter = new DBClassWriter('UserDBClass', 'WebFiori\\Db', $table);
$writter->writeClass();
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
}
@@ -51,6 +56,11 @@ public function test01() {
$mapper->setNamespace('WebFiori\\Entity');
$writter = new DBClassWriter('EmployeeDB', 'WebFiori\\Db', $table);
$writter->writeClass();
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
}
@@ -65,6 +75,11 @@ public function test02() {
$mapper->setNamespace('WebFiori\\Entity');
$writter = new DBClassWriter('PositionDB', 'WebFiori\\Db', $table);
$writter->writeClass();
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
}
@@ -81,6 +96,11 @@ public function test03() {
$this->assertEquals('ok-connection', $writter->getConnectionName());
$writter->includeColumnsUpdate();
$writter->writeClass();
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($writter->getName(true)));
$this->removeClass($writter->getName(true));
}
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index 7888d77cd..819c157ca 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -55,6 +55,10 @@ public function test00() {
], $writter->getUseStatements());
$writter->writeClass();
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
From 13da8b02b1da3ae969d8402132027364695f57e8 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 14:28:59 +0300
Subject: [PATCH 42/45] Update CreateMigrationTest.php
---
tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
index c38ad604e..7dff77f2d 100644
--- a/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
+++ b/tests/WebFiori/Framework/Tests/Cli/CreateMigrationTest.php
@@ -61,6 +61,11 @@ public function testCreateMigration01() {
"11"
]));
$this->assertEquals(0, $this->getExitCode());
+
+ // Check if file was written and require it
+ $filePath = APP_PATH . 'Database' . DS . 'Migrations' . DS . $name . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($clazz));
$this->removeClass($clazz);
}
From b78c71aab72fc5d5ba8ba446d97b1886a79d0d97 Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 14:29:17 +0300
Subject: [PATCH 43/45] Update DatabaseMigrationWriterTest.php
---
.../Tests/Writers/DatabaseMigrationWriterTest.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index 819c157ca..c8ab581dd 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -85,6 +85,11 @@ public function test01() {
$writter->writeClass();
$clazz = "\\App\\Database\\Migrations\\MyMigration";
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -159,6 +164,11 @@ public function test03() {
$this->assertEquals($name, $writter->getName());
$writter->writeClass();
$clazz = "\\App\\Database\\Migrations\\".$name;
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
From 6d5695273033fd63551acba7d2a44f265922bf7c Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 14:47:32 +0300
Subject: [PATCH 44/45] Update DatabaseMigrationWriterTest.php
---
.../Tests/Writers/DatabaseMigrationWriterTest.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
index c8ab581dd..e02dab022 100644
--- a/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
+++ b/tests/WebFiori/Framework/Tests/Writers/DatabaseMigrationWriterTest.php
@@ -113,6 +113,11 @@ public function test02() {
$this->assertEquals('Migration000', $writter->getName());
$writter->writeClass();
$clazz = "\\App\\Database\\Migrations\\Migration000";
+
+ // Check if file was written and require it
+ $filePath = $writter->getPath() . DS . $writter->getName() . '.php';
+ $this->assertTrue(file_exists($filePath), "Class file was not created: $filePath");
+ require_once $filePath;
$this->assertTrue(class_exists($clazz));
$runner->register($clazz);
$allClasses[] = $clazz;
@@ -128,7 +133,12 @@ public function test02() {
$this->assertEquals('Migration001', $writter2->getName());
$writter2->writeClass();
$clazz2 = "\\App\\Database\\Migrations\\Migration001";
- $this->assertTrue(class_exists($clazz));
+
+ // Check if file was written and require it
+ $filePath2 = $writter2->getPath() . DS . $writter2->getName() . '.php';
+ $this->assertTrue(file_exists($filePath2), "Class file was not created: $filePath2");
+ require_once $filePath2;
+ $this->assertTrue(class_exists($clazz2));
$runner->register($clazz);
$allClasses[] = $clazz;
$runner3 = new SchemaRunner(null);
From c2bac791aa6aca1bd9e8742c017d75e8574fd38d Mon Sep 17 00:00:00 2001
From: Ibrahim BinAlshikh
Date: Thu, 9 Oct 2025 15:05:56 +0300
Subject: [PATCH 45/45] chore: Updated Version Number
---
WebFiori/Framework/App.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/WebFiori/Framework/App.php b/WebFiori/Framework/App.php
index 2ae349276..4113dfcac 100644
--- a/WebFiori/Framework/App.php
+++ b/WebFiori/Framework/App.php
@@ -642,7 +642,7 @@ public static function initFrameworkVersionInfo() {
*
* @since 2.1
*/
- define('WF_VERSION', '3.0.0-Beta.28');
+ define('WF_VERSION', '3.0.0-Beta.29');
/**
* A constant that tells the type of framework version.
*
@@ -658,7 +658,7 @@ public static function initFrameworkVersionInfo() {
*
* @since 2.1
*/
- define('WF_RELEASE_DATE', '2025-08-04');
+ define('WF_RELEASE_DATE', '2025-10-09');
}
/**