Permalink
Browse files

use constants for APP and CAKE

  • Loading branch information...
1 parent baf1ce9 commit 71ce18de8b4ec71b8fb249ecb4c30725f1155fb3 @AD7six AD7six committed Oct 18, 2011
Showing with 8 additions and 20 deletions.
  1. +8 −20 lib/Cake/Test/Case/Console/Command/TestShellTest.php
@@ -106,10 +106,10 @@ public function testMapCoreFileToCase() {
public function testMapAppFileToCategory() {
$this->Shell->startup();
- $return = $this->Shell->mapFileToCategory('Controller/ExampleController.php');
+ $return = $this->Shell->mapFileToCategory(APP . 'Controller/ExampleController.php');
$this->assertSame('app', $return);
- $return = $this->Shell->mapFileToCategory('My/File/Is/Here.php');
+ $return = $this->Shell->mapFileToCategory(APP . 'My/File/Is/Here.php');
$this->assertSame('app', $return);
}
@@ -122,10 +122,10 @@ public function testMapAppFileToCategory() {
public function testMapAppFileToCase() {
$this->Shell->startup();
- $return = $this->Shell->mapFileToCase('Controller/ExampleController.php', 'app', false);
+ $return = $this->Shell->mapFileToCase(APP . 'Controller/ExampleController.php', 'app', false);
$this->assertSame('Controller/ExampleController', $return);
- $return = $this->Shell->mapFileToCase('My/File/Is/Here.php', 'app', false);
+ $return = $this->Shell->mapFileToCase(APP . 'My/File/Is/Here.php', 'app', false);
$this->assertSame('My/File/Is/Here', $return);
}
@@ -137,16 +137,10 @@ public function testMapAppFileToCase() {
public function testMapPluginFileToCategory() {
$this->Shell->startup();
- $return = $this->Shell->mapFileToCategory('Plugins/Awesome/Controller/ExampleController.php');
+ $return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Controller/ExampleController.php');
$this->assertSame('awesome', $return);
- $return = $this->Shell->mapFileToCategory('plugins/Awesome/Controller/ExampleController.php');
- $this->assertSame('awesome', $return);
-
- $return = $this->Shell->mapFileToCategory('app/Plugins/Awesome/Controller/ExampleController.php');
- $this->assertSame('awesome', $return);
-
- $return = $this->Shell->mapFileToCategory('app/plugins/Awesome/Controller/ExampleController.php');
+ $return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php');
$this->assertSame('awesome', $return);
}
@@ -159,16 +153,10 @@ public function testMapPluginFileToCategory() {
public function testMapPluginFileToCase() {
$this->Shell->startup();
- $return = $this->Shell->mapFileToCase('Plugins/Awesome/Controller/ExampleController.php', 'awesome', false);
- $this->assertSame('Controller/ExampleController', $return);
-
- $return = $this->Shell->mapFileToCase('plugins/Awesome/Controller/ExampleController.php', 'awesome', false);
- $this->assertSame('Controller/ExampleController', $return);
-
- $return = $this->Shell->mapFileToCase('app/Plugins/Awesome/Controller/ExampleController.php', 'awesome', false);
+ $return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Controller/ExampleController.php', 'awesome', false);
$this->assertSame('Controller/ExampleController', $return);
- $return = $this->Shell->mapFileToCase('app/plugins/Awesome/Controller/ExampleController.php', 'awesome', false);
+ $return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php', 'awesome', false);
$this->assertSame('Controller/ExampleController', $return);
}

0 comments on commit 71ce18d

Please sign in to comment.