Permalink
Browse files

whitespace normalization

  • Loading branch information...
AD7six gwoo
AD7six authored and gwoo committed Jul 26, 2009
1 parent 15ed658 commit b9987e171207a5bf4e3ea8e61e347fa0f316bf99
@@ -125,7 +125,7 @@ function stdout($string, $newline = true) {
* @return void
*/
function clear() {
-
+
}
/**
@@ -225,7 +225,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array('cake.php');
$expected = array(
'app' => 'app',
@@ -237,7 +236,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'cake.php',
'-app',
@@ -253,7 +251,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./cake.php',
'bake',
@@ -274,7 +271,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'bake',
@@ -293,7 +289,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'bake',
@@ -314,7 +309,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'-working',
@@ -340,11 +334,9 @@ function testParseParams() {
$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',
@@ -368,7 +360,6 @@ function testParseParams() {
$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(
@@ -386,12 +377,10 @@ function testParseParams() {
'root' => 'C:\wamp\www\apps\cake'
);
-
$Dispatcher->params = $Dispatcher->args = array();
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'cake.php',
'-working',
@@ -410,7 +399,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'cake.php',
'-working',
@@ -432,7 +420,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'/home/amelo/dev/cake-common/cake/console/cake.php',
'-root',
@@ -33,7 +33,6 @@
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
//require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
-
Mock::generatePartial(
'ShellDispatcher', 'TestDbConfigTaskMockShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
@@ -54,7 +53,7 @@ class TEST_DATABASE_CONFIG {
'database' => 'database_name',
'prefix' => '',
);
-
+
var $otherOne = array(
'driver' => 'mysql',
'persistent' => false,
@@ -73,6 +72,7 @@ class TEST_DATABASE_CONFIG {
* @subpackage cake.tests.cases.console.libs.tasks
*/
class DbConfigTaskTest extends CakeTestCase {
+
/**
* startTest method
*
@@ -88,6 +88,7 @@ function startTest() {
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
}
+
/**
* endTest method
*
@@ -98,6 +99,7 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
+
/**
* Test the getConfig method.
*
@@ -108,6 +110,7 @@ function testGetConfig() {
$result = $this->Task->getConfig();
$this->assertEqual($result, 'otherOne');
}
+
/**
* test that initialize sets the path up.
*
@@ -118,8 +121,9 @@ function testInitialize() {
$this->Task->initialize();
$this->assertFalse(empty($this->Task->path));
$this->assertEqual($this->Task->path, APP . 'config' . DS);
-
+
}
+
/**
* test execute and by extension __interactive
*
@@ -47,19 +47,22 @@
'Shell', 'MockFixtureModelTask',
array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll')
);
+
/**
* FixtureTaskTest class
*
* @package cake
* @subpackage cake.tests.cases.console.libs.tasks
*/
class FixtureTaskTest extends CakeTestCase {
+
/**
* fixtures
*
* @var array
**/
var $fixtures = array('core.article', 'core.comment');
+
/**
* startTest method
*
@@ -75,6 +78,7 @@ function startTest() {
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template->initialize();
}
+
/**
* endTest method
*
@@ -85,6 +89,7 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
+
/**
* test that initialize sets the path
*
@@ -97,6 +102,7 @@ function testConstruct() {
$expected = '/my/path/tests/fixtures/';
$this->assertEqual($Task->path, $expected);
}
+
/**
* test import option array generation
*
@@ -117,14 +123,15 @@ function testImportOptions() {
$result = $this->Task->importOptions('Article');
$expected = array();
$this->assertEqual($result, $expected);
-
+
$this->Task->setReturnValueAt(5, 'in', 'n');
$this->Task->setReturnValueAt(6, 'in', 'n');
$this->Task->setReturnValueAt(7, 'in', 'y');
$result = $this->Task->importOptions('Article');
$expected = array('fromTable' => true);
$this->assertEqual($result, $expected);
}
+
/**
* test generating a fixture with database conditions.
*
@@ -143,6 +150,7 @@ function testImportRecordsFromDatabaseWithConditions() {
$this->assertPattern('/Second Article/', $result, 'Missing import data %s');
$this->assertPattern('/Third Article/', $result, 'Missing import data %s');
}
+
/**
* test that execute passes runs bake depending with named model.
*
@@ -156,6 +164,7 @@ function testExecuteWithNamedModel() {
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
$this->Task->execute();
}
+
/**
* test that execute runs all() when args[0] = all
*
@@ -175,6 +184,7 @@ function testExecuteIntoAll() {
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
$this->Task->execute();
}
+
/**
* test interactive mode of execute
*
@@ -183,7 +193,7 @@ function testExecuteIntoAll() {
function testExecuteInteractive() {
$this->Task->connection = 'test_suite';
$this->Task->path = '/my/path/';
-
+
$this->Task->setReturnValue('in', 'y');
$this->Task->Model->setReturnValue('getName', 'Article');
$this->Task->Model->setReturnValue('getTable', 'articles', array('Article'));
@@ -192,6 +202,7 @@ function testExecuteInteractive() {
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
$this->Task->execute();
}
+
/**
* Test that bake works
*
@@ -225,6 +236,7 @@ function testBake() {
$this->assertNoPattern('/var \$fields/', $result);
$this->assertNoPattern('/var \$records/', $result);
}
+
/**
* Test that file generation includes headers and correct path for plugins.
*
@@ -241,6 +253,7 @@ function testGenerateFixtureFile() {
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms')));
$result = $this->Task->generateFixtureFile('Article', array());
}
+
/**
* test generating files into plugins.
*
Oops, something went wrong.

0 comments on commit b9987e1

Please sign in to comment.