diff --git a/www/lib/Test/DB/TestDB.php b/www/lib/Test/DB/TestDB.php new file mode 100644 index 00000000..32ee7615 --- /dev/null +++ b/www/lib/Test/DB/TestDB.php @@ -0,0 +1,58 @@ + */ + private $config; + + /** + * Undocumented function + */ + public function __construct() + { + $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); + } + + /** + * Undocumented function + * + * @return void + */ + private function testDBa(): void + { + $this->db->dbInfo(); + } + + /** + * Undocumented function + * + * @return void + */ + public function testRunDB(): void + { + $this->testDBa(); + } +} + +// __ENB__ diff --git a/www/lib/Test/Test.php b/www/lib/Test/Test.php index 8b74b393..0848202d 100644 --- a/www/lib/Test/Test.php +++ b/www/lib/Test/Test.php @@ -8,8 +8,12 @@ declare(strict_types=1); namespace Test; +use Test\DB; + class Test { + /** @var DB\TestDB */ + private $test_db; public function __construct() { @@ -17,6 +21,9 @@ class Test $this->testPrivate(); $this->testProtected(); $this->testPublic(); + + // call intern + $this->test_db = new DB\TestDB(); } public function __destruct() @@ -56,6 +63,16 @@ class Test $string = 'TEST Public'; return $string; } + + /** + * Undocumented function + * + * @return void + */ + public function testClasses(): void + { + $this->test_db->testRunDB(); + } } // __END__