-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Test Database * WIP: Fail artifact * WIP: Zip artifact * WIP: Get database driver * WIP: Get driver name * WIP: Verbose output * WIP: Get database driver * WIP: Get driver * WIP: grup testing * WIP: Regisrar database config * WIP: codeigniter database test * WIP: Fix missing primary key * WIP: Fix missing primary key * WIP: Fix missing primary key * WIP: Remove default value field json * WIP: Overwrite default connection * WIP: second connection * WIP: Database second connection * WIP: Remove test Count Pagination Grouping * WIP: teardown drop table * WIP: Fix Sqlsrv drop table * WIP: Remove test for postgre, sqlsrv for now
- Loading branch information
1 parent
d9d591b
commit 06430ca
Showing
9 changed files
with
239 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of CodeIgniter 4 framework. | ||
* | ||
* (c) CodeIgniter Foundation <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fluent\Orm\Tests\Config; | ||
|
||
/** | ||
* Class Registrar | ||
* | ||
* Provides a basic registrar class for testing BaseConfig registration functions. | ||
*/ | ||
class Registrar | ||
{ | ||
/** | ||
* DB config array for testing purposes. | ||
* | ||
* @var array | ||
*/ | ||
protected static $dbConfig = [ | ||
'MySQLi' => [ | ||
'DSN' => '', | ||
'hostname' => '127.0.0.1', | ||
'username' => 'root', | ||
'password' => '', | ||
'database' => 'test', | ||
'DBDriver' => 'MySQLi', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
'port' => 3306, | ||
], | ||
'Postgre' => [ | ||
'DSN' => '', | ||
'hostname' => 'localhost', | ||
'username' => 'postgres', | ||
'password' => 'postgres', | ||
'database' => 'test', | ||
'DBDriver' => 'Postgre', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
'port' => 5432, | ||
], | ||
'SQLite3' => [ | ||
'DSN' => '', | ||
'hostname' => '127.0.0.1', | ||
'username' => '', | ||
'password' => '', | ||
'database' => ':memory:', | ||
'DBDriver' => 'SQLite3', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
'port' => 3306, | ||
], | ||
'second_connection' => [ | ||
'DSN' => '', | ||
'hostname' => '127.0.0.1', | ||
'username' => '', | ||
'password' => '', | ||
'database' => ':memory:', | ||
'DBDriver' => 'SQLite3', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
'port' => 3306, | ||
], | ||
'SQLSRV' => [ | ||
'DSN' => '', | ||
'hostname' => 'localhost', | ||
'username' => 'sa', | ||
'password' => '1Secure*Password1', | ||
'database' => 'test', | ||
'DBDriver' => 'SQLSRV', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
'port' => 1433, | ||
], | ||
'OCI8' => [ | ||
'DSN' => 'localhost:1521/XEPDB1', | ||
'hostname' => '', | ||
'username' => 'ORACLE', | ||
'password' => 'ORACLE', | ||
'database' => '', | ||
'DBDriver' => 'OCI8', | ||
'DBPrefix' => '', | ||
'pConnect' => false, | ||
'DBDebug' => (ENVIRONMENT !== 'production'), | ||
'charset' => 'utf8', | ||
'DBCollat' => 'utf8_general_ci', | ||
'swapPre' => '', | ||
'encrypt' => false, | ||
'compress' => false, | ||
'strictOn' => false, | ||
'failover' => [], | ||
], | ||
]; | ||
|
||
/** | ||
* Override database config | ||
* | ||
* @return array | ||
*/ | ||
public static function Database() | ||
{ | ||
$config = []; | ||
|
||
// Under GitHub Actions, we can set an ENV var named 'DB' | ||
// so that we can test against multiple databases. | ||
if ($group = getenv('DB')) { | ||
if (! empty(self::$dbConfig[$group])) { | ||
$config['tests'] = self::$dbConfig[$group]; | ||
} | ||
} | ||
|
||
$config['second_connection'] = self::$dbConfig['second_connection']; | ||
|
||
return $config; | ||
} | ||
|
||
/** | ||
* Demonstrates Publisher security. | ||
* | ||
* @see PublisherRestrictionsTest::testRegistrarsNotAllowed() | ||
* | ||
* @return array | ||
*/ | ||
public static function Publisher() | ||
{ | ||
return [ | ||
'restrictions' => [SUPPORTPATH => '*'], | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.