use constants for APP and CAKE

This commit is contained in:
AD7six 2011-10-18 11:48:12 +02:00
parent baf1ce93f2
commit 71ce18de8b

View file

@ -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);
}