Browse Source

Merge pull request #817 from shama/patch-trimpath

Remove never reached code in Debugger::trimPath and test more results
Mark Story 13 years ago
parent
commit
878f18419c
2 changed files with 5 additions and 5 deletions
  1. 5 2
      lib/Cake/Test/Case/Utility/DebuggerTest.php
  2. 0 3
      lib/Cake/Utility/Debugger.php

+ 5 - 2
lib/Cake/Test/Case/Utility/DebuggerTest.php

@@ -277,8 +277,11 @@ class DebuggerTest extends CakeTestCase {
  * @return void
  */
 	public function testTrimPath() {
-		$this->assertEquals(Debugger::trimPath(APP), 'APP' . DS);
-		$this->assertEquals(Debugger::trimPath(CAKE_CORE_INCLUDE_PATH), 'CORE');
+		$this->assertEquals('APP' . DS, Debugger::trimPath(APP));
+		$this->assertEquals('CORE', Debugger::trimPath(CAKE_CORE_INCLUDE_PATH));
+		$this->assertEquals('ROOT', Debugger::trimPath(ROOT));
+		$this->assertEquals('CORE' . DS . 'Cake' . DS, Debugger::trimPath(CAKE));
+		$this->assertEquals('Some/Other/Path', Debugger::trimPath('Some/Other/Path'));
 	}
 
 /**

+ 0 - 3
lib/Cake/Utility/Debugger.php

@@ -369,9 +369,6 @@ class Debugger {
 			return str_replace(ROOT, 'ROOT', $path);
 		}
 
-		if (strpos($path, CAKE) === 0) {
-			return str_replace($corePath, 'CORE' . DS, $path);
-		}
 		return $path;
 	}