github special case check

This commit is contained in:
Dennis Eichhorn 2022-09-30 19:17:28 +02:00
parent 6459e61a63
commit 9d7d48f424
3 changed files with 56 additions and 4 deletions

View File

@ -19,10 +19,50 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
use phpOMS\DataStorage\Session\HttpSession;
use phpOMS\Log\FileLogger;
var_dump($_SERVER);
var_dump(php_uname());
var_dump(getenv());
var_dump(ini_get_all());
$IS_GITHUB = false;
$temp = \array_keys($_SERVER);
foreach ($temp as $key) {
if (\stripos(\strtolower($key), 'github') !== false) {
$IS_GITHUB = true;
break;
}
}
if (!$IS_GITHUB) {
foreach ($_SERVER as $value) {
if (\stripos(\strtolower($value), 'github') !== false) {
$IS_GITHUB = true;
break;
}
}
}
$temp = \array_keys(\getenv());
if (!$IS_GITHUB) {
foreach ($temp as $key) {
if (\stripos(\strtolower($key), 'github') !== false) {
$IS_GITHUB = true;
break;
}
}
}
$temp = \array_values(\getenv());
if (!$IS_GITHUB) {
foreach ($temp as $value) {
if (\stripos(\strtolower($value), 'github') !== false) {
$IS_GITHUB = true;
break;
}
}
}
$GLOBALS['is_github'] = $IS_GITHUB;
// Initialize file logger with correct path
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');

View File

@ -39,6 +39,12 @@ final class ImapTest extends \PHPUnit\Framework\TestCase
);
}
if ($GLOBALS['is_github']) {
$this->markTestSkipped(
'Imap is not working in github actions'
);
}
$this->handler = new Imap('testuser', 'testuser', 143);
$this->handler->host = '127.0.0.1';
$this->handler->flags = '/imap/notls/norsh/novalidate-cert';

View File

@ -39,6 +39,12 @@ final class Pop3Test extends \PHPUnit\Framework\TestCase
);
}
if ($GLOBALS['is_github']) {
$this->markTestSkipped(
'Imap is not working in github actions'
);
}
$this->handler = new Pop3('testuser', 'testuser', 110);
$this->handler->host = '127.0.0.1';
$this->handler->flags = '/pop3/notls';