diff --git a/config/testing.php b/config/tests.php similarity index 100% rename from config/testing.php rename to config/tests.php diff --git a/core/Console/Database/Create.php b/core/Console/Database/Create.php index 67356607..2bbddd7f 100644 --- a/core/Console/Database/Create.php +++ b/core/Console/Database/Create.php @@ -37,7 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (is_null($databases) || empty($databases)) { $db = config('app.env') !== 'test' ? config('database.name') : - config('database.name') . config('testing.database.suffix') ; + config('database.name') . config('tests.database.suffix') ; $databases = [$db]; } diff --git a/core/Console/Database/Delete.php b/core/Console/Database/Delete.php index 991b9b8f..e79849db 100644 --- a/core/Console/Database/Delete.php +++ b/core/Console/Database/Delete.php @@ -37,7 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (is_null($databases) || empty($databases)) { $db = config('app.env') !== 'test' ? config('database.name') : - config('database.name') . config('testing.database.suffix') ; + config('database.name') . config('tests.database.suffix') ; $databases = [$db]; } diff --git a/core/Console/Tests.php b/core/Console/Tests.php index 6da747bf..eb7774d4 100644 --- a/core/Console/Tests.php +++ b/core/Console/Tests.php @@ -34,7 +34,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->getApplication()->find('migrations:reset')->run(new ArrayInput([]), $output); $this->getApplication()->find('db:seed')->run(new ArrayInput([]), $output); - $server = new Process(['php', '-S', config('testing.host') . ':' . config('testing.port')]); + $server = new Process(['php', '-S', config('tests.host') . ':' . config('tests.port')]); $server->setTimeout(null); $server->start(); diff --git a/core/Database/Connection/Connection.php b/core/Database/Connection/Connection.php index 8237d666..922d7a9c 100644 --- a/core/Database/Connection/Connection.php +++ b/core/Database/Connection/Connection.php @@ -22,7 +22,7 @@ class Connection private function __construct() { - $driver = config('app.env') === 'test' ? config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? config('tests.database.driver') : config('database.driver'); $this->db = $driver === 'mysql' ? new MySQLConnection() : new SQLiteConnection(); } diff --git a/core/Database/Connection/MySQLConnection.php b/core/Database/Connection/MySQLConnection.php index 15c91be7..56ece4e5 100644 --- a/core/Database/Connection/MySQLConnection.php +++ b/core/Database/Connection/MySQLConnection.php @@ -102,7 +102,7 @@ public function deleteSchema(string $name) private function getDB() { return config('app.env') === 'test' - ? config('testing.database.suffix') + ? config('tests.database.suffix') : config('database.name') . '.db'; } } diff --git a/core/Database/Connection/SQLiteConnection.php b/core/Database/Connection/SQLiteConnection.php index cf3ac473..be1c3c98 100644 --- a/core/Database/Connection/SQLiteConnection.php +++ b/core/Database/Connection/SQLiteConnection.php @@ -40,7 +40,7 @@ public function __construct() private function getDB() { if (config('app.env') === 'test') { - return config('storage.sqlite') . config('database.name') . config('testing.database.suffix') . '.db'; + return config('storage.sqlite') . config('database.name') . config('tests.database.suffix') . '.db'; } return config('database.sqlite.memory') ? ':memory:' diff --git a/core/Database/Migration.php b/core/Database/Migration.php index f09ff051..b52fa4ba 100644 --- a/core/Database/Migration.php +++ b/core/Database/Migration.php @@ -63,7 +63,7 @@ public static function dropForeign(string $table, string $name) public static function disableForeignKeyCheck() { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); $query = $driver === 'mysql' ? 'SET foreign_key_checks = 0' : 'PRAGMA foreign_keys = OFF'; QueryBuilder::setQuery($query)->execute(); @@ -71,7 +71,7 @@ public static function disableForeignKeyCheck() public static function enableForeignKeyCheck() { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); $query = $driver === 'mysql' ? 'SET foreign_key_checks = 1' : 'PRAGMA foreign_keys = ON'; QueryBuilder::setQuery($query)->execute(); @@ -297,7 +297,7 @@ public function primaryKey(): self public function addPrimaryKey(string $column, bool $auto_increment = true): self { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); $pk = $driver === 'mysql' ? $this->addBigInt($column) : $this->addInteger($column); $pk->primaryKey(); diff --git a/core/Database/QueryBuilder.php b/core/Database/QueryBuilder.php index 7c97847d..dff980b9 100644 --- a/core/Database/QueryBuilder.php +++ b/core/Database/QueryBuilder.php @@ -23,11 +23,11 @@ class QueryBuilder protected static function setTable(string $name) { if (config('app.env') === 'test') { - if (config('testing.database.driver') === 'sqlite') { + if (config('tests.database.driver') === 'sqlite') { return config('database.table_prefix') . $name; } - return config('database.name') .config('testing.database.suffix') . '.' . config('database.table_prefix') . $name; + return config('database.name') .config('tests.database.suffix') . '.' . config('database.table_prefix') . $name; } if (config('database.driver') === 'sqlite') { @@ -200,7 +200,7 @@ public function column(string $name, string $type): self public function autoIncrement(): self { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); self::$query = rtrim(self::$query, ', '); self::$query .= $driver === 'mysql' ? ' AUTO_INCREMENT, ' : ' AUTOINCREMENT, '; @@ -274,7 +274,7 @@ public function onDeleteSetNull(): self public function addCurrentTimestamp(string $created_at = 'created_at', string $updated_at = 'updated_at') { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); if ($driver === 'mysql') { self::$query .= " {$created_at} TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, {$updated_at} TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, "; @@ -287,7 +287,7 @@ public function addCurrentTimestamp(string $created_at = 'created_at', string $u public function migrate() { - $driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); self::$query = rtrim(self::$query, ', ') . ')'; diff --git a/core/Support/Metrics.php b/core/Support/Metrics.php index ad903d58..35b1693e 100644 --- a/core/Support/Metrics.php +++ b/core/Support/Metrics.php @@ -55,7 +55,7 @@ class Metrics public function __construct(public string $table, private string $driver = '') { - $this->driver = config('app.env') === 'test' ? $driver = config('testing.database.driver') : config('database.driver'); + $this->driver = config('app.env') === 'test' ? $driver = config('tests.database.driver') : config('database.driver'); } /** diff --git a/core/Testing/ApplicationTestCase.php b/core/Testing/ApplicationTestCase.php index 32ce7276..35a3e58e 100644 --- a/core/Testing/ApplicationTestCase.php +++ b/core/Testing/ApplicationTestCase.php @@ -47,7 +47,7 @@ protected function tearDown(): void protected function url(string $uri) { - return config('testing.host') . ':' . config('testing.port') . '/' . ltrim($uri, '/'); + return config('tests.host') . ':' . config('tests.port') . '/' . ltrim($uri, '/'); } protected function getBody()