Permalink
Browse files

Fixing some tests on ShellDispatcher to make them run on windows

  • Loading branch information...
1 parent 08c72a6 commit 0cc76b3a88057cfddcda85da5e2e63a72790b956 unknown committed Jun 20, 2011
Showing with 18 additions and 18 deletions.
  1. +18 −18 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
View
36 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
@@ -154,8 +154,8 @@ public function testParseParams() {
$expected = array(
'app' => 'new',
'webroot' => 'webroot',
- 'working' => '/var/www/htdocs/new',
- 'root' => '/var/www/htdocs'
+ 'working' => str_replace('/', DS, '/var/www/htdocs/new'),
+ 'root' => str_replace('/', DS,'/var/www/htdocs')
);
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
@@ -164,8 +164,8 @@ public function testParseParams() {
$expected = array(
'app' => 'app',
'webroot' => 'webroot',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)),
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
);
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
@@ -179,8 +179,8 @@ public function testParseParams() {
$expected = array(
'app' => 'new',
'webroot' => 'webroot',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH))
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
);
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
@@ -198,8 +198,8 @@ public function testParseParams() {
$expected = array(
'app' => 'new',
'webroot' => 'webroot',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH))
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
);
$Dispatcher->params = $Dispatcher->args = array();
@@ -217,8 +217,8 @@ public function testParseParams() {
$expected = array(
'app' => 'new',
'webroot' => 'webroot',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH))
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
);
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
@@ -235,8 +235,8 @@ public function testParseParams() {
);
$expected = array(
'app' => 'new',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)),
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
'webroot' => 'webroot'
);
$Dispatcher->params = $Dispatcher->args = array();
@@ -258,8 +258,8 @@ public function testParseParams() {
$expected = array(
'app' => 'app',
'webroot' => 'webroot',
- 'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
- 'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)),
+ 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
+ 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
);
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
@@ -284,8 +284,8 @@ public function testParseParams() {
$expected = array(
'app' => 'app',
'webroot' => 'webroot',
- 'working' => '/cake/1.2.x.x/app',
- 'root' => '/cake/1.2.x.x',
+ 'working' => str_replace('/', DS, '/cake/1.2.x.x/app'),
+ 'root' => str_replace('/', DS, '/cake/1.2.x.x'),
);
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
@@ -375,9 +375,9 @@ public function testParseParams() {
'my_app',
);
$expected = array(
- 'working' => 'D:\www',
+ 'working' => 'D:\\\\www',
'app' => 'www',
- 'root' => 'D:',
+ 'root' => 'D:\\',
'webroot' => 'webroot'
);

0 comments on commit 0cc76b3

Please sign in to comment.