Permalink
Browse files

Adding a test case for the issue fixed in #1408.

Fixing issue where -app command did not work as expected.
Fixes #1601
  • Loading branch information...
1 parent 33afe21 commit e2773242f7aad215834071837461b946f0dc5c5c @markstory markstory committed Mar 21, 2011
Showing with 18 additions and 0 deletions.
  1. +1 −0 cake/console/cake.php
  2. +17 −0 cake/tests/cases/console/cake.test.php
@@ -519,6 +519,7 @@ function parseParams($params) {
$params['root'] .= '/' . dirname($params['app']);
}
+ $params['app'] = basename($params['app']);
$params['working'] = rtrim($params['root'], '/');
if (!$isWin || !preg_match('/^[A-Z]:$/i', $params['app'])) {
$params['working'] .= '/' . $params['app'];
@@ -451,6 +451,23 @@ function testParseParams() {
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+
+ $params = array(
+ 'cake.php',
+ '-working',
+ 'D:\ ',
+ 'bake',
+ 'my_app',
+ );
+ $expected = array(
+ 'working' => '.',
+ 'app' => 'D:',
+ 'root' => '.',
+ 'webroot' => 'webroot'
+ );
+ $Dispatcher->params = $Dispatcher->args = array();
+ $Dispatcher->parseParams($params);
+ $this->assertEqual($expected, $Dispatcher->params);
}
/**

0 comments on commit e277324

Please sign in to comment.