Tests updates: DB try catch for the ACL test, curl setup fix

curl init alone is not enought to validate a url.

for DB conneciton use try/catch to get errors and skip test
This commit is contained in:
2026-06-25 16:40:10 +09:00
parent d66fce374c
commit e3306a096f
2 changed files with 25 additions and 15 deletions
+6
View File
@@ -80,6 +80,7 @@ final class CoreLibsACLLoginTest extends TestCase
'log_file_id' => 'CoreLibs-ACL-Login-Test',
]);
// test database we need to connect do, if not possible this test is skipped
try {
self::$db = new \CoreLibs\DB\IO(
[
'db_name' => $db_name,
@@ -95,6 +96,11 @@ final class CoreLibsACLLoginTest extends TestCase
],
self::$log
);
} catch (\Exception $e) {
self::markTestSkipped(
'Cannot connect to valid Test DB for ACL\Login test: ' . $e->getMessage()
);
}
// ALWAYS drop DB and RECREATE DB
// dropdb -U corelibs_acl_login_test -h localhost corelibs_acl_login_test
// createdb -U corelibs_acl_login_test -O corelibs_acl_login_test -E utf8 corelibs_acl_login_test;
@@ -58,6 +58,10 @@ final class CoreLibsUrlRequestsCurlTest extends TestCase
if ($handle === false) {
continue;
}
$status = curl_exec($handle);
if ($status === false) {
continue;
}
$this->url_basic = $url;
// print "Open: $url\n";
break;