Permalink
Browse files

whitespace normalization

  • Loading branch information...
1 parent 062f471 commit f64f4cbddc8a4edd4bac50044ea18bb6687b6069 AD7six committed Jul 26, 2009
@@ -116,7 +116,7 @@ function stdout($string, $newline = true) {
* @return void
*/
function clear() {
-
+
}
/**
@@ -192,7 +192,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array('cake.php');
$expected = array(
'app' => 'app',
@@ -204,7 +203,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'cake.php',
'-app',
@@ -220,7 +218,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./cake.php',
'bake',
@@ -241,7 +238,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'bake',
@@ -260,7 +256,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'bake',
@@ -281,7 +276,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'./console/cake.php',
'-working',
@@ -307,11 +301,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',
@@ -335,7 +327,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(
@@ -353,12 +344,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',
@@ -377,7 +366,6 @@ function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
-
$params = array(
'cake.php',
'-working',
@@ -399,7 +387,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 f64f4cb

Please sign in to comment.