Fixed issues in case-sensitive operating systems. PHPStorm has been a letdown in this field.

This commit is contained in:
Abel Hoogeveen 2019-01-11 23:16:45 +01:00
parent 01d45b2937
commit a3dc1439b6
No known key found for this signature in database
GPG Key ID: 96C2234920BF4292
13 changed files with 43 additions and 43 deletions

View File

@ -163,7 +163,7 @@ class Config
foreach ($event->configPaths as $configPath) foreach ($event->configPaths as $configPath)
{ {
// If file exists, load it and break the loop // 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)) if (file_exists($file))
{ {
// Load object // Load object

View File

@ -49,4 +49,4 @@ foreach ($logs as $log) {
} }
if (!empty($logs)) if (!empty($logs))
printf($mask. $id); printf($mask, $id, '');

View File

@ -103,11 +103,11 @@ class configTest extends CoreTestAbstract
// Register listener // Register listener
Events::addListener(function($event){ Events::addListener(function($event){
/** @var ConfigGetEvent $event */ /** @var ConfigGetEvent $event */
$event->configName = 'testLoadConfigIntercept'; $event->configName = 'TestLoadConfigIntercept';
}, 'configGetEvent', EventPriority::NORMAL); }, 'configGetEvent', EventPriority::NORMAL);
// Load file // 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); $this->assertEquals('exists', $config->it);
} }
@ -119,7 +119,7 @@ class configTest extends CoreTestAbstract
public function testLoadConfigOverride() public function testLoadConfigOverride()
{ {
// Load file without override // 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 // Discard to reset test
$this->config->discardConfigFiles(); $this->config->discardConfigFiles();
@ -127,7 +127,7 @@ class configTest extends CoreTestAbstract
// Create override // Create override
Config::overrideConfig('testLoadConfigOverride', 'initial', 'different'); 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() public function testAddConfigPath()
{ {
// Add the configPath // 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 // And try to load it again
$this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $this->config->getConfig('testAddConfigPath')); $this->assertInstanceOf('FuzeWorks\ConfigORM\ConfigORM', $this->config->getConfig('testAddConfigPath'));
@ -154,25 +154,25 @@ class configTest extends CoreTestAbstract
public function testRemoveConfigPath() public function testRemoveConfigPath()
{ {
// Test if the path does NOT exist // 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 // Add it
$this->config->addConfigPath('test'.DS.'config'.DS.'testRemoveConfigPath'); $this->config->addConfigPath('test'.DS.'config'.DS.'TestRemoveConfigPath');
// Assert if it's there // 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 // 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 // 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() public function testSameConfigObject()
{ {
$config = $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')); $config2 = $this->config->getConfig('testsameconfigobject', array('test'.DS.'config'.DS.'TestSameConfigObject'));
// First test if the objects are the same instance // First test if the objects are the same instance
$this->assertSame($config, $config2); $this->assertSame($config, $config2);

View File

@ -85,7 +85,7 @@ class configuratorTest extends CoreTestAbstract
public function testAddComponent() public function testAddComponent()
{ {
// Load the component // 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(); $component = new FuzeWorks\Component\TestComponent();
$this->assertInstanceOf('FuzeWorks\Configurator', $this->configurator->addComponent($component)); $this->assertInstanceOf('FuzeWorks\Configurator', $this->configurator->addComponent($component));
@ -122,7 +122,7 @@ class configuratorTest extends CoreTestAbstract
public function testAddComponentFail() public function testAddComponentFail()
{ {
// Load the component // 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; $component = new FuzeWorks\Component\TestAddComponentFailComponent;
$this->configurator->addComponent($component); $this->configurator->addComponent($component);
@ -217,7 +217,7 @@ class configuratorTest extends CoreTestAbstract
vfsStream::setup('testAddComponentDirectory'); vfsStream::setup('testAddComponentDirectory');
// Add the component // 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(); $component = new FuzeWorks\Component\TestAddComponentDirectoryComponent();
$this->configurator->addComponent($component); $this->configurator->addComponent($component);

View File

@ -72,7 +72,7 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(function_exists('testHelperFunction')); $this->assertFalse(function_exists('testHelperFunction'));
// Test if the helper is properly loaded // 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 // Test if the function exists now
$this->assertTrue(function_exists('testHelperFunction')); $this->assertTrue(function_exists('testHelperFunction'));
@ -88,7 +88,7 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(function_exists('testLoadHelperWithoutSubdirectory')); $this->assertFalse(function_exists('testLoadHelperWithoutSubdirectory'));
// Try and load the helper // 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 // Then test if the function/helper is loaded
$this->assertTrue(function_exists('testLoadHelperWithoutSubdirectory')); $this->assertTrue(function_exists('testLoadHelperWithoutSubdirectory'));
@ -104,13 +104,13 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(function_exists('testReloadHelper')); $this->assertFalse(function_exists('testReloadHelper'));
// Try and load the helper // 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 // Then test if the function/helper is loaded
$this->assertTrue(function_exists('testReloadHelper')); $this->assertTrue(function_exists('testReloadHelper'));
// Try and reload the helper // Try and reload the helper
$this->assertFalse($this->helpers->load('testReloadHelper')); $this->assertFalse($this->helpers->load('TestReloadHelper'));
// Test that the function still exists // Test that the function still exists
$this->assertTrue(function_exists('testReloadHelper')); $this->assertTrue(function_exists('testReloadHelper'));
@ -131,7 +131,7 @@ class helperTest extends CoreTestAbstract
}, 'helperLoadEvent', EventPriority::NORMAL); }, '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')); $this->assertFalse(function_exists('testGetHelper'));
// Test if the helper is properly loaded // 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 // Test if the function exists now
$this->assertTrue(function_exists('testGetHelper')); $this->assertTrue(function_exists('testGetHelper'));
@ -160,7 +160,7 @@ class helperTest extends CoreTestAbstract
$this->assertFalse(function_exists('testAddHelperPathFunction')); $this->assertFalse(function_exists('testAddHelperPathFunction'));
// Now test if the helper can be loaded (hint: it can not) // 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() public function testAddHelperPath()
{ {
// Add the helperPath // 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 // 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 // And test if the function is loaded
$this->assertTrue(function_exists('testAddHelperPathFunction')); $this->assertTrue(function_exists('testAddHelperPathFunction'));
@ -187,19 +187,19 @@ class helperTest extends CoreTestAbstract
public function testRemoveHelperPath() public function testRemoveHelperPath()
{ {
// Test if the path does NOT exist // 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 // Add it
$this->helpers->addHelperPath('test'.DS.'helpers'.DS.'testRemoveHelperPath'); $this->helpers->addHelperPath('test'.DS.'helpers'.DS.'TestRemoveHelperPath');
// Assert if it's there // 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 // 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 // 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()));
} }
/** /**

View File

@ -102,7 +102,7 @@ class libraryTest extends CoreTestAbstract
{ {
// Add the libraryPath // Add the libraryPath
$this->libraries->removeLibraryPath('test'.DS.'libraries'); $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 // And try to load it again
$this->assertInstanceOf('Application\Library\TestAddLibraryPath', $this->libraries->get('TestAddLibraryPath')); $this->assertInstanceOf('Application\Library\TestAddLibraryPath', $this->libraries->get('TestAddLibraryPath'));
@ -111,19 +111,19 @@ class libraryTest extends CoreTestAbstract
public function testRemoveLibraryPath() public function testRemoveLibraryPath()
{ {
// Test if the path does NOT exist // 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 // Add it
$this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'testRemoveLibraryPath'); $this->libraries->addLibraryPath('test'.DS.'libraries'.DS.'TestRemoveLibraryPath');
// Assert if it's there // 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 // 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 // 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 ------------------- */ /* ---------------------------------- Load library from directories ------------------- */
@ -142,7 +142,7 @@ class libraryTest extends CoreTestAbstract
public function testGetLibraryFromSubdirectory() public function testGetLibraryFromSubdirectory()
{ {
// Add test directory path // 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')); $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 // Simple test of loading a library and checking if it exists
$this->assertInstanceOf('Application\Library\TestGetLibraryFromAltDirectory', $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 // Prepare the config file
$libraryName = 'TestGetLibraryParametersFromConfig'; $libraryName = 'TestGetLibraryParametersFromConfig';
$libraryDir = 'test'.DS.'libraries'.DS.'testGetLibraryParametersFromConfig'; $libraryDir = 'test'.DS.'libraries'.DS.'TestGetLibraryParametersFromConfig';
$config = Factory::getInstance()->config->getConfig(strtolower($libraryName), [$libraryDir]); $config = Factory::getInstance()->config->getConfig(strtolower($libraryName), [$libraryDir]);
// Load the library // Load the library
@ -207,7 +207,7 @@ class libraryTest extends CoreTestAbstract
public function testAddLibraryClass() 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'); $this->libraries->addLibraryClass('LibraryClass', '\Custom\Spaces\TestAddLibraryClass');

View File

@ -85,7 +85,7 @@ class pluginTest extends CoreTestAbstract
public function testLoadHeader() public function testLoadHeader()
{ {
// Load the header object // 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(); $header = new Plugins\TestLoadHeaderHeader();
// Register the header object // Register the header object
@ -183,7 +183,7 @@ class pluginTest extends CoreTestAbstract
public function testAddPluginPath() public function testAddPluginPath()
{ {
// Add the pluginPath // 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 // And try to load it again
$this->plugins->loadHeadersFromPluginPaths(); $this->plugins->loadHeadersFromPluginPaths();