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:
@@ -80,6 +80,7 @@ final class CoreLibsACLLoginTest extends TestCase
|
|||||||
'log_file_id' => 'CoreLibs-ACL-Login-Test',
|
'log_file_id' => 'CoreLibs-ACL-Login-Test',
|
||||||
]);
|
]);
|
||||||
// test database we need to connect do, if not possible this test is skipped
|
// test database we need to connect do, if not possible this test is skipped
|
||||||
|
try {
|
||||||
self::$db = new \CoreLibs\DB\IO(
|
self::$db = new \CoreLibs\DB\IO(
|
||||||
[
|
[
|
||||||
'db_name' => $db_name,
|
'db_name' => $db_name,
|
||||||
@@ -95,6 +96,11 @@ final class CoreLibsACLLoginTest extends TestCase
|
|||||||
],
|
],
|
||||||
self::$log
|
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
|
// ALWAYS drop DB and RECREATE DB
|
||||||
// dropdb -U corelibs_acl_login_test -h localhost corelibs_acl_login_test
|
// 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;
|
// 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) {
|
if ($handle === false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$status = curl_exec($handle);
|
||||||
|
if ($status === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->url_basic = $url;
|
$this->url_basic = $url;
|
||||||
// print "Open: $url\n";
|
// print "Open: $url\n";
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user