Skip to content

Commit

Permalink
Fixing some shell tests when that fail when they are run in window
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 21, 2011
1 parent f4aeb51 commit d54f8dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/Cake/Console/Command/Task/TestTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,12 @@ public function getObjectType() {
public function getClassName($objectType) {
$type = strtolower($objectType);
if ($this->plugin) {
$path = Inflector::pluralize($type);
if ($type === 'helper') {
$path = 'View/Helper';
$type = 'View/Helper';
} elseif ($type === 'component') {
$path = 'Controller/Component';
$type = 'Controller/Component';
} elseif ($type === 'behavior') {
$path = 'Model/Behavior';
$type = 'Model/Behavior';
}
$plugin = $this->plugin . '.';
$options = App::objects($plugin . $type);
Expand Down Expand Up @@ -436,7 +435,7 @@ public function testCaseFileName($type, $className) {
if (!$this->interactive) {
$className = $this->getRealClassName($type, $className);
}
return $path . Inflector::camelize($className) . 'Test.php';
return str_replace('/', DS, $path) . Inflector::camelize($className) . 'Test.php';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public function testInteractiveWithPlugin() {
* @return void
*/
public function testTestCaseFileName() {
$this->Task->path = '/my/path/tests/';
$this->Task->path = DS . 'my' . DS . 'path' . DS . 'tests' . DS;

$result = $this->Task->testCaseFileName('Model', 'Post');
$expected = $this->Task->path . 'Case' . DS . 'Model' . DS . 'PostTest.php';
Expand Down

0 comments on commit d54f8dc

Please sign in to comment.