From 71ce18de8b4ec71b8fb249ecb4c30725f1155fb3 Mon Sep 17 00:00:00 2001 From: AD7six Date: Tue, 18 Oct 2011 11:48:12 +0200 Subject: [PATCH] use constants for APP and CAKE --- .../Case/Console/Command/TestShellTest.php | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/TestShellTest.php b/lib/Cake/Test/Case/Console/Command/TestShellTest.php index aa132f7e1..48e7a69d2 100644 --- a/lib/Cake/Test/Case/Console/Command/TestShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/TestShellTest.php @@ -106,10 +106,10 @@ class TestShellTest extends CakeTestCase { 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 @@ class TestShellTest extends CakeTestCase { 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 @@ class TestShellTest extends CakeTestCase { 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 @@ class TestShellTest extends CakeTestCase { public function testMapPluginFileToCase() { $this->Shell->startup(); - $return = $this->Shell->mapFileToCase('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('plugins/Awesome/Controller/ExampleController.php', 'awesome', false); - $this->assertSame('Controller/ExampleController', $return); - - $return = $this->Shell->mapFileToCase('app/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(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php', 'awesome', false); $this->assertSame('Controller/ExampleController', $return); }