mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
b478cde990
commit
df4a8bcd32
2 changed files with 13 additions and 27 deletions
|
@ -60,7 +60,6 @@ class TestShellDispatcher extends ShellDispatcher {
|
|||
$this->__initConstants();
|
||||
$this->parseParams($args);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Short description for class.
|
||||
|
@ -86,28 +85,23 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-working',
|
||||
'/var/www/htdocs'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'new',
|
||||
'webroot' => 'webroot',
|
||||
'working' => '/var/www/htdocs/new',
|
||||
'root' => '/var/www/htdocs'
|
||||
);
|
||||
|
||||
$Dispatcher->parseParams($params);
|
||||
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$params = array('cake.php');
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'app',
|
||||
'root' => CAKE_CORE_INCLUDE_PATH,
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
@ -118,14 +112,12 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-app',
|
||||
'new',
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'new',
|
||||
'webroot' => 'webroot',
|
||||
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new',
|
||||
'root' => CAKE_CORE_INCLUDE_PATH
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
@ -160,18 +152,17 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-working',
|
||||
'/cake/1.2.x.x/cake'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'new',
|
||||
'webroot' => 'webroot',
|
||||
'working' => CAKE_CORE_INCLUDE_PATH . DS . 'new',
|
||||
'root' => CAKE_CORE_INCLUDE_PATH
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$params = array(
|
||||
'./console/cake.php',
|
||||
'bake',
|
||||
|
@ -181,7 +172,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-working',
|
||||
'/cake/1.2.x.x/cake'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'new',
|
||||
'webroot' => 'webroot',
|
||||
|
@ -189,11 +179,11 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'root' => CAKE_CORE_INCLUDE_PATH,
|
||||
'dry' => 1
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$params = array(
|
||||
'./console/cake.php',
|
||||
'-working',
|
||||
|
@ -206,7 +196,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-name',
|
||||
'DbAcl'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
|
@ -216,14 +205,15 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'f' => 1,
|
||||
'name' => 'DbAcl'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$expected = array('./console/cake.php', 'schema', 'run', 'create');
|
||||
$this->assertEqual($expected, $Dispatcher->args);
|
||||
|
||||
|
||||
$params = array(
|
||||
'/cake/1.2.x.x/cake/console/cake.php',
|
||||
'-working',
|
||||
|
@ -235,7 +225,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-name',
|
||||
'DbAcl'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
|
@ -244,14 +233,13 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'dry' => 1,
|
||||
'name' => 'DbAcl'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$expected = array('/cake/1.2.x.x/cake/console/cake.php', 'schema', 'run', 'create');
|
||||
$this->assertEqual($expected, $Dispatcher->args);
|
||||
|
||||
$params = array(
|
||||
'cake.php',
|
||||
'-working',
|
||||
|
@ -260,7 +248,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-app',
|
||||
'C:/wamp/www/apps/cake/app',
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
|
@ -268,10 +255,12 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'root' => 'C:\wamp\www\apps\cake'
|
||||
);
|
||||
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
||||
|
||||
$params = array(
|
||||
'cake.php',
|
||||
'-working',
|
||||
|
@ -280,14 +269,12 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-app',
|
||||
'C:\wamp\www\apps\cake\app',
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
'working' => 'C:\wamp\www\apps\cake\app',
|
||||
'root' => 'C:\wamp\www\apps\cake'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
@ -303,7 +290,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-url',
|
||||
'http://example.com/some/url/with/a/path'
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
|
@ -311,7 +297,6 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'root' => 'C:\wamp\www\apps\cake',
|
||||
'url' => 'http://example.com/some/url/with/a/path'
|
||||
);
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
@ -326,15 +311,12 @@ class ShellDispatcherTest extends UnitTestCase {
|
|||
'-app',
|
||||
'app',
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'app' => 'app',
|
||||
'webroot' => 'webroot',
|
||||
'working' => '/home/amelo/dev/lsbu-vacancy/app',
|
||||
'root' => '/home/amelo/dev/lsbu-vacancy',
|
||||
);
|
||||
|
||||
|
||||
$Dispatcher->params = $Dispatcher->args = array();
|
||||
$Dispatcher->parseParams($params);
|
||||
$this->assertEqual($expected, $Dispatcher->params);
|
||||
|
|
|
@ -56,7 +56,6 @@ Mock::generate('ShellDispatcher');
|
|||
* @subpackage cake.tests.cases.libs
|
||||
*/
|
||||
class CakeShellTestCase extends CakeTestCase {
|
||||
|
||||
var $fixtures = array('core.post', 'core.comment');
|
||||
/**
|
||||
* setup
|
||||
|
@ -67,7 +66,12 @@ class CakeShellTestCase extends CakeTestCase {
|
|||
$this->Dispatcher =& new MockShellDispatcher();
|
||||
$this->Shell =& new TestShell($this->Dispatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* undocumented function
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testInitialize() {
|
||||
$_back = array(
|
||||
'modelPaths' => Configure::read('modelPaths'),
|
Loading…
Add table
Reference in a new issue