mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-04 19:58:39 +00:00
remove db prefix
This commit is contained in:
parent
1fdb93968a
commit
b2f17234fa
84
Algorithm/Graph/DependencyResolver.php
Normal file
84
Algorithm/Graph/DependencyResolver.php
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.4
|
||||||
|
*
|
||||||
|
* @package phpOMS\Algorithm\Graph;
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace phpOMS\Algorithm\Graph;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dependency resolver class.
|
||||||
|
*
|
||||||
|
* @package phpOMS\Algorithm\Graph;
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
final class DependencyResolver
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Resolve dependencies
|
||||||
|
*
|
||||||
|
* @param array $graph Graph to resolve
|
||||||
|
*
|
||||||
|
* @return null|array
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function resolve(array $graph) : ?array
|
||||||
|
{
|
||||||
|
$resolved = [];
|
||||||
|
$unresolved = [];
|
||||||
|
foreach ($graph as $table => $dependency) {
|
||||||
|
self::dependencyResolve($table, $graph, $resolved, $unresolved);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !empty($unresolved) ? null : $resolved;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Algorithm to resolve dependencies
|
||||||
|
*
|
||||||
|
* @param int|string $item Item id
|
||||||
|
* @param array<int|string, array> $items All items
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
private static function dependencyResolve($item, array $items, array &$resolved, array &$unresolved) : void
|
||||||
|
{
|
||||||
|
$unresolved[] = $item;
|
||||||
|
|
||||||
|
if (!isset($items[$item])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($items[$item] as $dependency) {
|
||||||
|
if (!\in_array($dependency, $unresolved)) {
|
||||||
|
$unresolved[] = $dependency;
|
||||||
|
self::dependencyResolve($dependency, $items, $resolved, $unresolved);
|
||||||
|
} else {
|
||||||
|
continue; // circular dependency
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!\in_array($item, $resolved)) {
|
||||||
|
$resolved[] = $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($unresolved as $key => $unres) {
|
||||||
|
if ($unres === $item) {
|
||||||
|
unset($unresolved[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -48,14 +48,12 @@ abstract class InstallerAbstract
|
||||||
public static function registerInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
public static function registerInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
||||||
{
|
{
|
||||||
$queryModule = new Builder($dbPool->get('insert'));
|
$queryModule = new Builder($dbPool->get('insert'));
|
||||||
$queryModule->prefix($dbPool->get('insert')->prefix);
|
|
||||||
$queryModule->insert('module_id', 'module_theme', 'module_path', 'module_active', 'module_version')
|
$queryModule->insert('module_id', 'module_theme', 'module_path', 'module_active', 'module_version')
|
||||||
->into('module')
|
->into('module')
|
||||||
->values($info->getInternalName(), 'Default', $info->getDirectory(), 0, $info->getVersion())
|
->values($info->getInternalName(), 'Default', $info->getDirectory(), 0, $info->getVersion())
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$queryLoad = new Builder($dbPool->get('insert'));
|
$queryLoad = new Builder($dbPool->get('insert'));
|
||||||
$queryLoad->prefix($dbPool->get('insert')->prefix);
|
|
||||||
$queryLoad->insert('module_load_pid', 'module_load_type', 'module_load_from', 'module_load_for', 'module_load_file')
|
$queryLoad->insert('module_load_pid', 'module_load_type', 'module_load_from', 'module_load_for', 'module_load_file')
|
||||||
->into('module_load');
|
->into('module_load');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,6 @@ final class ModuleManager
|
||||||
$uriHash = $request->getHash();
|
$uriHash = $request->getHash();
|
||||||
|
|
||||||
$query = new Builder($this->app->dbPool->get('select'));
|
$query = new Builder($this->app->dbPool->get('select'));
|
||||||
$query->prefix($this->app->dbPool->get('select')->prefix);
|
|
||||||
$sth = $query->select('module_load.module_load_type', 'module_load.*')
|
$sth = $query->select('module_load.module_load_type', 'module_load.*')
|
||||||
->from('module_load')
|
->from('module_load')
|
||||||
->innerJoin('module')->on('module_load.module_load_from', '=', 'module.module_id')->orOn('module_load.module_load_for', '=', 'module.module_id')
|
->innerJoin('module')->on('module_load.module_load_from', '=', 'module.module_id')->orOn('module_load.module_load_for', '=', 'module.module_id')
|
||||||
|
|
@ -192,7 +191,6 @@ final class ModuleManager
|
||||||
{
|
{
|
||||||
if (empty($this->active) || !$useCache) {
|
if (empty($this->active) || !$useCache) {
|
||||||
$query = new Builder($this->app->dbPool->get('select'));
|
$query = new Builder($this->app->dbPool->get('select'));
|
||||||
$query->prefix($this->app->dbPool->get('select')->prefix);
|
|
||||||
$sth = $query->select('module.module_path')
|
$sth = $query->select('module.module_path')
|
||||||
->from('module')
|
->from('module')
|
||||||
->where('module.module_active', '=', 1)
|
->where('module.module_active', '=', 1)
|
||||||
|
|
@ -310,7 +308,6 @@ final class ModuleManager
|
||||||
{
|
{
|
||||||
if (empty($this->installed) || !$useCache) {
|
if (empty($this->installed) || !$useCache) {
|
||||||
$query = new Builder($this->app->dbPool->get('select'));
|
$query = new Builder($this->app->dbPool->get('select'));
|
||||||
$query->prefix($this->app->dbPool->get('select')->prefix);
|
|
||||||
$sth = $query->select('module.module_path')
|
$sth = $query->select('module.module_path')
|
||||||
->from('module')
|
->from('module')
|
||||||
->execute();
|
->execute();
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ abstract class StatusAbstract
|
||||||
public static function activateInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
public static function activateInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
||||||
{
|
{
|
||||||
$query = new Builder($dbPool->get('update'));
|
$query = new Builder($dbPool->get('update'));
|
||||||
$query->prefix($dbPool->get('update')->prefix);
|
|
||||||
$query->update('module')
|
$query->update('module')
|
||||||
->sets('module.module_active', 1)
|
->sets('module.module_active', 1)
|
||||||
->where('module.module_id', '=', $info->getInternalName())
|
->where('module.module_id', '=', $info->getInternalName())
|
||||||
|
|
@ -130,7 +129,6 @@ abstract class StatusAbstract
|
||||||
public static function deactivateInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
public static function deactivateInDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
||||||
{
|
{
|
||||||
$query = new Builder($dbPool->get('update'));
|
$query = new Builder($dbPool->get('update'));
|
||||||
$query->prefix($dbPool->get('update')->prefix);
|
|
||||||
$query->update('module')
|
$query->update('module')
|
||||||
->sets('module.module_active', 0)
|
->sets('module.module_active', 0)
|
||||||
->where('module.module_id', '=', $info->getInternalName())
|
->where('module.module_id', '=', $info->getInternalName())
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ abstract class UninstallerAbstract
|
||||||
$definitions = \json_decode($content, true);
|
$definitions = \json_decode($content, true);
|
||||||
|
|
||||||
$builder = new SchemaBuilder($dbPool->get('schema'));
|
$builder = new SchemaBuilder($dbPool->get('schema'));
|
||||||
$builder->prefix($dbPool->get('schema')->prefix);
|
|
||||||
|
|
||||||
foreach ($definitions as $definition) {
|
foreach ($definitions as $definition) {
|
||||||
$builder->dropTable($definition['table'] ?? '');
|
$builder->dropTable($definition['table'] ?? '');
|
||||||
|
|
@ -96,14 +95,12 @@ abstract class UninstallerAbstract
|
||||||
public static function unregisterFromDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
public static function unregisterFromDatabase(DatabasePool $dbPool, ModuleInfo $info) : void
|
||||||
{
|
{
|
||||||
$queryLoad = new Builder($dbPool->get('delete'));
|
$queryLoad = new Builder($dbPool->get('delete'));
|
||||||
$queryLoad->prefix($dbPool->get('delete')->prefix);
|
|
||||||
$queryLoad->delete()
|
$queryLoad->delete()
|
||||||
->from('module_load')
|
->from('module_load')
|
||||||
->where('module_load_from', '=', $info->getInternalName())
|
->where('module_load_from', '=', $info->getInternalName())
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$queryModule = new Builder($dbPool->get('delete'));
|
$queryModule = new Builder($dbPool->get('delete'));
|
||||||
$queryModule->prefix($dbPool->get('delete')->prefix);
|
|
||||||
$queryModule->delete()
|
$queryModule->delete()
|
||||||
->from('module')
|
->from('module')
|
||||||
->where('module_id', '=', $info->getInternalName())
|
->where('module_id', '=', $info->getInternalName())
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
|
|
@ -38,7 +37,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
|
|
@ -48,7 +46,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
|
|
@ -58,7 +55,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
|
|
@ -68,7 +64,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
|
|
@ -78,7 +73,6 @@ $CONFIG = [
|
||||||
'login' => 'root', /* db login name */
|
'login' => 'root', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
@ -90,7 +84,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
|
|
@ -100,7 +93,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
|
|
@ -110,7 +102,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
|
|
@ -120,7 +111,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
|
|
@ -130,7 +120,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
|
|
@ -140,7 +129,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
@ -148,37 +136,31 @@ $CONFIG = [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/test.sqlite', /* db name */
|
'database' => __DIR__ . '/test.sqlite', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
@ -190,7 +172,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
|
|
@ -200,7 +181,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
|
|
@ -210,7 +190,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
|
|
@ -220,7 +199,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
|
|
@ -230,7 +208,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
|
|
@ -240,7 +217,6 @@ $CONFIG = [
|
||||||
'login' => 'postgres', /* db login name */
|
'login' => 'postgres', /* db login name */
|
||||||
'password' => 'root', /* db login password */
|
'password' => 'root', /* db login password */
|
||||||
'database' => 'oms', /* db name */
|
'database' => 'oms', /* db name */
|
||||||
'prefix' => 'oms_', /* db table prefix */
|
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals('', $this->cache->getPrefix());
|
|
||||||
self::assertEquals(CacheType::FILE, $this->cache->getType());
|
self::assertEquals(CacheType::FILE, $this->cache->getType());
|
||||||
self::assertTrue(\is_dir(__DIR__ . '/Cache'));
|
self::assertTrue(\is_dir(__DIR__ . '/Cache'));
|
||||||
self::assertTrue($this->cache->flushAll());
|
self::assertTrue($this->cache->flushAll());
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ class MemCachedTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals('', $this->cache->getPrefix());
|
|
||||||
self::assertEquals(CacheType::MEMCACHED, $this->cache->getType());
|
self::assertEquals(CacheType::MEMCACHED, $this->cache->getType());
|
||||||
self::assertTrue($this->cache->flushAll());
|
self::assertTrue($this->cache->flushAll());
|
||||||
self::assertEquals(0, $this->cache->getThreshold());
|
self::assertEquals(0, $this->cache->getThreshold());
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class NullCacheTest extends \PHPUnit\Framework\TestCase
|
||||||
$cache = new NullCache();
|
$cache = new NullCache();
|
||||||
$cache->connect([]);
|
$cache->connect([]);
|
||||||
|
|
||||||
self::assertEquals('', $cache->getPrefix());
|
|
||||||
self::assertEquals(CacheType::UNDEFINED, $cache->getType());
|
self::assertEquals(CacheType::UNDEFINED, $cache->getType());
|
||||||
self::assertTrue($cache->add(1, 1));
|
self::assertTrue($cache->add(1, 1));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ class RedisCacheTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testDefault() : void
|
public function testDefault() : void
|
||||||
{
|
{
|
||||||
self::assertEquals('', $this->cache->getPrefix());
|
|
||||||
self::assertEquals(CacheType::REDIS, $this->cache->getType());
|
self::assertEquals(CacheType::REDIS, $this->cache->getType());
|
||||||
self::assertTrue($this->cache->flushAll());
|
self::assertTrue($this->cache->flushAll());
|
||||||
self::assertEquals(0, $this->cache->getThreshold());
|
self::assertEquals(0, $this->cache->getThreshold());
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
];
|
];
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_base` (
|
'CREATE TABLE `test_base` (
|
||||||
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_base_string` varchar(254) NOT NULL,
|
`test_base_string` varchar(254) NOT NULL,
|
||||||
`test_base_int` int(11) NOT NULL,
|
`test_base_int` int(11) NOT NULL,
|
||||||
|
|
@ -97,7 +97,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_belongs_to_one` (
|
'CREATE TABLE `test_belongs_to_one` (
|
||||||
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_belongs_to_one_id`)
|
PRIMARY KEY (`test_belongs_to_one_id`)
|
||||||
|
|
@ -105,7 +105,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_owns_one` (
|
'CREATE TABLE `test_owns_one` (
|
||||||
`test_owns_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_owns_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_owns_one_string` varchar(254) NOT NULL,
|
`test_owns_one_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_owns_one_id`)
|
PRIMARY KEY (`test_owns_one_id`)
|
||||||
|
|
@ -113,7 +113,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_direct` (
|
'CREATE TABLE `test_has_many_direct` (
|
||||||
`test_has_many_direct_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_direct_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_direct_string` varchar(254) NOT NULL,
|
`test_has_many_direct_string` varchar(254) NOT NULL,
|
||||||
`test_has_many_direct_to` int(11) NOT NULL,
|
`test_has_many_direct_to` int(11) NOT NULL,
|
||||||
|
|
@ -122,7 +122,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_rel` (
|
'CREATE TABLE `test_has_many_rel` (
|
||||||
`test_has_many_rel_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_rel_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_rel_string` varchar(254) NOT NULL,
|
`test_has_many_rel_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_has_many_rel_id`)
|
PRIMARY KEY (`test_has_many_rel_id`)
|
||||||
|
|
@ -130,7 +130,7 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_rel_relations` (
|
'CREATE TABLE `test_has_many_rel_relations` (
|
||||||
`test_has_many_rel_relations_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_rel_relations_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_rel_relations_src` int(11) NOT NULL,
|
`test_has_many_rel_relations_src` int(11) NOT NULL,
|
||||||
`test_has_many_rel_relations_dest` int(11) NOT NULL,
|
`test_has_many_rel_relations_dest` int(11) NOT NULL,
|
||||||
|
|
@ -141,12 +141,12 @@ class DataMapperAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
protected function tearDown() : void
|
protected function tearDown() : void
|
||||||
{
|
{
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_base')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_base')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_belongs_to_one')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_belongs_to_one')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_owns_one')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_owns_one')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_direct')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_direct')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_rel')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_rel')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_rel_relations')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_rel_relations')->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,5 @@ class GrammarTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
$grammar = new Grammar();
|
$grammar = new Grammar();
|
||||||
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());
|
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());
|
||||||
self::assertEquals('', $grammar->getTablePrefix());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @testdox The grammar can define a default table prefix and return this value
|
|
||||||
* @group framework
|
|
||||||
*/
|
|
||||||
public function testPrefixInputOutput() : void
|
|
||||||
{
|
|
||||||
$grammar = new Grammar();
|
|
||||||
$grammar->setTablePrefix('oms_');
|
|
||||||
self::assertEquals('oms_', $grammar->getTablePrefix());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,17 +31,5 @@ class GrammarTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
$grammar = new Grammar();
|
$grammar = new Grammar();
|
||||||
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());
|
self::assertEquals('Y-m-d H:i:s', $grammar->getDateFormat());
|
||||||
self::assertEquals('', $grammar->getTablePrefix());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @testdox The grammar can define a default table prefix and return this value
|
|
||||||
* @group framework
|
|
||||||
*/
|
|
||||||
public function testPrefixInputOutput() : void
|
|
||||||
{
|
|
||||||
$grammar = new Grammar();
|
|
||||||
$grammar->setTablePrefix('oms_');
|
|
||||||
self::assertEquals('oms_', $grammar->getTablePrefix());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,12 @@ class MysqlGrammarTest extends \PHPUnit\Framework\TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = new SchemaBuilder($this->con);
|
$table = new SchemaBuilder($this->con);
|
||||||
$tables = $table->prefix($this->con->prefix)->selectTables()->execute()->fetchAll(\PDO::FETCH_COLUMN);
|
$tables = $table->selectTables()->execute()->fetchAll(\PDO::FETCH_COLUMN);
|
||||||
self::assertContains($this->con->prefix . 'test', $tables);
|
self::assertContains('test', $tables);
|
||||||
self::assertContains($this->con->prefix . 'test_foreign', $tables);
|
self::assertContains('test_foreign', $tables);
|
||||||
|
|
||||||
$field = new SchemaBuilder($this->con);
|
$field = new SchemaBuilder($this->con);
|
||||||
$fields = $field->prefix($this->con->prefix)->selectFields('test')->execute()->fetchAll();
|
$fields = $field->selectFields('test')->execute()->fetchAll();
|
||||||
|
|
||||||
foreach ($definitions['test']['fields'] as $key => $field) {
|
foreach ($definitions['test']['fields'] as $key => $field) {
|
||||||
self::assertTrue(
|
self::assertTrue(
|
||||||
|
|
@ -81,14 +81,14 @@ class MysqlGrammarTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testDelete() : void
|
public function testDelete() : void
|
||||||
{
|
{
|
||||||
$table = new SchemaBuilder($this->con);
|
$table = new SchemaBuilder($this->con);
|
||||||
$tables = $table->prefix($this->con->prefix)->selectTables()->execute()->fetchAll(\PDO::FETCH_COLUMN);
|
$tables = $table->selectTables()->execute()->fetchAll(\PDO::FETCH_COLUMN);
|
||||||
|
|
||||||
$delete = new SchemaBuilder($this->con);
|
$delete = new SchemaBuilder($this->con);
|
||||||
$delete->prefix($this->con->prefix)->dropTable('test')->execute();
|
$delete->dropTable('test')->execute();
|
||||||
$delete->prefix($this->con->prefix)->dropTable('test_foreign')->execute();
|
$delete->dropTable('test_foreign')->execute();
|
||||||
|
|
||||||
$tables = $table->prefix($this->con->prefix)->selectTables()->execute()->fetchAll();
|
$tables = $table->selectTables()->execute()->fetchAll();
|
||||||
self::assertNotContains($this->con->prefix . 'test', $tables);
|
self::assertNotContains('test', $tables);
|
||||||
self::assertNotContains($this->con->prefix . 'test_foreign', $tables);
|
self::assertNotContains('test_foreign', $tables);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class SchemaMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
protected function setUp() : void
|
protected function setUp() : void
|
||||||
{
|
{
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_base` (
|
'CREATE TABLE `test_base` (
|
||||||
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_base_string` varchar(254) NOT NULL,
|
`test_base_string` varchar(254) NOT NULL,
|
||||||
`test_base_int` int(11) NOT NULL,
|
`test_base_int` int(11) NOT NULL,
|
||||||
|
|
@ -43,7 +43,7 @@ class SchemaMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_belongs_to_one` (
|
'CREATE TABLE `test_belongs_to_one` (
|
||||||
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_belongs_to_one_id`)
|
PRIMARY KEY (`test_belongs_to_one_id`)
|
||||||
|
|
@ -53,8 +53,8 @@ class SchemaMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
protected function tearDown() : void
|
protected function tearDown() : void
|
||||||
{
|
{
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_base')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_base')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_belongs_to_one')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_belongs_to_one')->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,8 +66,8 @@ class SchemaMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
$schema = new SchemaMapper($GLOBALS['dbpool']->get());
|
$schema = new SchemaMapper($GLOBALS['dbpool']->get());
|
||||||
|
|
||||||
self::assertTrue(\in_array('oms_test_base', $schema->getTables()));
|
self::assertTrue(\in_array('test_base', $schema->getTables()));
|
||||||
self::assertTrue(\in_array('oms_test_belongs_to_one', $schema->getTables()));
|
self::assertTrue(\in_array('test_belongs_to_one', $schema->getTables()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -81,7 +81,7 @@ class SchemaMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
self::assertEquals(
|
self::assertEquals(
|
||||||
12,
|
12,
|
||||||
\count($schema->getFields('oms_test_base'))
|
\count($schema->getFields('test_base'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
private function dbSetup() : void
|
private function dbSetup() : void
|
||||||
{
|
{
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_base` (
|
'CREATE TABLE `test_base` (
|
||||||
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_base_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_base_string` varchar(254) NOT NULL,
|
`test_base_string` varchar(254) NOT NULL,
|
||||||
`test_base_int` int(11) NOT NULL,
|
`test_base_int` int(11) NOT NULL,
|
||||||
|
|
@ -231,7 +231,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_belongs_to_one` (
|
'CREATE TABLE `test_belongs_to_one` (
|
||||||
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_belongs_to_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
`test_belongs_to_one_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_belongs_to_one_id`)
|
PRIMARY KEY (`test_belongs_to_one_id`)
|
||||||
|
|
@ -239,7 +239,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_owns_one` (
|
'CREATE TABLE `test_owns_one` (
|
||||||
`test_owns_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_owns_one_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_owns_one_string` varchar(254) NOT NULL,
|
`test_owns_one_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_owns_one_id`)
|
PRIMARY KEY (`test_owns_one_id`)
|
||||||
|
|
@ -247,7 +247,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_direct` (
|
'CREATE TABLE `test_has_many_direct` (
|
||||||
`test_has_many_direct_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_direct_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_direct_string` varchar(254) NOT NULL,
|
`test_has_many_direct_string` varchar(254) NOT NULL,
|
||||||
`test_has_many_direct_to` int(11) NOT NULL,
|
`test_has_many_direct_to` int(11) NOT NULL,
|
||||||
|
|
@ -256,7 +256,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_rel` (
|
'CREATE TABLE `test_has_many_rel` (
|
||||||
`test_has_many_rel_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_rel_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_rel_string` varchar(254) NOT NULL,
|
`test_has_many_rel_string` varchar(254) NOT NULL,
|
||||||
PRIMARY KEY (`test_has_many_rel_id`)
|
PRIMARY KEY (`test_has_many_rel_id`)
|
||||||
|
|
@ -264,7 +264,7 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
)->execute();
|
)->execute();
|
||||||
|
|
||||||
$GLOBALS['dbpool']->get()->con->prepare(
|
$GLOBALS['dbpool']->get()->con->prepare(
|
||||||
'CREATE TABLE `oms_test_has_many_rel_relations` (
|
'CREATE TABLE `test_has_many_rel_relations` (
|
||||||
`test_has_many_rel_relations_id` int(11) NOT NULL AUTO_INCREMENT,
|
`test_has_many_rel_relations_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`test_has_many_rel_relations_src` int(11) NOT NULL,
|
`test_has_many_rel_relations_src` int(11) NOT NULL,
|
||||||
`test_has_many_rel_relations_dest` int(11) NOT NULL,
|
`test_has_many_rel_relations_dest` int(11) NOT NULL,
|
||||||
|
|
@ -275,12 +275,12 @@ class ModuleAbstractTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
private function dbTeardown() : void
|
private function dbTeardown() : void
|
||||||
{
|
{
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_base')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_base')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_belongs_to_one')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_belongs_to_one')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_owns_one')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_owns_one')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_direct')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_direct')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_rel')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_rel')->execute();
|
||||||
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE oms_test_has_many_rel_relations')->execute();
|
$GLOBALS['dbpool']->get()->con->prepare('DROP TABLE test_has_many_rel_relations')->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user