From a3dc1439b6bd6a598207a8eff1fb61cbac26bd11 Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Fri, 11 Jan 2019 23:16:45 +0100 Subject: [PATCH] Fixed issues in case-sensitive operating systems. PHPStorm has been a letdown in this field. --- src/FuzeWorks/Config.php | 2 +- src/Layout/layout.logger_file.php | 2 +- test/core/core_configTest.php | 24 ++++++++-------- test/core/core_configuratorTest.php | 6 ++-- test/core/core_helperTest.php | 28 +++++++++---------- test/core/core_libraryTest.php | 20 ++++++------- test/core/core_pluginsTest.php | 4 +-- ...ddHelperPath.php => TestAddHelperPath.php} | 0 ...oadHelper.php => TestCancelLoadHelper.php} | 0 .../{testGetHelper.php => TestGetHelper.php} | 0 ...{testLoadHelper.php => TestLoadHelper.php} | 0 ... => TestLoadHelperWithoutSubdirectory.php} | 0 ...tReloadHelper.php => TestReloadHelper.php} | 0 13 files changed, 43 insertions(+), 43 deletions(-) rename test/helpers/TestAddHelperPath/{testAddHelperPath.php => TestAddHelperPath.php} (100%) rename test/helpers/TestCancelLoadHelper/{testCancelLoadHelper.php => TestCancelLoadHelper.php} (100%) rename test/helpers/TestGetHelper/{testGetHelper.php => TestGetHelper.php} (100%) rename test/helpers/TestLoadHelper/{testLoadHelper.php => TestLoadHelper.php} (100%) rename test/helpers/{testLoadHelperWithoutSubdirectory.php => TestLoadHelperWithoutSubdirectory.php} (100%) rename test/helpers/TestReloadHelper/{testReloadHelper.php => TestReloadHelper.php} (100%) diff --git a/src/FuzeWorks/Config.php b/src/FuzeWorks/Config.php index 3985901..579d7ab 100644 --- a/src/FuzeWorks/Config.php +++ b/src/FuzeWorks/Config.php @@ -163,7 +163,7 @@ class Config foreach ($event->configPaths as $configPath) { // If file exists, load it and break the loop - $file = $configPath . DS . 'config.'.$event->configName.'.php'; + $file = $configPath . DS . 'config.'.strtolower($event->configName).'.php'; if (file_exists($file)) { // Load object diff --git a/src/Layout/layout.logger_file.php b/src/Layout/layout.logger_file.php index 917e374..5be9676 100644 --- a/src/Layout/layout.logger_file.php +++ b/src/Layout/layout.logger_file.php @@ -49,4 +49,4 @@ foreach ($logs as $log) { } if (!empty($logs)) - printf($mask. $id); \ No newline at end of file + printf($mask, $id, ''); \ No newline at end of file diff --git a/test/core/core_configTest.php b/test/core/core_configTest.php index f545c0f..24051bf 100644 --- a/test/core/core_configTest.php +++ b/test/core/core_configTest.php @@ -103,11 +103,11 @@ class configTest extends CoreTestAbstract // Register listener Events::addListener(function($event){ /** @var ConfigGetEvent $event */ - $event->configName = 'testLoadConfigIntercept'; + $event->configName = 'TestLoadConfigIntercept'; }, 'configGetEvent', EventPriority::NORMAL); // Load file - $config = $this->config->getConfig('does_not_exist', ['test'.DS.'config'.DS.'testLoadConfigIntercept']); + $config = $this->config->getConfig('does_not_exist', ['test'.DS.'config'.DS.'TestLoadConfigIntercept']); $this->assertEquals('exists', $config->it); } @@ -119,7 +119,7 @@ class configTest extends CoreTestAbstract public function testLoadConfigOverride() { // Load file without override - $this->assertEquals(['initial' => 'value'], $this->config->getConfig('testLoadConfigOverride', ['test'.DS.'config'.DS.'testLoadConfigOverride'])->toArray()); + $this->assertEquals(['initial' => 'value'], $this->config->getConfig('testLoadConfigOverride', ['test'.DS.'config'.DS.'TestLoadConfigOverride'])->toArray()); // Discard to reset test $this->config->discardConfigFiles(); @@ -127,7 +127,7 @@ class configTest extends CoreTestAbstract // Create override Config::overrideConfig('testLoadConfigOverride', 'initial', 'different'); - $this->assertEquals(['initial' => 'different'], $this->config->getConfig('testLoadConfigOverride', ['test'.DS.'config'.DS.'testLoadConfigOverride'])->toArray()); + $this->assertEquals(['initial' => 'different'], $this->config->getConfig('testLoadConfigOverride', ['test'.DS.'config'.DS.'TestLoadConfigOverride'])->toArray()); } /** @@ -145,7 +145,7 @@ class configTest extends CoreTestAbstract public function testAddConfigPath() { // Add the configPath - $this->config->addConfigPath('test'.DS.'config'.DS.'testAddConfigPath'); + $this->config->addConfigPath('test'.DS.'config'.DS.'TestAddConfigPath'); // And try to load it again $this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $this->config->getConfig('testAddConfigPath')); @@ -154,25 +154,25 @@ class configTest extends CoreTestAbstract public function testRemoveConfigPath() { // Test if the path does NOT exist - $this->assertFalse(in_array('test'.DS.'config'.DS.'testRemoveConfigPath', $this->config->getConfigPaths())); + $this->assertFalse(in_array('test'.DS.'config'.DS.'TestRemoveConfigPath', $this->config->getConfigPaths())); // Add it - $this->config->addConfigPath('test'.DS.'config'.DS.'testRemoveConfigPath'); + $this->config->addConfigPath('test'.DS.'config'.DS.'TestRemoveConfigPath'); // Assert if it's there - $this->assertTrue(in_array('test'.DS.'config'.DS.'testRemoveConfigPath', $this->config->getConfigPaths())); + $this->assertTrue(in_array('test'.DS.'config'.DS.'TestRemoveConfigPath', $this->config->getConfigPaths())); // Remove it - $this->config->removeConfigPath('test'.DS.'config'.DS.'testRemoveConfigPath'); + $this->config->removeConfigPath('test'.DS.'config'.DS.'TestRemoveConfigPath'); // And test if it's gone again - $this->assertFalse(in_array('test'.DS.'config'.DS.'testRemoveConfigPath', $this->config->getConfigPaths())); + $this->assertFalse(in_array('test'.DS.'config'.DS.'TestRemoveConfigPath', $this->config->getConfigPaths())); } public function testSameConfigObject() { - $config = $this->config->getConfig('testsameconfigobject', array('test'.DS.'config'.DS.'testSameConfigObject')); - $config2 = $this->config->getConfig('testsameconfigobject', array('test'.DS.'config'.DS.'testSameConfigObject')); + $config = $this->config->getConfig('testsameconfigobject', array('test'.DS.'config'.DS.'TestSameConfigObject')); + $config2 = $this->config->getConfig('testsameconfigobject', array('test'.DS.'config'.DS.'TestSameConfigObject')); // First test if the objects are the same instance $this->assertSame($config, $config2); diff --git a/test/core/core_configuratorTest.php b/test/core/core_configuratorTest.php index 054ffcd..23a644f 100644 --- a/test/core/core_configuratorTest.php +++ b/test/core/core_configuratorTest.php @@ -85,7 +85,7 @@ class configuratorTest extends CoreTestAbstract public function testAddComponent() { // Load the component - require_once 'test'.DS.'components'.DS.'testAddComponent'.DS.'TestAddComponent.php'; + require_once 'test'.DS.'components'.DS.'TestAddComponent'.DS.'TestAddComponent.php'; $component = new FuzeWorks\Component\TestComponent(); $this->assertInstanceOf('FuzeWorks\Configurator', $this->configurator->addComponent($component)); @@ -122,7 +122,7 @@ class configuratorTest extends CoreTestAbstract public function testAddComponentFail() { // Load the component - require_once 'test'.DS.'components'.DS.'testAddComponentFail'.DS.'TestAddComponentFail.php'; + require_once 'test'.DS.'components'.DS.'TestAddComponentFail'.DS.'TestAddComponentFail.php'; $component = new FuzeWorks\Component\TestAddComponentFailComponent; $this->configurator->addComponent($component); @@ -217,7 +217,7 @@ class configuratorTest extends CoreTestAbstract vfsStream::setup('testAddComponentDirectory'); // Add the component - require_once 'test'.DS.'components'.DS.'testAddComponentDirectory'.DS.'TestAddComponentDirectory.php'; + require_once 'test'.DS.'components'.DS.'TestAddComponentDirectory'.DS.'TestAddComponentDirectory.php'; $component = new FuzeWorks\Component\TestAddComponentDirectoryComponent(); $this->configurator->addComponent($component); diff --git a/test/core/core_helperTest.php b/test/core/core_helperTest.php index 74a70f8..f64b982 100644 --- a/test/core/core_helperTest.php +++ b/test/core/core_helperTest.php @@ -72,7 +72,7 @@ class helperTest extends CoreTestAbstract $this->assertFalse(function_exists('testHelperFunction')); // Test if the helper is properly loaded - $this->assertTrue($this->helpers->load('testLoadHelper')); + $this->assertTrue($this->helpers->load('TestLoadHelper')); // Test if the function exists now $this->assertTrue(function_exists('testHelperFunction')); @@ -88,7 +88,7 @@ class helperTest extends CoreTestAbstract $this->assertFalse(function_exists('testLoadHelperWithoutSubdirectory')); // Try and load the helper - $this->assertTrue($this->helpers->load('testLoadHelperWithoutSubdirectory')); + $this->assertTrue($this->helpers->load('TestLoadHelperWithoutSubdirectory')); // Then test if the function/helper is loaded $this->assertTrue(function_exists('testLoadHelperWithoutSubdirectory')); @@ -104,13 +104,13 @@ class helperTest extends CoreTestAbstract $this->assertFalse(function_exists('testReloadHelper')); // Try and load the helper - $this->assertTrue($this->helpers->load('testReloadHelper')); + $this->assertTrue($this->helpers->load('TestReloadHelper')); // Then test if the function/helper is loaded $this->assertTrue(function_exists('testReloadHelper')); // Try and reload the helper - $this->assertFalse($this->helpers->load('testReloadHelper')); + $this->assertFalse($this->helpers->load('TestReloadHelper')); // Test that the function still exists $this->assertTrue(function_exists('testReloadHelper')); @@ -131,7 +131,7 @@ class helperTest extends CoreTestAbstract }, 'helperLoadEvent', EventPriority::NORMAL); - $this->assertFalse($this->helpers->load('testCancelLoadHelper')); + $this->assertFalse($this->helpers->load('TestCancelLoadHelper')); } /** @@ -144,7 +144,7 @@ class helperTest extends CoreTestAbstract $this->assertFalse(function_exists('testGetHelper')); // Test if the helper is properly loaded - $this->assertTrue($this->helpers->get('testGetHelper')); + $this->assertTrue($this->helpers->get('TestGetHelper')); // Test if the function exists now $this->assertTrue(function_exists('testGetHelper')); @@ -160,7 +160,7 @@ class helperTest extends CoreTestAbstract $this->assertFalse(function_exists('testAddHelperPathFunction')); // Now test if the helper can be loaded (hint: it can not) - $this->helpers->load('testAddHelperPathFail'); + $this->helpers->load('TestAddHelperPathFail'); } /** @@ -171,10 +171,10 @@ class helperTest extends CoreTestAbstract public function testAddHelperPath() { // Add the helperPath - $this->helpers->addHelperPath('test'.DS.'helpers'.DS.'testAddHelperPath'); + $this->helpers->addHelperPath('test'.DS.'helpers'.DS.'TestAddHelperPath'); // And try to load it again - $this->assertTrue($this->helpers->load('testAddHelperPath')); + $this->assertTrue($this->helpers->load('TestAddHelperPath')); // And test if the function is loaded $this->assertTrue(function_exists('testAddHelperPathFunction')); @@ -187,19 +187,19 @@ class helperTest extends CoreTestAbstract public function testRemoveHelperPath() { // Test if the path does NOT exist - $this->assertFalse(in_array('test'.DS.'helpers'.DS.'testRemoveHelperPath', $this->helpers->getHelperPaths())); + $this->assertFalse(in_array('test'.DS.'helpers'.DS.'TestRemoveHelperPath', $this->helpers->getHelperPaths())); // Add it - $this->helpers->addHelperPath('test'.DS.'helpers'.DS.'testRemoveHelperPath'); + $this->helpers->addHelperPath('test'.DS.'helpers'.DS.'TestRemoveHelperPath'); // Assert if it's there - $this->assertTrue(in_array('test'.DS.'helpers'.DS.'testRemoveHelperPath', $this->helpers->getHelperPaths())); + $this->assertTrue(in_array('test'.DS.'helpers'.DS.'TestRemoveHelperPath', $this->helpers->getHelperPaths())); // Remove it - $this->helpers->removeHelperPath('test'.DS.'helpers'.DS.'testRemoveHelperPath'); + $this->helpers->removeHelperPath('test'.DS.'helpers'.DS.'TestRemoveHelperPath'); // And test if it's gone again - $this->assertFalse(in_array('test'.DS.'helpers'.DS.'testRemoveHelperPath', $this->helpers->getHelperPaths())); + $this->assertFalse(in_array('test'.DS.'helpers'.DS.'TestRemoveHelperPath', $this->helpers->getHelperPaths())); } /** diff --git a/test/core/core_libraryTest.php b/test/core/core_libraryTest.php index 9904f43..68027b8 100644 --- a/test/core/core_libraryTest.php +++ b/test/core/core_libraryTest.php @@ -102,7 +102,7 @@ class libraryTest extends CoreTestAbstract { // Add the libraryPath $this->libraries->removeLibraryPath('test'.DS.'libraries'); - $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'testAddLibraryPath'); + $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'TestAddLibraryPath'); // And try to load it again $this->assertInstanceOf('Application\Library\TestAddLibraryPath', $this->libraries->get('TestAddLibraryPath')); @@ -111,19 +111,19 @@ class libraryTest extends CoreTestAbstract public function testRemoveLibraryPath() { // Test if the path does NOT exist - $this->assertFalse(in_array('test'.DS.'libraries'.DS.'testRemoveLibraryPath', $this->libraries->getLibraryPaths())); + $this->assertFalse(in_array('test'.DS.'libraries'.DS.'TestRemoveLibraryPath', $this->libraries->getLibraryPaths())); // Add it - $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'testRemoveLibraryPath'); + $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'TestRemoveLibraryPath'); // Assert if it's there - $this->assertTrue(in_array('test'.DS.'libraries'.DS.'testRemoveLibraryPath', $this->libraries->getLibraryPaths())); + $this->assertTrue(in_array('test'.DS.'libraries'.DS.'TestRemoveLibraryPath', $this->libraries->getLibraryPaths())); // Remove it - $this->libraries->removeLibraryPath('test'.DS.'libraries'.DS.'testRemoveLibraryPath'); + $this->libraries->removeLibraryPath('test'.DS.'libraries'.DS.'TestRemoveLibraryPath'); // And test if it's gone again - $this->assertFalse(in_array('test'.DS.'libraries'.DS.'testRemoveLibraryPath', $this->libraries->getLibraryPaths())); + $this->assertFalse(in_array('test'.DS.'libraries'.DS.'TestRemoveLibraryPath', $this->libraries->getLibraryPaths())); } /* ---------------------------------- Load library from directories ------------------- */ @@ -142,7 +142,7 @@ class libraryTest extends CoreTestAbstract public function testGetLibraryFromSubdirectory() { // Add test directory path - $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'testGetLibraryFromSubdirectory'); + $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'TestGetLibraryFromSubdirectory'); $this->assertInstanceOf('Application\Library\TestGetLibraryFromSubdirectory', $this->libraries->get('TestGetLibraryFromSubdirectory')); } @@ -154,7 +154,7 @@ class libraryTest extends CoreTestAbstract { // Simple test of loading a library and checking if it exists $this->assertInstanceOf('Application\Library\TestGetLibraryFromAltDirectory', - $this->libraries->get('TestGetLibraryFromAltDirectory', [], ['test'.DS.'libraries'.DS.'testGetLibraryFromAltDirectory'])); + $this->libraries->get('TestGetLibraryFromAltDirectory', [], ['test'.DS.'libraries'.DS.'TestGetLibraryFromAltDirectory'])); } /** @@ -185,7 +185,7 @@ class libraryTest extends CoreTestAbstract { // Prepare the config file $libraryName = 'TestGetLibraryParametersFromConfig'; - $libraryDir = 'test'.DS.'libraries'.DS.'testGetLibraryParametersFromConfig'; + $libraryDir = 'test'.DS.'libraries'.DS.'TestGetLibraryParametersFromConfig'; $config = Factory::getInstance()->config->getConfig(strtolower($libraryName), [$libraryDir]); // Load the library @@ -207,7 +207,7 @@ class libraryTest extends CoreTestAbstract public function testAddLibraryClass() { - require_once('test'.DS.'libraries'.DS.'testAddLibraryClass'.DS.'TestAddLibraryClass.php'); + require_once('test'.DS.'libraries'.DS.'TestAddLibraryClass'.DS.'TestAddLibraryClass.php'); $this->libraries->addLibraryClass('LibraryClass', '\Custom\Spaces\TestAddLibraryClass'); diff --git a/test/core/core_pluginsTest.php b/test/core/core_pluginsTest.php index 627c1d6..ae59442 100644 --- a/test/core/core_pluginsTest.php +++ b/test/core/core_pluginsTest.php @@ -85,7 +85,7 @@ class pluginTest extends CoreTestAbstract public function testLoadHeader() { // Load the header object - require_once('test' . DS . 'plugins' . DS . 'testLoadHeader'.DS.'loadHeader'.DS.'header.php'); + require_once('test' . DS . 'plugins' . DS . 'TestLoadHeader'.DS.'loadHeader'.DS.'header.php'); $header = new Plugins\TestLoadHeaderHeader(); // Register the header object @@ -183,7 +183,7 @@ class pluginTest extends CoreTestAbstract public function testAddPluginPath() { // Add the pluginPath - $this->plugins->addPluginPath('test'.DS.'plugins'.DS.'testAddPluginPath'); + $this->plugins->addPluginPath('test'.DS.'plugins'.DS.'TestAddPluginPath'); // And try to load it again $this->plugins->loadHeadersFromPluginPaths(); diff --git a/test/helpers/TestAddHelperPath/testAddHelperPath.php b/test/helpers/TestAddHelperPath/TestAddHelperPath.php similarity index 100% rename from test/helpers/TestAddHelperPath/testAddHelperPath.php rename to test/helpers/TestAddHelperPath/TestAddHelperPath.php diff --git a/test/helpers/TestCancelLoadHelper/testCancelLoadHelper.php b/test/helpers/TestCancelLoadHelper/TestCancelLoadHelper.php similarity index 100% rename from test/helpers/TestCancelLoadHelper/testCancelLoadHelper.php rename to test/helpers/TestCancelLoadHelper/TestCancelLoadHelper.php diff --git a/test/helpers/TestGetHelper/testGetHelper.php b/test/helpers/TestGetHelper/TestGetHelper.php similarity index 100% rename from test/helpers/TestGetHelper/testGetHelper.php rename to test/helpers/TestGetHelper/TestGetHelper.php diff --git a/test/helpers/TestLoadHelper/testLoadHelper.php b/test/helpers/TestLoadHelper/TestLoadHelper.php similarity index 100% rename from test/helpers/TestLoadHelper/testLoadHelper.php rename to test/helpers/TestLoadHelper/TestLoadHelper.php diff --git a/test/helpers/testLoadHelperWithoutSubdirectory.php b/test/helpers/TestLoadHelperWithoutSubdirectory.php similarity index 100% rename from test/helpers/testLoadHelperWithoutSubdirectory.php rename to test/helpers/TestLoadHelperWithoutSubdirectory.php diff --git a/test/helpers/TestReloadHelper/testReloadHelper.php b/test/helpers/TestReloadHelper/TestReloadHelper.php similarity index 100% rename from test/helpers/TestReloadHelper/testReloadHelper.php rename to test/helpers/TestReloadHelper/TestReloadHelper.php