Fixing some tests on ShellDispatcher to make them run on windows

This commit is contained in:
unknown 2011-06-20 17:58:51 -04:30
parent 08c72a6142
commit 0cc76b3a88

View file

@ -154,8 +154,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => '/var/www/htdocs/new', 'working' => str_replace('/', DS, '/var/www/htdocs/new'),
'root' => '/var/www/htdocs' 'root' => str_replace('/', DS,'/var/www/htdocs')
); );
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
@ -164,8 +164,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)), 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
@ -179,8 +179,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)) 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
@ -198,8 +198,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)) 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
@ -217,8 +217,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)) 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH))
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
@ -235,8 +235,8 @@ class ShellDispatcherTest extends CakeTestCase {
); );
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)), 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
'webroot' => 'webroot' 'webroot' => 'webroot'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
@ -258,8 +258,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'), 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'),
'root' => str_replace('\\', '/', dirname(CAKE_CORE_INCLUDE_PATH)), 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)),
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
@ -284,8 +284,8 @@ class ShellDispatcherTest extends CakeTestCase {
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => '/cake/1.2.x.x/app', 'working' => str_replace('/', DS, '/cake/1.2.x.x/app'),
'root' => '/cake/1.2.x.x', 'root' => str_replace('/', DS, '/cake/1.2.x.x'),
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
@ -375,9 +375,9 @@ class ShellDispatcherTest extends CakeTestCase {
'my_app', 'my_app',
); );
$expected = array( $expected = array(
'working' => 'D:\www', 'working' => 'D:\\\\www',
'app' => 'www', 'app' => 'www',
'root' => 'D:', 'root' => 'D:\\',
'webroot' => 'webroot' 'webroot' => 'webroot'
); );