diff --git a/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php b/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php new file mode 100644 index 0000000..625d005 --- /dev/null +++ b/test/phpunit/AAASetupData/CoreLibsAAASetupDataTest.php @@ -0,0 +1,40 @@ +assertEquals( + str_replace('/configs', '', __DIR__) + . DIRECTORY_SEPARATOR, + BASE, + 'BASE Path set check' + ); + } +} + +// __END__ diff --git a/test/phpunit/AAASetupData/includes b/test/phpunit/AAASetupData/includes new file mode 120000 index 0000000..918e7d3 --- /dev/null +++ b/test/phpunit/AAASetupData/includes @@ -0,0 +1 @@ +../Language/includes/ \ No newline at end of file diff --git a/test/phpunit/AAASetupData/log b/test/phpunit/AAASetupData/log new file mode 120000 index 0000000..c40e9a4 --- /dev/null +++ b/test/phpunit/AAASetupData/log @@ -0,0 +1 @@ +../Debug/log/ \ No newline at end of file diff --git a/test/phpunit/CoreLibsACLLoginTest.php b/test/phpunit/ACL/CoreLibsACLLoginTest.php similarity index 100% rename from test/phpunit/CoreLibsACLLoginTest.php rename to test/phpunit/ACL/CoreLibsACLLoginTest.php diff --git a/test/phpunit/CoreLibsACLLogin_database_prepare.sh b/test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh similarity index 100% rename from test/phpunit/CoreLibsACLLogin_database_prepare.sh rename to test/phpunit/ACL/CoreLibsACLLogin_database_prepare.sh diff --git a/test/phpunit/database/CoreLibsACLLogin_database_create_data.sql b/test/phpunit/ACL/database/CoreLibsACLLogin_database_create_data.sql similarity index 100% rename from test/phpunit/database/CoreLibsACLLogin_database_create_data.sql rename to test/phpunit/ACL/database/CoreLibsACLLogin_database_create_data.sql diff --git a/test/phpunit/log/.gitignore b/test/phpunit/ACL/log/.gitignore similarity index 100% rename from test/phpunit/log/.gitignore rename to test/phpunit/ACL/log/.gitignore diff --git a/test/phpunit/CoreLibsAdminBackendTest.php b/test/phpunit/Admin/CoreLibsAdminBackendTest.php similarity index 100% rename from test/phpunit/CoreLibsAdminBackendTest.php rename to test/phpunit/Admin/CoreLibsAdminBackendTest.php diff --git a/test/phpunit/CoreLibsAdminEditPageTest.php b/test/phpunit/Admin/CoreLibsAdminEditPageTest.php similarity index 100% rename from test/phpunit/CoreLibsAdminEditPageTest.php rename to test/phpunit/Admin/CoreLibsAdminEditPageTest.php diff --git a/test/phpunit/CoreLibsCheckColorsTest.php b/test/phpunit/Check/CoreLibsCheckColorsTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckColorsTest.php rename to test/phpunit/Check/CoreLibsCheckColorsTest.php diff --git a/test/phpunit/CoreLibsCheckEmailTest.php b/test/phpunit/Check/CoreLibsCheckEmailTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckEmailTest.php rename to test/phpunit/Check/CoreLibsCheckEmailTest.php diff --git a/test/phpunit/CoreLibsCheckEncodingTest.php b/test/phpunit/Check/CoreLibsCheckEncodingTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckEncodingTest.php rename to test/phpunit/Check/CoreLibsCheckEncodingTest.php diff --git a/test/phpunit/CoreLibsCheckFileTest.php b/test/phpunit/Check/CoreLibsCheckFileTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckFileTest.php rename to test/phpunit/Check/CoreLibsCheckFileTest.php diff --git a/test/phpunit/CoreLibsCheckPasswordTest.php b/test/phpunit/Check/CoreLibsCheckPasswordTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckPasswordTest.php rename to test/phpunit/Check/CoreLibsCheckPasswordTest.php diff --git a/test/phpunit/CoreLibsCheckPhpVersionTest.php b/test/phpunit/Check/CoreLibsCheckPhpVersionTest.php similarity index 100% rename from test/phpunit/CoreLibsCheckPhpVersionTest.php rename to test/phpunit/Check/CoreLibsCheckPhpVersionTest.php diff --git a/test/phpunit/CoreLibsCombinedArrayHandlerTest.php b/test/phpunit/Combined/CoreLibsCombinedArrayHandlerTest.php similarity index 100% rename from test/phpunit/CoreLibsCombinedArrayHandlerTest.php rename to test/phpunit/Combined/CoreLibsCombinedArrayHandlerTest.php diff --git a/test/phpunit/CoreLibsCombinedDateTimeTest.php b/test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php similarity index 100% rename from test/phpunit/CoreLibsCombinedDateTimeTest.php rename to test/phpunit/Combined/CoreLibsCombinedDateTimeTest.php diff --git a/test/phpunit/CoreLibsConvertByteTest.php b/test/phpunit/Convert/CoreLibsConvertByteTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertByteTest.php rename to test/phpunit/Convert/CoreLibsConvertByteTest.php diff --git a/test/phpunit/CoreLibsConvertColorsTest.php b/test/phpunit/Convert/CoreLibsConvertColorsTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertColorsTest.php rename to test/phpunit/Convert/CoreLibsConvertColorsTest.php diff --git a/test/phpunit/CoreLibsConvertEncodingTest.php b/test/phpunit/Convert/CoreLibsConvertEncodingTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertEncodingTest.php rename to test/phpunit/Convert/CoreLibsConvertEncodingTest.php diff --git a/test/phpunit/CoreLibsConvertHtmlTest.php b/test/phpunit/Convert/CoreLibsConvertHtmlTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertHtmlTest.php rename to test/phpunit/Convert/CoreLibsConvertHtmlTest.php diff --git a/test/phpunit/CoreLibsConvertJsonTest.php b/test/phpunit/Convert/CoreLibsConvertJsonTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertJsonTest.php rename to test/phpunit/Convert/CoreLibsConvertJsonTest.php diff --git a/test/phpunit/CoreLibsConvertMathTest.php b/test/phpunit/Convert/CoreLibsConvertMathTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertMathTest.php rename to test/phpunit/Convert/CoreLibsConvertMathTest.php diff --git a/test/phpunit/CoreLibsConvertMimeAppNameTest.php b/test/phpunit/Convert/CoreLibsConvertMimeAppNameTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertMimeAppNameTest.php rename to test/phpunit/Convert/CoreLibsConvertMimeAppNameTest.php diff --git a/test/phpunit/CoreLibsConvertMimeEncodeTest.php b/test/phpunit/Convert/CoreLibsConvertMimeEncodeTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertMimeEncodeTest.php rename to test/phpunit/Convert/CoreLibsConvertMimeEncodeTest.php diff --git a/test/phpunit/CoreLibsConvertSetVarTypeNullTest.php b/test/phpunit/Convert/CoreLibsConvertSetVarTypeNullTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertSetVarTypeNullTest.php rename to test/phpunit/Convert/CoreLibsConvertSetVarTypeNullTest.php diff --git a/test/phpunit/CoreLibsConvertSetVarTypeTest.php b/test/phpunit/Convert/CoreLibsConvertSetVarTypeTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertSetVarTypeTest.php rename to test/phpunit/Convert/CoreLibsConvertSetVarTypeTest.php diff --git a/test/phpunit/CoreLibsConvertStringsTest.php b/test/phpunit/Convert/CoreLibsConvertStringsTest.php similarity index 100% rename from test/phpunit/CoreLibsConvertStringsTest.php rename to test/phpunit/Convert/CoreLibsConvertStringsTest.php diff --git a/test/phpunit/CoreLibsCreateEmailTest.php b/test/phpunit/Create/CoreLibsCreateEmailTest.php similarity index 100% rename from test/phpunit/CoreLibsCreateEmailTest.php rename to test/phpunit/Create/CoreLibsCreateEmailTest.php diff --git a/test/phpunit/CoreLibsCreateHashTest.php b/test/phpunit/Create/CoreLibsCreateHashTest.php similarity index 100% rename from test/phpunit/CoreLibsCreateHashTest.php rename to test/phpunit/Create/CoreLibsCreateHashTest.php diff --git a/test/phpunit/CoreLibsCreateRandomKeyTest.php b/test/phpunit/Create/CoreLibsCreateRandomKeyTest.php similarity index 100% rename from test/phpunit/CoreLibsCreateRandomKeyTest.php rename to test/phpunit/Create/CoreLibsCreateRandomKeyTest.php diff --git a/test/phpunit/CoreLibsCreateSessionTest.php b/test/phpunit/Create/CoreLibsCreateSessionTest.php similarity index 100% rename from test/phpunit/CoreLibsCreateSessionTest.php rename to test/phpunit/Create/CoreLibsCreateSessionTest.php diff --git a/test/phpunit/CoreLibsCreateUidsTest.php b/test/phpunit/Create/CoreLibsCreateUidsTest.php similarity index 100% rename from test/phpunit/CoreLibsCreateUidsTest.php rename to test/phpunit/Create/CoreLibsCreateUidsTest.php diff --git a/test/phpunit/CoreLibsDBExtendedArrayIOTest.php b/test/phpunit/DB/CoreLibsDBExtendedArrayIOTest.php similarity index 100% rename from test/phpunit/CoreLibsDBExtendedArrayIOTest.php rename to test/phpunit/DB/CoreLibsDBExtendedArrayIOTest.php diff --git a/test/phpunit/CoreLibsDBIOTest.php b/test/phpunit/DB/CoreLibsDBIOTest.php similarity index 100% rename from test/phpunit/CoreLibsDBIOTest.php rename to test/phpunit/DB/CoreLibsDBIOTest.php diff --git a/test/phpunit/CoreLibsDebugFileWriterTest.php b/test/phpunit/Debug/CoreLibsDebugFileWriterTest.php similarity index 100% rename from test/phpunit/CoreLibsDebugFileWriterTest.php rename to test/phpunit/Debug/CoreLibsDebugFileWriterTest.php diff --git a/test/phpunit/CoreLibsDebugLoggingTest.php b/test/phpunit/Debug/CoreLibsDebugLoggingTest.php similarity index 94% rename from test/phpunit/CoreLibsDebugLoggingTest.php rename to test/phpunit/Debug/CoreLibsDebugLoggingTest.php index 21dc3df..03f3c91 100644 --- a/test/phpunit/CoreLibsDebugLoggingTest.php +++ b/test/phpunit/Debug/CoreLibsDebugLoggingTest.php @@ -33,10 +33,10 @@ final class CoreLibsDebugLoggingTest extends TestCase return [ 'log folder set' => [ [ - 'log_folder' => '/tmp' + 'log_folder' => DIRECTORY_SEPARATOR . 'tmp' ], [ - 'log_folder' => '/tmp/', + 'log_folder' => DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR, 'debug_all' => false, 'print_all' => false, ], @@ -54,27 +54,27 @@ final class CoreLibsDebugLoggingTest extends TestCase 'no options set, constant set' => [ null, [ - 'log_folder' => str_replace('/configs', '', __DIR__) - . DIRECTORY_SEPARATOR . 'log/', + 'log_folder' => str_replace(DIRECTORY_SEPARATOR . 'configs', '', __DIR__) + . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR, 'debug_all' => false, 'print_all' => false, ], [ 'constant' => [ - 'BASE' => str_replace('/configs', '', __DIR__) + 'BASE' => str_replace(DIRECTORY_SEPARATOR . 'configs', '', __DIR__) . DIRECTORY_SEPARATOR, - 'LOG' => 'log/' + 'LOG' => 'log' . DIRECTORY_SEPARATOR ] ] ], 'standard test set' => [ [ - 'log_folder' => '/tmp', + 'log_folder' => DIRECTORY_SEPARATOR . 'tmp', 'debug_all' => true, 'print_all' => true, ], [ - 'log_folder' => '/tmp/', + 'log_folder' => DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR, 'debug_all' => true, 'print_all' => true, ], @@ -98,7 +98,22 @@ final class CoreLibsDebugLoggingTest extends TestCase { if (!empty($override['constant'])) { foreach ($override['constant'] as $var => $value) { - define($var, $value); + if (!defined($var)) { + define($var, $value); + } + } + // for deprecated no log_folder set + // if base is defined and it does have AAASetupData set + // change the log_folder "Debug" to "AAASetupData" + if ( + defined('BASE') && + strpos(BASE, DIRECTORY_SEPARATOR . 'AAASetupData') !== false + ) { + $expected['log_folder'] = str_replace( + DIRECTORY_SEPARATOR . 'Debug', + DIRECTORY_SEPARATOR . 'AAASetupData', + $expected['log_folder'] + ); } } if ($options === null) { @@ -109,15 +124,18 @@ final class CoreLibsDebugLoggingTest extends TestCase // check that settings match $this->assertEquals( $expected['log_folder'], - $log->getSetting('log_folder') + $log->getSetting('log_folder'), + 'log folder not matching' ); $this->assertEquals( $expected['debug_all'], - $log->getSetting('debug_output_all') + $log->getSetting('debug_output_all'), + 'debug all flag not matching' ); $this->assertEquals( $expected['print_all'], - $log->getSetting('print_output_all') + $log->getSetting('print_output_all'), + 'print all flag not matching' ); // print "LOG: " . $log->getSetting('log_folder') . "\n"; // print "DEBUG: " . $log->getSetting('debug_output_all') . "\n"; diff --git a/test/phpunit/CoreLibsDebugMemoryUsageTest.php b/test/phpunit/Debug/CoreLibsDebugMemoryUsageTest.php similarity index 100% rename from test/phpunit/CoreLibsDebugMemoryUsageTest.php rename to test/phpunit/Debug/CoreLibsDebugMemoryUsageTest.php diff --git a/test/phpunit/CoreLibsDebugRunningTimeTest.php b/test/phpunit/Debug/CoreLibsDebugRunningTimeTest.php similarity index 100% rename from test/phpunit/CoreLibsDebugRunningTimeTest.php rename to test/phpunit/Debug/CoreLibsDebugRunningTimeTest.php diff --git a/test/phpunit/CoreLibsDebugSupportTest.php b/test/phpunit/Debug/CoreLibsDebugSupportTest.php similarity index 100% rename from test/phpunit/CoreLibsDebugSupportTest.php rename to test/phpunit/Debug/CoreLibsDebugSupportTest.php diff --git a/test/phpunit/Debug/log/.gitignore b/test/phpunit/Debug/log/.gitignore new file mode 100644 index 0000000..2a50fc0 --- /dev/null +++ b/test/phpunit/Debug/log/.gitignore @@ -0,0 +1,3 @@ +*log +*LOG +!.gitignore diff --git a/test/phpunit/CoreLibsGetDotEnvTest.php b/test/phpunit/Get/CoreLibsGetDotEnvTest.php similarity index 100% rename from test/phpunit/CoreLibsGetDotEnvTest.php rename to test/phpunit/Get/CoreLibsGetDotEnvTest.php diff --git a/test/phpunit/CoreLibsGetSystemTest.php b/test/phpunit/Get/CoreLibsGetSystemTest.php similarity index 100% rename from test/phpunit/CoreLibsGetSystemTest.php rename to test/phpunit/Get/CoreLibsGetSystemTest.php diff --git a/test/phpunit/dotenv/cannot_read.env b/test/phpunit/Get/dotenv/cannot_read.env similarity index 100% rename from test/phpunit/dotenv/cannot_read.env rename to test/phpunit/Get/dotenv/cannot_read.env diff --git a/test/phpunit/dotenv/empty.env b/test/phpunit/Get/dotenv/empty.env similarity index 100% rename from test/phpunit/dotenv/empty.env rename to test/phpunit/Get/dotenv/empty.env diff --git a/test/phpunit/dotenv/test.env b/test/phpunit/Get/dotenv/test.env similarity index 100% rename from test/phpunit/dotenv/test.env rename to test/phpunit/Get/dotenv/test.env diff --git a/test/phpunit/CoreLibsLanguageGetLocaleTest.php b/test/phpunit/Language/CoreLibsLanguageGetLocaleTest.php similarity index 100% rename from test/phpunit/CoreLibsLanguageGetLocaleTest.php rename to test/phpunit/Language/CoreLibsLanguageGetLocaleTest.php diff --git a/test/phpunit/CoreLibsLanguageL10nTest.php b/test/phpunit/Language/CoreLibsLanguageL10nTest.php similarity index 100% rename from test/phpunit/CoreLibsLanguageL10nTest.php rename to test/phpunit/Language/CoreLibsLanguageL10nTest.php diff --git a/test/phpunit/includes/create_po.sh b/test/phpunit/Language/includes/create_po.sh similarity index 100% rename from test/phpunit/includes/create_po.sh rename to test/phpunit/Language/includes/create_po.sh diff --git a/test/phpunit/includes/locale/en_US-admin.po b/test/phpunit/Language/includes/locale/en_US-admin.po similarity index 100% rename from test/phpunit/includes/locale/en_US-admin.po rename to test/phpunit/Language/includes/locale/en_US-admin.po diff --git a/test/phpunit/includes/locale/en_US-frontend.po b/test/phpunit/Language/includes/locale/en_US-frontend.po similarity index 100% rename from test/phpunit/includes/locale/en_US-frontend.po rename to test/phpunit/Language/includes/locale/en_US-frontend.po diff --git a/test/phpunit/includes/locale/en_US/LC_MESSAGES/admin.mo b/test/phpunit/Language/includes/locale/en_US/LC_MESSAGES/admin.mo similarity index 100% rename from test/phpunit/includes/locale/en_US/LC_MESSAGES/admin.mo rename to test/phpunit/Language/includes/locale/en_US/LC_MESSAGES/admin.mo diff --git a/test/phpunit/includes/locale/en_US/LC_MESSAGES/frontend.mo b/test/phpunit/Language/includes/locale/en_US/LC_MESSAGES/frontend.mo similarity index 100% rename from test/phpunit/includes/locale/en_US/LC_MESSAGES/frontend.mo rename to test/phpunit/Language/includes/locale/en_US/LC_MESSAGES/frontend.mo diff --git a/test/phpunit/includes/locale/ja_JP-admin.po b/test/phpunit/Language/includes/locale/ja_JP-admin.po similarity index 100% rename from test/phpunit/includes/locale/ja_JP-admin.po rename to test/phpunit/Language/includes/locale/ja_JP-admin.po diff --git a/test/phpunit/includes/locale/ja_JP-frontend.po b/test/phpunit/Language/includes/locale/ja_JP-frontend.po similarity index 100% rename from test/phpunit/includes/locale/ja_JP-frontend.po rename to test/phpunit/Language/includes/locale/ja_JP-frontend.po diff --git a/test/phpunit/includes/locale/ja_JP/LC_MESSAGES/admin.mo b/test/phpunit/Language/includes/locale/ja_JP/LC_MESSAGES/admin.mo similarity index 100% rename from test/phpunit/includes/locale/ja_JP/LC_MESSAGES/admin.mo rename to test/phpunit/Language/includes/locale/ja_JP/LC_MESSAGES/admin.mo diff --git a/test/phpunit/includes/locale/ja_JP/LC_MESSAGES/frontend.mo b/test/phpunit/Language/includes/locale/ja_JP/LC_MESSAGES/frontend.mo similarity index 100% rename from test/phpunit/includes/locale/ja_JP/LC_MESSAGES/frontend.mo rename to test/phpunit/Language/includes/locale/ja_JP/LC_MESSAGES/frontend.mo diff --git a/test/phpunit/CoreLibsOutputFormElementsTest.php b/test/phpunit/Output/CoreLibsOutputFormElementsTest.php similarity index 100% rename from test/phpunit/CoreLibsOutputFormElementsTest.php rename to test/phpunit/Output/CoreLibsOutputFormElementsTest.php diff --git a/test/phpunit/CoreLibsOutputFormGenerateTest.php b/test/phpunit/Output/CoreLibsOutputFormGenerateTest.php similarity index 100% rename from test/phpunit/CoreLibsOutputFormGenerateTest.php rename to test/phpunit/Output/CoreLibsOutputFormGenerateTest.php diff --git a/test/phpunit/CoreLibsOutputFormTokenTest.php b/test/phpunit/Output/CoreLibsOutputFormTokenTest.php similarity index 100% rename from test/phpunit/CoreLibsOutputFormTokenTest.php rename to test/phpunit/Output/CoreLibsOutputFormTokenTest.php diff --git a/test/phpunit/CoreLibsOutputImageTest.php b/test/phpunit/Output/CoreLibsOutputImageTest.php similarity index 100% rename from test/phpunit/CoreLibsOutputImageTest.php rename to test/phpunit/Output/CoreLibsOutputImageTest.php diff --git a/test/phpunit/CoreLibsOutputProgressbarTest.php b/test/phpunit/Output/CoreLibsOutputProgressbarTest.php similarity index 100% rename from test/phpunit/CoreLibsOutputProgressbarTest.php rename to test/phpunit/Output/CoreLibsOutputProgressbarTest.php