diff --git a/tests/secret_not_in_git/DatabaseTest.php b/tests/secret_not_in_git/DatabaseTest.php deleted file mode 100644 index 5837720..0000000 --- a/tests/secret_not_in_git/DatabaseTest.php +++ /dev/null @@ -1,121 +0,0 @@ -IncludeReq(); - - $db = $this->GetDatabase(); - - if (!$db->IsTableExist('users')) - die('Таблица не существует. Сперва запустите тест testCreateTable / Table does not exist. Run testCreateTable first'); - - if ($db->IsExist( - table: 'users', - where: new ConditionBuilder()->WhereEquals('login', 'account1') - )) - die('Запись с логином account1 уже существует в таблице users. Сперва удалите запись с логином account1 (можно использовать метод testDelete) / Record with login account1 already exists in table users. Delete record with login account1 first'); - - $model = new UserModel( - id: GUID::Generate(), - login: "account1", - password: "password1", - salt: GUID_EMPTY, - firstName: "firstName1", - middleName: "middleName1", - lastName: "lastName1", - email: "email1@ya.ru", - isEmailVerified: false, - groupName: "default", - createdAt: time(), - updatedAt: 0, - userData: ['key1' => 'value1', 'key2' => 'value2'] - ); - - $result = $db->Insert('users', $model); - - $this->assertTrue($result !== false); - } - - public function testQuery () {} - - public function testQueryLast () {} - - public function testCreateTable () - { - $this->IncludeReq(); - - $db = $this->GetDatabase(); - - $db->CreateTable( - tableName: 'users', - dbItemClass: '\goodboyalex\php_db_components_pack\tests\secret_not_in_git\UserModel' - ); - - $this->assertTrue($db->IsTableExist('users')); - } - - public function testQueryFirst () {} - - public function testCount () {} - - public function testGetCol () {} - - public function testGetRows () {} - - public function testIsTableExist () {} - - public function testDropTable () {} - - public function testGetValue () {} - - public function testUpdate () {} - - public function testIsExist () {} - - public function testDelete () {} - - private function IncludeReq (): void - { - require_once 'Converters.php'; - require_once 'UserModel.php'; - } - - private function GetDatabase (): Database - { - $config = new DBConfig( - driver: DBDriver::MSSQL, - host: '46.172.4.201', - port: 17879, - name: 'php_db_components_test', - userName: "db_user", - password: 'hxcssuy:oI.CQ%.zbw=As$Lj7=]+nf' - ); - - $onException = fn (Exception $exception, bool $terminate) - => $terminate - ? die($exception->getMessage()) - : print $exception->getMessage(); - - return new Database($config, $onException); - } - } \ No newline at end of file