diff --git a/tests/Controller/Api/ApiControllerSettingsTrait.php b/tests/Controller/Api/ApiControllerSettingsTrait.php deleted file mode 100755 index 333553d..0000000 --- a/tests/Controller/Api/ApiControllerSettingsTrait.php +++ /dev/null @@ -1,103 +0,0 @@ -app = new class() extends ApplicationAbstract - { - protected string $appName = 'Api'; - }; - - $this->app->dbPool = $GLOBALS['dbpool']; - $this->app->unitId = 1; - $this->app->accountManager = new AccountManager($GLOBALS['session']); - $this->app->appSettings = new CoreSettings(); - $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/'); - $this->app->dispatcher = new Dispatcher($this->app); - $this->app->eventManager = new EventManager($this->app->dispatcher); - $this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php'); - $this->app->sessionManager = new HttpSession(36000); - $this->app->l11nManager = new L11nManager(); - - $account = new Account(); - TestUtils::setMember($account, 'id', 1); - - $permission = new AccountPermission(); - $permission->unit = 1; - $permission->app = 2; - $permission->setPermission( - PermissionType::READ - | PermissionType::CREATE - | PermissionType::MODIFY - | PermissionType::DELETE - | PermissionType::PERMISSION - ); - - $account->addPermission($permission); - - $this->app->accountManager->add($account); - $this->app->router = new WebRouter(); - - $this->module = $this->app->moduleManager->get('Admin'); - - TestUtils::setMember($this->module, 'app', $this->app); - } - - use ApiControllerSettingsTrait; - use ApiControllerAccountTrait; - use ApiControllerGroupTrait; - use ApiControllerPermissionTrait; - use ApiControllerModuleTrait; - use ApiControllerApplicationTrait; -} diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 333553d..f896390 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -21,7 +21,6 @@ use Modules\Admin\tests\Controller\Api\ApiControllerApplicationTrait; use Modules\Admin\tests\Controller\Api\ApiControllerGroupTrait; use Modules\Admin\tests\Controller\Api\ApiControllerModuleTrait; use Modules\Admin\tests\Controller\Api\ApiControllerPermissionTrait; -use Modules\Admin\tests\Controller\Api\ApiControllerSettingsTrait; use phpOMS\Account\Account; use phpOMS\Account\AccountManager; use phpOMS\Account\PermissionType; @@ -94,7 +93,6 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->module, 'app', $this->app); } - use ApiControllerSettingsTrait; use ApiControllerAccountTrait; use ApiControllerGroupTrait; use ApiControllerPermissionTrait;