diff --git a/4dev/tests/AAASetupData/CoreLibsAAASetupDataTest.php b/4dev/tests/AAASetupData/CoreLibsAAASetupDataTest.php new file mode 100644 index 00000000..625d0059 --- /dev/null +++ b/4dev/tests/AAASetupData/CoreLibsAAASetupDataTest.php @@ -0,0 +1,40 @@ +assertEquals( + str_replace('/configs', '', __DIR__) + . DIRECTORY_SEPARATOR, + BASE, + 'BASE Path set check' + ); + } +} + +// __END__ diff --git a/4dev/tests/AAASetupData/includes b/4dev/tests/AAASetupData/includes new file mode 120000 index 00000000..918e7d32 --- /dev/null +++ b/4dev/tests/AAASetupData/includes @@ -0,0 +1 @@ +../Language/includes/ \ No newline at end of file diff --git a/4dev/tests/AAASetupData/log b/4dev/tests/AAASetupData/log new file mode 120000 index 00000000..c40e9a4d --- /dev/null +++ b/4dev/tests/AAASetupData/log @@ -0,0 +1 @@ +../Debug/log/ \ No newline at end of file diff --git a/4dev/tests/CoreLibsACLLoginTest.php b/4dev/tests/ACL/CoreLibsACLLoginTest.php similarity index 100% rename from 4dev/tests/CoreLibsACLLoginTest.php rename to 4dev/tests/ACL/CoreLibsACLLoginTest.php diff --git a/4dev/tests/CoreLibsACLLogin_database_prepare.sh b/4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh similarity index 100% rename from 4dev/tests/CoreLibsACLLogin_database_prepare.sh rename to 4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh diff --git a/4dev/tests/database/CoreLibsACLLogin_database_create_data.sql b/4dev/tests/ACL/database/CoreLibsACLLogin_database_create_data.sql similarity index 100% rename from 4dev/tests/database/CoreLibsACLLogin_database_create_data.sql rename to 4dev/tests/ACL/database/CoreLibsACLLogin_database_create_data.sql diff --git a/4dev/tests/log/.gitignore b/4dev/tests/ACL/log/.gitignore similarity index 100% rename from 4dev/tests/log/.gitignore rename to 4dev/tests/ACL/log/.gitignore diff --git a/4dev/tests/CoreLibsAdminBackendTest.php b/4dev/tests/Admin/CoreLibsAdminBackendTest.php similarity index 100% rename from 4dev/tests/CoreLibsAdminBackendTest.php rename to 4dev/tests/Admin/CoreLibsAdminBackendTest.php diff --git a/4dev/tests/CoreLibsAdminEditPageTest.php b/4dev/tests/Admin/CoreLibsAdminEditPageTest.php similarity index 100% rename from 4dev/tests/CoreLibsAdminEditPageTest.php rename to 4dev/tests/Admin/CoreLibsAdminEditPageTest.php diff --git a/4dev/tests/CoreLibsCheckColorsTest.php b/4dev/tests/Check/CoreLibsCheckColorsTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckColorsTest.php rename to 4dev/tests/Check/CoreLibsCheckColorsTest.php diff --git a/4dev/tests/CoreLibsCheckEmailTest.php b/4dev/tests/Check/CoreLibsCheckEmailTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckEmailTest.php rename to 4dev/tests/Check/CoreLibsCheckEmailTest.php diff --git a/4dev/tests/CoreLibsCheckEncodingTest.php b/4dev/tests/Check/CoreLibsCheckEncodingTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckEncodingTest.php rename to 4dev/tests/Check/CoreLibsCheckEncodingTest.php diff --git a/4dev/tests/CoreLibsCheckFileTest.php b/4dev/tests/Check/CoreLibsCheckFileTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckFileTest.php rename to 4dev/tests/Check/CoreLibsCheckFileTest.php diff --git a/4dev/tests/CoreLibsCheckPasswordTest.php b/4dev/tests/Check/CoreLibsCheckPasswordTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckPasswordTest.php rename to 4dev/tests/Check/CoreLibsCheckPasswordTest.php diff --git a/4dev/tests/CoreLibsCheckPhpVersionTest.php b/4dev/tests/Check/CoreLibsCheckPhpVersionTest.php similarity index 100% rename from 4dev/tests/CoreLibsCheckPhpVersionTest.php rename to 4dev/tests/Check/CoreLibsCheckPhpVersionTest.php diff --git a/4dev/tests/CoreLibsCombinedArrayHandlerTest.php b/4dev/tests/Combined/CoreLibsCombinedArrayHandlerTest.php similarity index 100% rename from 4dev/tests/CoreLibsCombinedArrayHandlerTest.php rename to 4dev/tests/Combined/CoreLibsCombinedArrayHandlerTest.php diff --git a/4dev/tests/CoreLibsCombinedDateTimeTest.php b/4dev/tests/Combined/CoreLibsCombinedDateTimeTest.php similarity index 100% rename from 4dev/tests/CoreLibsCombinedDateTimeTest.php rename to 4dev/tests/Combined/CoreLibsCombinedDateTimeTest.php diff --git a/4dev/tests/CoreLibsConvertByteTest.php b/4dev/tests/Convert/CoreLibsConvertByteTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertByteTest.php rename to 4dev/tests/Convert/CoreLibsConvertByteTest.php diff --git a/4dev/tests/CoreLibsConvertColorsTest.php b/4dev/tests/Convert/CoreLibsConvertColorsTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertColorsTest.php rename to 4dev/tests/Convert/CoreLibsConvertColorsTest.php diff --git a/4dev/tests/CoreLibsConvertEncodingTest.php b/4dev/tests/Convert/CoreLibsConvertEncodingTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertEncodingTest.php rename to 4dev/tests/Convert/CoreLibsConvertEncodingTest.php diff --git a/4dev/tests/CoreLibsConvertHtmlTest.php b/4dev/tests/Convert/CoreLibsConvertHtmlTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertHtmlTest.php rename to 4dev/tests/Convert/CoreLibsConvertHtmlTest.php diff --git a/4dev/tests/CoreLibsConvertJsonTest.php b/4dev/tests/Convert/CoreLibsConvertJsonTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertJsonTest.php rename to 4dev/tests/Convert/CoreLibsConvertJsonTest.php diff --git a/4dev/tests/CoreLibsConvertMathTest.php b/4dev/tests/Convert/CoreLibsConvertMathTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertMathTest.php rename to 4dev/tests/Convert/CoreLibsConvertMathTest.php diff --git a/4dev/tests/CoreLibsConvertMimeAppNameTest.php b/4dev/tests/Convert/CoreLibsConvertMimeAppNameTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertMimeAppNameTest.php rename to 4dev/tests/Convert/CoreLibsConvertMimeAppNameTest.php diff --git a/4dev/tests/CoreLibsConvertMimeEncodeTest.php b/4dev/tests/Convert/CoreLibsConvertMimeEncodeTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertMimeEncodeTest.php rename to 4dev/tests/Convert/CoreLibsConvertMimeEncodeTest.php diff --git a/4dev/tests/CoreLibsConvertSetVarTypeNullTest.php b/4dev/tests/Convert/CoreLibsConvertSetVarTypeNullTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertSetVarTypeNullTest.php rename to 4dev/tests/Convert/CoreLibsConvertSetVarTypeNullTest.php diff --git a/4dev/tests/CoreLibsConvertSetVarTypeTest.php b/4dev/tests/Convert/CoreLibsConvertSetVarTypeTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertSetVarTypeTest.php rename to 4dev/tests/Convert/CoreLibsConvertSetVarTypeTest.php diff --git a/4dev/tests/CoreLibsConvertStringsTest.php b/4dev/tests/Convert/CoreLibsConvertStringsTest.php similarity index 100% rename from 4dev/tests/CoreLibsConvertStringsTest.php rename to 4dev/tests/Convert/CoreLibsConvertStringsTest.php diff --git a/4dev/tests/CoreLibsCreateEmailTest.php b/4dev/tests/Create/CoreLibsCreateEmailTest.php similarity index 100% rename from 4dev/tests/CoreLibsCreateEmailTest.php rename to 4dev/tests/Create/CoreLibsCreateEmailTest.php diff --git a/4dev/tests/CoreLibsCreateHashTest.php b/4dev/tests/Create/CoreLibsCreateHashTest.php similarity index 100% rename from 4dev/tests/CoreLibsCreateHashTest.php rename to 4dev/tests/Create/CoreLibsCreateHashTest.php diff --git a/4dev/tests/CoreLibsCreateRandomKeyTest.php b/4dev/tests/Create/CoreLibsCreateRandomKeyTest.php similarity index 100% rename from 4dev/tests/CoreLibsCreateRandomKeyTest.php rename to 4dev/tests/Create/CoreLibsCreateRandomKeyTest.php diff --git a/4dev/tests/CoreLibsCreateSessionTest.php b/4dev/tests/Create/CoreLibsCreateSessionTest.php similarity index 100% rename from 4dev/tests/CoreLibsCreateSessionTest.php rename to 4dev/tests/Create/CoreLibsCreateSessionTest.php diff --git a/4dev/tests/CoreLibsCreateUidsTest.php b/4dev/tests/Create/CoreLibsCreateUidsTest.php similarity index 100% rename from 4dev/tests/CoreLibsCreateUidsTest.php rename to 4dev/tests/Create/CoreLibsCreateUidsTest.php diff --git a/4dev/tests/CoreLibsDBExtendedArrayIOTest.php b/4dev/tests/DB/CoreLibsDBExtendedArrayIOTest.php similarity index 100% rename from 4dev/tests/CoreLibsDBExtendedArrayIOTest.php rename to 4dev/tests/DB/CoreLibsDBExtendedArrayIOTest.php diff --git a/4dev/tests/CoreLibsDBIOTest.php b/4dev/tests/DB/CoreLibsDBIOTest.php similarity index 100% rename from 4dev/tests/CoreLibsDBIOTest.php rename to 4dev/tests/DB/CoreLibsDBIOTest.php diff --git a/4dev/tests/CoreLibsDebugFileWriterTest.php b/4dev/tests/Debug/CoreLibsDebugFileWriterTest.php similarity index 100% rename from 4dev/tests/CoreLibsDebugFileWriterTest.php rename to 4dev/tests/Debug/CoreLibsDebugFileWriterTest.php diff --git a/4dev/tests/CoreLibsDebugLoggingTest.php b/4dev/tests/Debug/CoreLibsDebugLoggingTest.php similarity index 94% rename from 4dev/tests/CoreLibsDebugLoggingTest.php rename to 4dev/tests/Debug/CoreLibsDebugLoggingTest.php index 21dc3df7..03f3c912 100644 --- a/4dev/tests/CoreLibsDebugLoggingTest.php +++ b/4dev/tests/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/4dev/tests/CoreLibsDebugMemoryUsageTest.php b/4dev/tests/Debug/CoreLibsDebugMemoryUsageTest.php similarity index 100% rename from 4dev/tests/CoreLibsDebugMemoryUsageTest.php rename to 4dev/tests/Debug/CoreLibsDebugMemoryUsageTest.php diff --git a/4dev/tests/CoreLibsDebugRunningTimeTest.php b/4dev/tests/Debug/CoreLibsDebugRunningTimeTest.php similarity index 100% rename from 4dev/tests/CoreLibsDebugRunningTimeTest.php rename to 4dev/tests/Debug/CoreLibsDebugRunningTimeTest.php diff --git a/4dev/tests/CoreLibsDebugSupportTest.php b/4dev/tests/Debug/CoreLibsDebugSupportTest.php similarity index 100% rename from 4dev/tests/CoreLibsDebugSupportTest.php rename to 4dev/tests/Debug/CoreLibsDebugSupportTest.php diff --git a/4dev/tests/Debug/log/.gitignore b/4dev/tests/Debug/log/.gitignore new file mode 100644 index 00000000..2a50fc00 --- /dev/null +++ b/4dev/tests/Debug/log/.gitignore @@ -0,0 +1,3 @@ +*log +*LOG +!.gitignore diff --git a/4dev/tests/CoreLibsGetDotEnvTest.php b/4dev/tests/Get/CoreLibsGetDotEnvTest.php similarity index 100% rename from 4dev/tests/CoreLibsGetDotEnvTest.php rename to 4dev/tests/Get/CoreLibsGetDotEnvTest.php diff --git a/4dev/tests/CoreLibsGetSystemTest.php b/4dev/tests/Get/CoreLibsGetSystemTest.php similarity index 100% rename from 4dev/tests/CoreLibsGetSystemTest.php rename to 4dev/tests/Get/CoreLibsGetSystemTest.php diff --git a/4dev/tests/dotenv/cannot_read.env b/4dev/tests/Get/dotenv/cannot_read.env similarity index 100% rename from 4dev/tests/dotenv/cannot_read.env rename to 4dev/tests/Get/dotenv/cannot_read.env diff --git a/4dev/tests/dotenv/empty.env b/4dev/tests/Get/dotenv/empty.env similarity index 100% rename from 4dev/tests/dotenv/empty.env rename to 4dev/tests/Get/dotenv/empty.env diff --git a/4dev/tests/dotenv/test.env b/4dev/tests/Get/dotenv/test.env similarity index 100% rename from 4dev/tests/dotenv/test.env rename to 4dev/tests/Get/dotenv/test.env diff --git a/4dev/tests/CoreLibsLanguageGetLocaleTest.php b/4dev/tests/Language/CoreLibsLanguageGetLocaleTest.php similarity index 100% rename from 4dev/tests/CoreLibsLanguageGetLocaleTest.php rename to 4dev/tests/Language/CoreLibsLanguageGetLocaleTest.php diff --git a/4dev/tests/CoreLibsLanguageL10nTest.php b/4dev/tests/Language/CoreLibsLanguageL10nTest.php similarity index 100% rename from 4dev/tests/CoreLibsLanguageL10nTest.php rename to 4dev/tests/Language/CoreLibsLanguageL10nTest.php diff --git a/4dev/tests/includes/create_po.sh b/4dev/tests/Language/includes/create_po.sh similarity index 100% rename from 4dev/tests/includes/create_po.sh rename to 4dev/tests/Language/includes/create_po.sh diff --git a/4dev/tests/includes/locale/en_US-admin.po b/4dev/tests/Language/includes/locale/en_US-admin.po similarity index 100% rename from 4dev/tests/includes/locale/en_US-admin.po rename to 4dev/tests/Language/includes/locale/en_US-admin.po diff --git a/4dev/tests/includes/locale/en_US-frontend.po b/4dev/tests/Language/includes/locale/en_US-frontend.po similarity index 100% rename from 4dev/tests/includes/locale/en_US-frontend.po rename to 4dev/tests/Language/includes/locale/en_US-frontend.po diff --git a/4dev/tests/includes/locale/en_US/LC_MESSAGES/admin.mo b/4dev/tests/Language/includes/locale/en_US/LC_MESSAGES/admin.mo similarity index 100% rename from 4dev/tests/includes/locale/en_US/LC_MESSAGES/admin.mo rename to 4dev/tests/Language/includes/locale/en_US/LC_MESSAGES/admin.mo diff --git a/4dev/tests/includes/locale/en_US/LC_MESSAGES/frontend.mo b/4dev/tests/Language/includes/locale/en_US/LC_MESSAGES/frontend.mo similarity index 100% rename from 4dev/tests/includes/locale/en_US/LC_MESSAGES/frontend.mo rename to 4dev/tests/Language/includes/locale/en_US/LC_MESSAGES/frontend.mo diff --git a/4dev/tests/includes/locale/ja_JP-admin.po b/4dev/tests/Language/includes/locale/ja_JP-admin.po similarity index 100% rename from 4dev/tests/includes/locale/ja_JP-admin.po rename to 4dev/tests/Language/includes/locale/ja_JP-admin.po diff --git a/4dev/tests/includes/locale/ja_JP-frontend.po b/4dev/tests/Language/includes/locale/ja_JP-frontend.po similarity index 100% rename from 4dev/tests/includes/locale/ja_JP-frontend.po rename to 4dev/tests/Language/includes/locale/ja_JP-frontend.po diff --git a/4dev/tests/includes/locale/ja_JP/LC_MESSAGES/admin.mo b/4dev/tests/Language/includes/locale/ja_JP/LC_MESSAGES/admin.mo similarity index 100% rename from 4dev/tests/includes/locale/ja_JP/LC_MESSAGES/admin.mo rename to 4dev/tests/Language/includes/locale/ja_JP/LC_MESSAGES/admin.mo diff --git a/4dev/tests/includes/locale/ja_JP/LC_MESSAGES/frontend.mo b/4dev/tests/Language/includes/locale/ja_JP/LC_MESSAGES/frontend.mo similarity index 100% rename from 4dev/tests/includes/locale/ja_JP/LC_MESSAGES/frontend.mo rename to 4dev/tests/Language/includes/locale/ja_JP/LC_MESSAGES/frontend.mo diff --git a/4dev/tests/CoreLibsOutputFormElementsTest.php b/4dev/tests/Output/CoreLibsOutputFormElementsTest.php similarity index 100% rename from 4dev/tests/CoreLibsOutputFormElementsTest.php rename to 4dev/tests/Output/CoreLibsOutputFormElementsTest.php diff --git a/4dev/tests/CoreLibsOutputFormGenerateTest.php b/4dev/tests/Output/CoreLibsOutputFormGenerateTest.php similarity index 100% rename from 4dev/tests/CoreLibsOutputFormGenerateTest.php rename to 4dev/tests/Output/CoreLibsOutputFormGenerateTest.php diff --git a/4dev/tests/CoreLibsOutputFormTokenTest.php b/4dev/tests/Output/CoreLibsOutputFormTokenTest.php similarity index 100% rename from 4dev/tests/CoreLibsOutputFormTokenTest.php rename to 4dev/tests/Output/CoreLibsOutputFormTokenTest.php diff --git a/4dev/tests/CoreLibsOutputImageTest.php b/4dev/tests/Output/CoreLibsOutputImageTest.php similarity index 100% rename from 4dev/tests/CoreLibsOutputImageTest.php rename to 4dev/tests/Output/CoreLibsOutputImageTest.php diff --git a/4dev/tests/CoreLibsOutputProgressbarTest.php b/4dev/tests/Output/CoreLibsOutputProgressbarTest.php similarity index 100% rename from 4dev/tests/CoreLibsOutputProgressbarTest.php rename to 4dev/tests/Output/CoreLibsOutputProgressbarTest.php diff --git a/4dev/tests/dotenv/.env b/4dev/tests/dotenv/.env deleted file mode 120000 index a67af1f7..00000000 --- a/4dev/tests/dotenv/.env +++ /dev/null @@ -1 +0,0 @@ -test.env \ No newline at end of file