add a plugin parsing test

This commit is contained in:
AD7six 2011-10-18 11:40:53 +02:00
parent 4addd9faae
commit baf1ce93f2

View file

@ -129,6 +129,49 @@ class TestShellTest extends CakeTestCase {
$this->assertSame('My/File/Is/Here', $return);
}
/**
* testMapPluginFileToCategory
*
* @return void
*/
public function testMapPluginFileToCategory() {
$this->Shell->startup();
$return = $this->Shell->mapFileToCategory('Plugins/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');
$this->assertSame('awesome', $return);
}
/**
* testMapPluginFileToCase
*
* @return void
*/
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);
$this->assertSame('Controller/ExampleController', $return);
$return = $this->Shell->mapFileToCase('app/plugins/Awesome/Controller/ExampleController.php', 'awesome', false);
$this->assertSame('Controller/ExampleController', $return);
}
/**
* test available list of test cases for an empty category
*