old Debug\Logging is in Debug\LoggingLegacy and Debug\Logging extends Logging\Logging Logging\Logging is a new class with most of the functionality except there is no more print/outout to screen, but we use the default log levels (RFC5424) The plan is to be a frontend between the old type class and Monolog\Monolog Updated all other classes to use new class interface
65 lines
957 B
PHP
65 lines
957 B
PHP
<?php
|
|
|
|
/*
|
|
* TEST sets for DB::IO
|
|
*/
|
|
|
|
namespace Test\DB;
|
|
|
|
use CoreLibs\DB\IO;
|
|
|
|
class TestDB
|
|
{
|
|
/** @var IO */
|
|
private $db;
|
|
/** @var array<mixed> */
|
|
private $config;
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @param \CoreLibs\Logging\Logging $log
|
|
*/
|
|
public function __construct(
|
|
\CoreLibs\Logging\Logging $log
|
|
) {
|
|
$this->config = [
|
|
'db_name' => $_ENV['DB_NAME_TEST'] ?? '',
|
|
'db_user' => $_ENV['DB_USER_TEST'] ?? '',
|
|
'db_pass' => $_ENV['DB_PASS_TEST'] ?? '',
|
|
'db_host' => $_ENV['DB_HOST_TEST'] ?? '',
|
|
'db_port' => 5432,
|
|
'db_schema' => 'public',
|
|
'db_type' => 'pgsql',
|
|
'db_encoding' => '',
|
|
'db_ssl' => 'allow'
|
|
];
|
|
$this->db = new IO(
|
|
$this->config,
|
|
$log
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return void
|
|
*/
|
|
private function testDBa(): void
|
|
{
|
|
$this->db->dbInfo();
|
|
}
|
|
|
|
/**
|
|
* Undocumented function
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testRunDB(): void
|
|
{
|
|
$this->testDBa();
|
|
}
|
|
}
|
|
|
|
// __ENB__
|