diff --git a/4dev/tests/Get/CoreLibsGetSystemTest.php b/4dev/tests/Get/CoreLibsGetSystemTest.php index eef6aec9..221553cc 100644 --- a/4dev/tests/Get/CoreLibsGetSystemTest.php +++ b/4dev/tests/Get/CoreLibsGetSystemTest.php @@ -67,17 +67,17 @@ final class CoreLibsGetSystemTest extends TestCase 'original set' => [ 0 => null, 1 => 'NOHOST', - 2 => 'NOPORT', + 2 => 0, ], 'override set no port' => [ 0 => 'foo.org', 1 => 'foo.org', - 2 => '80' + 2 => 80 ], 'override set with port' => [ 0 => 'foo.org:443', 1 => 'foo.org', - 2 => '443' + 2 => 443 ] ]; } @@ -138,10 +138,10 @@ final class CoreLibsGetSystemTest extends TestCase * * @param string|null $input * @param string $expected_host - * @param string $expected_port + * @param int $expected_port * @return void */ - public function testGetHostNanme(?string $input, string $expected_host, string $expected_port): void + public function testGetHostNanme(?string $input, string $expected_host, int $expected_port): void { // print "HOSTNAME: " . $_SERVER['HTTP_HOST'] . "
"; // print "SERVER: " . print_r($_SERVER, true) . "\n"; diff --git a/4dev/tests/Logging/CoreLibsLoggingLoggingTest.php b/4dev/tests/Logging/CoreLibsLoggingLoggingTest.php index 2b421802..fd75ebdd 100644 --- a/4dev/tests/Logging/CoreLibsLoggingLoggingTest.php +++ b/4dev/tests/Logging/CoreLibsLoggingLoggingTest.php @@ -19,10 +19,10 @@ final class CoreLibsLoggingLoggingTest extends TestCase { private const LOG_FOLDER = __DIR__ . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR; private const REGEX_BASE = "\[[\d\-\s\.:]+\]\s{1}" // date - . "\[[\w\.]+:\w+\]\s{1}" // host:port - . "\[[\w+\.\/]+\]\s{1}" // folder/file + . "\[[\w\.]+(:\d+)?\]\s{1}" // host:port + . "\[[\w+\.\/]+:\d+\]\s{1}" // folder/file . "\[\w+\]\s{1}" // run id - . "{[\w\\\\]+}\s{1}"; // class + . "{[\w\\\\]+(::\w+)?}\s{1}"; // class /** * test set for options BASIC diff --git a/www/lib/CoreLibs/DB/IO.php b/www/lib/CoreLibs/DB/IO.php index a4ed7c8a..29b0b19b 100644 --- a/www/lib/CoreLibs/DB/IO.php +++ b/www/lib/CoreLibs/DB/IO.php @@ -1373,7 +1373,10 @@ class IO */ public function dbClose(): void { - if ($this->dbh) { + if ( + !empty($this->dbh) && + $this->dbh instanceof \PgSql\Connection + ) { // reset any client encodings set $this->dbResetEncoding(); // calls db close @@ -3405,6 +3408,9 @@ class IO */ public function dbGetInsertPKName(): string { + if (!isset($this->insert_id_pk_name)) { + return ''; + } return (string)$this->insert_id_pk_name; } @@ -3513,6 +3519,9 @@ class IO */ public function dbGetNumFields(): ?int { + if (!isset($this->num_fields)) { + return null; + } return $this->num_fields; }