From 2160ddf3e543e1fd4e00d5cb86d6644189a3a961 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 5 Jan 2015 11:46:33 +1100 Subject: [PATCH] Fixes unit test - normalize plugin paths for Win systems --- modules/system/classes/PluginManager.php | 3 +-- tests/unit/system/classes/PluginManagerTest.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index 507d75c3e..491822060 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -211,7 +211,6 @@ class PluginManager /** * Returns the directory path to a plugin - * */ public function getPluginPath($id) { @@ -220,7 +219,7 @@ class PluginManager return null; } - return $this->pathMap[$classId]; + return File::normalizePath($this->pathMap[$classId]); } /** diff --git a/tests/unit/system/classes/PluginManagerTest.php b/tests/unit/system/classes/PluginManagerTest.php index ff0a92f5a..dbfcff19a 100644 --- a/tests/unit/system/classes/PluginManagerTest.php +++ b/tests/unit/system/classes/PluginManagerTest.php @@ -72,7 +72,8 @@ class PluginManagerTest extends TestCase { $manager = PluginManager::instance(); $result = $manager->getPluginPath('October\Tester'); - $this->assertEquals(base_path() . '/tests/fixtures/system/plugins/october/tester', $result); + $basePath = str_replace('\\', '/', base_path()); + $this->assertEquals($basePath . '/tests/fixtures/system/plugins/october/tester', $result); } public function testGetPlugins()