Remove unused code and classes. Clean up code to remove all named constant from them and throw deprecation alerts if used. Add basic psalm setup in root folder and remove from www folder
65 lines
953 B
PHP
65 lines
953 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\Debug\Logging $log
|
|
*/
|
|
public function __construct(
|
|
\CoreLibs\Debug\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__
|