diff --git a/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php b/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php index 625d005..4200f98 100644 --- a/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php +++ b/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php @@ -12,6 +12,8 @@ use PHPUnit\Framework\TestCase; */ final class CoreLibsAAASetupDataTest extends TestCase { + public const TIME_ZONE = 'Asia/Tokyo'; + /** * Covers nothing * @@ -34,6 +36,9 @@ final class CoreLibsAAASetupDataTest extends TestCase BASE, 'BASE Path set check' ); + + // if time zone is not set, errors can happen + ini_set('date.timezone', self::TIME_ZONE); } } diff --git a/test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh b/test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh index 34b37a7..4cb4115 100755 --- a/test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh +++ b/test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh @@ -24,25 +24,25 @@ if [ -z "${db_user}" ] || [ -z "${db_name}" ] || [ -z "${db_host}" ]; then exit 2; fi; # drop database, on error exit with 3 -dropdb -U ${db_user} -h ${db_host} ${db_name} 2>&1; -if [ $? -ne 0 ]; then +dropdb -U "${db_user}" -h "${db_host}" "${db_name}" 2>&1; +if ! $?; then echo 3; exit 3; fi; # create database, on error exit with 4 -createdb -U ${db_user} -O ${db_user} -h ${db_host} -E utf8 ${db_name} 2>&1; -if [ $? -ne 0 ]; then +createdb -U "${db_user}" -O "${db_user}" -h "${db_host}" -E utf8 "${db_name}" 2>&1; +if ! $?; then echo 4; exit 4; fi; # if error 5 thrown, test with enabled below -if [ ! -z "${5}" ]; then - psql -U ${db_user} -h ${db_host} -f ${load_sql} ${db_name}; +if [ -n "${5}" ]; then + psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}"; else # load data (redirect ALL error to null), on error exit with 5 - psql -U ${db_user} -h ${db_host} -f ${load_sql} ${db_name} 2>&1 1>/dev/null 2>/dev/null; + psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}" 2>&1 1>/dev/null 2>/dev/null; fi; -if [ $? -ne 0 ]; then +if ! $?; then echo 5; exit 5; fi; diff --git a/test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php b/test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php index fa54787..e32baae 100644 --- a/test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php +++ b/test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php @@ -1,4 +1,4 @@ -assertMatchesRegularExpression( @@ -522,7 +524,7 @@ final class CoreLibsDebugSupportTest extends TestCase $this->assertEquals( $expected, $compare, - 'assert expected 10' + 'assert expected 10: ' . print_r($compare, true) ); break; case 11: @@ -545,7 +547,7 @@ final class CoreLibsDebugSupportTest extends TestCase $this->assertEquals( $expected, $compare, - 'assert expected 11' + 'assert expected 11: ' . print_r($compare, true) ); break; case 12: @@ -565,7 +567,7 @@ final class CoreLibsDebugSupportTest extends TestCase $this->assertEquals( $expected, $compare, - 'assert expected 12' + 'assert expected 12: ' . print_r($compare, true) ); break; default: @@ -589,7 +591,7 @@ final class CoreLibsDebugSupportTest extends TestCase if ($call_stack < 8) { $this->assertFalse(true, 'getCallStack too low: 8'); } else { - $this->assertTrue(true, 'getCallSteck ok'); + $this->assertTrue(true, 'getCallStack ok'); } // just test top entry $first = array_shift($call_stack);