moving shell.test.php to correct place in order to make code coverage possible for it; changing some whitespaces in shell.test.php

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7838 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-11-07 10:41:52 +00:00
parent b478cde990
commit df4a8bcd32
2 changed files with 13 additions and 27 deletions

View file

@ -60,7 +60,6 @@ class TestShellDispatcher extends ShellDispatcher {
$this->__initConstants(); $this->__initConstants();
$this->parseParams($args); $this->parseParams($args);
} }
} }
/** /**
* Short description for class. * Short description for class.
@ -86,28 +85,23 @@ class ShellDispatcherTest extends UnitTestCase {
'-working', '-working',
'/var/www/htdocs' '/var/www/htdocs'
); );
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => '/var/www/htdocs/new', 'working' => '/var/www/htdocs/new',
'root' => '/var/www/htdocs' 'root' => '/var/www/htdocs'
); );
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$params = array('cake.php'); $params = array('cake.php');
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'app', 'working' => CAKE_CORE_INCLUDE_PATH . DS . 'app',
'root' => CAKE_CORE_INCLUDE_PATH, 'root' => CAKE_CORE_INCLUDE_PATH,
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
@ -118,14 +112,12 @@ class ShellDispatcherTest extends UnitTestCase {
'-app', '-app',
'new', 'new',
); );
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new', 'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new',
'root' => CAKE_CORE_INCLUDE_PATH 'root' => CAKE_CORE_INCLUDE_PATH
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
@ -160,18 +152,17 @@ class ShellDispatcherTest extends UnitTestCase {
'-working', '-working',
'/cake/1.2.x.x/cake' '/cake/1.2.x.x/cake'
); );
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new', 'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new',
'root' => CAKE_CORE_INCLUDE_PATH 'root' => CAKE_CORE_INCLUDE_PATH
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$params = array( $params = array(
'./console/cake.php', './console/cake.php',
'bake', 'bake',
@ -181,7 +172,6 @@ class ShellDispatcherTest extends UnitTestCase {
'-working', '-working',
'/cake/1.2.x.x/cake' '/cake/1.2.x.x/cake'
); );
$expected = array( $expected = array(
'app' => 'new', 'app' => 'new',
'webroot' => 'webroot', 'webroot' => 'webroot',
@ -189,11 +179,11 @@ class ShellDispatcherTest extends UnitTestCase {
'root' => CAKE_CORE_INCLUDE_PATH, 'root' => CAKE_CORE_INCLUDE_PATH,
'dry' => 1 'dry' => 1
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$params = array( $params = array(
'./console/cake.php', './console/cake.php',
'-working', '-working',
@ -206,7 +196,6 @@ class ShellDispatcherTest extends UnitTestCase {
'-name', '-name',
'DbAcl' 'DbAcl'
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
@ -216,14 +205,15 @@ class ShellDispatcherTest extends UnitTestCase {
'f' => 1, 'f' => 1,
'name' => 'DbAcl' 'name' => 'DbAcl'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$expected = array('./console/cake.php', 'schema', 'run', 'create'); $expected = array('./console/cake.php', 'schema', 'run', 'create');
$this->assertEqual($expected, $Dispatcher->args); $this->assertEqual($expected, $Dispatcher->args);
$params = array( $params = array(
'/cake/1.2.x.x/cake/console/cake.php', '/cake/1.2.x.x/cake/console/cake.php',
'-working', '-working',
@ -235,7 +225,6 @@ class ShellDispatcherTest extends UnitTestCase {
'-name', '-name',
'DbAcl' 'DbAcl'
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
@ -244,14 +233,13 @@ class ShellDispatcherTest extends UnitTestCase {
'dry' => 1, 'dry' => 1,
'name' => 'DbAcl' 'name' => 'DbAcl'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$expected = array('/cake/1.2.x.x/cake/console/cake.php', 'schema', 'run', 'create'); $expected = array('/cake/1.2.x.x/cake/console/cake.php', 'schema', 'run', 'create');
$this->assertEqual($expected, $Dispatcher->args); $this->assertEqual($expected, $Dispatcher->args);
$params = array( $params = array(
'cake.php', 'cake.php',
'-working', '-working',
@ -260,7 +248,6 @@ class ShellDispatcherTest extends UnitTestCase {
'-app', '-app',
'C:/wamp/www/apps/cake/app', 'C:/wamp/www/apps/cake/app',
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
@ -268,10 +255,12 @@ class ShellDispatcherTest extends UnitTestCase {
'root' => 'C:\wamp\www\apps\cake' 'root' => 'C:\wamp\www\apps\cake'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
$params = array( $params = array(
'cake.php', 'cake.php',
'-working', '-working',
@ -280,14 +269,12 @@ class ShellDispatcherTest extends UnitTestCase {
'-app', '-app',
'C:\wamp\www\apps\cake\app', 'C:\wamp\www\apps\cake\app',
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => 'C:\wamp\www\apps\cake\app', 'working' => 'C:\wamp\www\apps\cake\app',
'root' => 'C:\wamp\www\apps\cake' 'root' => 'C:\wamp\www\apps\cake'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
@ -303,7 +290,6 @@ class ShellDispatcherTest extends UnitTestCase {
'-url', '-url',
'http://example.com/some/url/with/a/path' 'http://example.com/some/url/with/a/path'
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
@ -311,7 +297,6 @@ class ShellDispatcherTest extends UnitTestCase {
'root' => 'C:\wamp\www\apps\cake', 'root' => 'C:\wamp\www\apps\cake',
'url' => 'http://example.com/some/url/with/a/path' 'url' => 'http://example.com/some/url/with/a/path'
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);
@ -326,15 +311,12 @@ class ShellDispatcherTest extends UnitTestCase {
'-app', '-app',
'app', 'app',
); );
$expected = array( $expected = array(
'app' => 'app', 'app' => 'app',
'webroot' => 'webroot', 'webroot' => 'webroot',
'working' => '/home/amelo/dev/lsbu-vacancy/app', 'working' => '/home/amelo/dev/lsbu-vacancy/app',
'root' => '/home/amelo/dev/lsbu-vacancy', 'root' => '/home/amelo/dev/lsbu-vacancy',
); );
$Dispatcher->params = $Dispatcher->args = array(); $Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params); $Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params); $this->assertEqual($expected, $Dispatcher->params);

View file

@ -56,7 +56,6 @@ Mock::generate('ShellDispatcher');
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class CakeShellTestCase extends CakeTestCase { class CakeShellTestCase extends CakeTestCase {
var $fixtures = array('core.post', 'core.comment'); var $fixtures = array('core.post', 'core.comment');
/** /**
* setup * setup
@ -67,7 +66,12 @@ class CakeShellTestCase extends CakeTestCase {
$this->Dispatcher =& new MockShellDispatcher(); $this->Dispatcher =& new MockShellDispatcher();
$this->Shell =& new TestShell($this->Dispatcher); $this->Shell =& new TestShell($this->Dispatcher);
} }
/**
* undocumented function
*
* @return void
* @access public
*/
function testInitialize() { function testInitialize() {
$_back = array( $_back = array(
'modelPaths' => Configure::read('modelPaths'), 'modelPaths' => Configure::read('modelPaths'),