diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php
index 2baede3a89a..a7eecf63bfc 100644
--- a/cake/tests/cases/console/cake.test.php
+++ b/cake/tests/cases/console/cake.test.php
@@ -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',
diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php
index 4b510a523f5..fee7ad0a989 100644
--- a/cake/tests/cases/console/libs/tasks/db_config.test.php
+++ b/cake/tests/cases/console/libs/tasks/db_config.test.php
@@ -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
*
diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php
index 359dd476096..b4180ac2336 100644
--- a/cake/tests/cases/console/libs/tasks/fixture.test.php
+++ b/cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -47,6 +47,7 @@
'Shell', 'MockFixtureModelTask',
array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll')
);
+
/**
* FixtureTaskTest class
*
@@ -54,12 +55,14 @@
* @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,7 +123,7 @@ 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');
@@ -125,6 +131,7 @@ function testImportOptions() {
$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.
*
diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php
index 0283c5f70c5..8fd91fcc558 100644
--- a/cake/tests/cases/console/libs/tasks/test.test.php
+++ b/cake/tests/cases/console/libs/tasks/test.test.php
@@ -1,5 +1,6 @@
Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);
}
+
/**
* endTest method
*
@@ -145,13 +149,14 @@ function startTest() {
function endTest() {
ClassRegistry::flush();
}
+
/**
* Test that file path generation doesn't continuously append paths.
*
* @access public
* @return void
*/
- function testFilePathGeneration () {
+ function testFilePathGeneration() {
$file = TESTS . 'cases' . DS . 'models' . DS . 'my_class.test.php';
$this->Task->Dispatch->expectNever('stderr');
@@ -168,8 +173,9 @@ function testFilePathGeneration () {
$this->Task->expectAt(2, 'createFile', array($file, '*'));
$this->Task->bake('Controller', 'Comments');
}
+
/**
- * Test that method introspection pulls all relevant non parent class
+ * Test that method introspection pulls all relevant non parent class
* methods into the test case.
*
* @return void
@@ -179,6 +185,7 @@ function testMethodIntrospection() {
$expected = array('doSomething', 'doSomethingElse');
$this->assertEqual($result, $expected);
}
+
/**
* test that the generation of fixtures works correctly.
*
@@ -187,11 +194,12 @@ function testMethodIntrospection() {
function testFixtureArrayGenerationFromModel() {
$subject = ClassRegistry::init('TestTaskArticle');
$result = $this->Task->generateFixtureList($subject);
- $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
+ $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
'app.test_task_article', 'app.test_task_tag');
$this->assertEqual(sort($result), sort($expected));
}
+
/**
* test that the generation of fixtures works correctly.
*
@@ -200,11 +208,12 @@ function testFixtureArrayGenerationFromModel() {
function testFixtureArrayGenerationFromController() {
$subject = new TestTaskCommentsController();
$result = $this->Task->generateFixtureList($subject);
- $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
+ $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
'app.test_task_article', 'app.test_task_tag');
$this->assertEqual(sort($result), sort($expected));
}
+
/**
* test user interaction to get object type
*
@@ -219,6 +228,7 @@ function testGetObjectType() {
$result = $this->Task->getObjectType();
$this->assertEqual($result, $this->Task->classTypes[1]);
}
+
/**
* creating test subjects should clear the registry so the registry is always fresh
*
@@ -242,6 +252,7 @@ function testRegistryClearWhenBuildingTestObjects() {
$keys = ClassRegistry::keys();
$this->assertFalse(in_array('random', $keys));
}
+
/**
* test that getClassName returns the user choice as a classname.
*
@@ -262,6 +273,7 @@ function testGetClassName() {
$options = Configure::listObjects('model');
$this->assertEqual($result, $options[0]);
}
+
/**
* Test the user interaction for defining additional fixtures.
*
@@ -274,6 +286,7 @@ function testGetUserFixtures() {
$expected = array('app.pizza', 'app.topping', 'app.side_dish');
$this->assertEqual($result, $expected);
}
+
/**
* test that resolving classnames works
*
@@ -295,6 +308,7 @@ function testGetRealClassname() {
$result = $this->Task->getRealClassname('Component', 'Auth');
$this->assertEqual($result, 'AuthComponent');
}
+
/**
* test baking files.
*
@@ -323,6 +337,7 @@ function testBakeModelTest() {
$this->assertPattern("/'app\.test_task_tag'/", $result);
$this->assertPattern("/'app\.articles_tag'/", $result);
}
+
/**
* test baking controller test files, ensure that the stub class is generated.
*
@@ -352,6 +367,7 @@ function testBakeControllerTest() {
$this->assertPattern("/'app\.test_task_tag'/", $result);
$this->assertPattern("/'app\.articles_tag'/", $result);
}
+
/**
* test Constructor generation ensure that constructClasses is called for controllers
*
@@ -370,6 +386,7 @@ function testGenerateContsructor() {
$expected = "new FormHelper()\n";
$this->assertEqual($result, $expected);
}
+
/**
* Test that mock class generation works for the appropriate classes
*
@@ -379,6 +396,7 @@ function testMockClassGeneration() {
$result = $this->Task->hasMockClass('controller');
$this->assertTrue($result);
}
+
/**
* test bake() with a -plugin param
*
@@ -391,6 +409,7 @@ function testBakeWithPlugin() {
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->bake('Helper', 'Form');
}
+
/**
* Test filename generation for each type + plugins
*
@@ -424,6 +443,7 @@ function testTestCaseFileName() {
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
}
+
/**
* test execute with a type defined
*
@@ -436,6 +456,7 @@ function testExecuteWithOneArg() {
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
$this->Task->execute();
}
+
/**
* test execute with type and class name defined
*
diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/cake/tests/cases/libs/controller/components/cookie.test.php
index 778444e92e6..804fdda12ac 100644
--- a/cake/tests/cases/libs/controller/components/cookie.test.php
+++ b/cake/tests/cases/libs/controller/components/cookie.test.php
@@ -27,6 +27,7 @@
*/
App::import('Controller', array('Component', 'Controller'), false);
App::import('Component', 'Cookie');
+
/**
* CookieComponentTestController class
*
diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php
index 6d30d2bdf47..6293014b666 100644
--- a/cake/tests/cases/libs/model/model_delete.test.php
+++ b/cake/tests/cases/libs/model/model_delete.test.php
@@ -1,5 +1,6 @@
assertFalse($result);
}
+
/**
* testDeleteArticleBLinks method
*
@@ -151,6 +155,7 @@ function testDeleteArticleBLinks() {
);
$this->assertEqual($result, $expected);
}
+
/**
* testDeleteDependentWithConditions method
*
@@ -179,6 +184,7 @@ function testDeleteDependentWithConditions() {
$this->assertTrue(is_array($result));
$this->assertEqual($result, $expected);
}
+
/**
* testDel method
*
@@ -228,7 +234,6 @@ function testDel() {
$this->assertEqual($result, $expected);
-
// make sure deleting a non-existent record doesn't break save()
// ticket #6293
$this->loadFixtures('Uuid');
@@ -258,6 +263,7 @@ function testDel() {
'id' => 'B607DAB9-88A2-46CF-B57C-842CA9E3B3B3')));
$this->assertEqual($result, $expected);
}
+
/**
* testDeleteAll method
*
@@ -399,6 +405,7 @@ function testDeleteAll() {
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
}
+
/**
* testRecursiveDel method
*
@@ -434,6 +441,7 @@ function testRecursiveDel() {
$result = $TestModel->Comment->Attachment->find('count');
$this->assertEqual($result, 0);
}
+
/**
* testDependentExclusiveDelete method
*
@@ -452,6 +460,7 @@ function testDependentExclusiveDelete() {
$TestModel->delete(1);
$this->assertEqual($TestModel->Comment->find('count'), 2);
}
+
/**
* testDeleteLinks method
*
@@ -499,6 +508,7 @@ function testDeleteLinks() {
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
}
+
/**
* testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable method
*
diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/cake/tests/cases/libs/model/model_integration.test.php
index e213187b670..dda5578f186 100644
--- a/cake/tests/cases/libs/model/model_integration.test.php
+++ b/cake/tests/cases/libs/model/model_integration.test.php
@@ -1,5 +1,6 @@
assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
}
+
/**
* Tests that $cacheSources can only be disabled in the db using model settings, not enabled
*
@@ -64,6 +67,7 @@ function testCacheSourcesDisabling() {
$TestModel->setSource('join_as');
$this->assertFalse($this->db->cacheSources);
}
+
/**
* testPkInHabtmLinkModel method
*
@@ -92,6 +96,7 @@ function testPkInHabtmLinkModel() {
$this->assertEqual($TestModel4->JoinAsJoinB->primaryKey, 'id');
}
+
/**
* testDynamicBehaviorAttachment method
*
@@ -128,6 +133,7 @@ function testDynamicBehaviorAttachment() {
$this->assertEqual($TestModel->Behaviors->attached(), array());
$this->assertFalse(isset($TestModel->Behaviors->Tree));
}
+
/**
* Tests cross database joins. Requires $test and $test2 to both be set in DATABASE_CONFIG
* NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections,
@@ -490,6 +496,7 @@ function testCrossDatabaseJoins() {
$this->_fixtures[$this->_fixtureClassMap[$class]]->drop($db2);
}
}
+
/**
* testDisplayField method
*
@@ -506,6 +513,7 @@ function testDisplayField() {
$this->assertEqual($Person->displayField, 'name');
$this->assertEqual($Comment->displayField, 'id');
}
+
/**
* testSchema method
*
@@ -528,6 +536,7 @@ function testSchema() {
$this->assertEqual($Post->getColumnTypes(), array_combine($columns, $types));
}
+
/**
* test deconstruct() with time fields.
*
@@ -613,6 +622,7 @@ function testDeconstructFieldsTime() {
$TestModel->set($data);
$this->assertEqual($TestModel->data, $data);
}
+
/**
* testDeconstructFields with datetime, timestamp, and date fields
*
@@ -789,6 +799,7 @@ function testDeconstructFieldsDateTime() {
$TestModel->set($data);
$this->assertEqual($TestModel->data, $data);
}
+
/**
* testTablePrefixSwitching method
*
@@ -842,6 +853,7 @@ function testTablePrefixSwitching() {
$this->assertEqual($db2->fullTableName($TestModel, false), 'apples');
$this->assertEqual($db1->fullTableName($TestModel, false), 'apples');
}
+
/**
* Tests validation parameter order in custom validation methods
*
@@ -852,6 +864,7 @@ function testInvalidAssociation() {
$TestModel =& new ValidationTest1();
$this->assertNull($TestModel->getAssociated('Foo'));
}
+
/**
* testLoadModelSecondIteration method
*
@@ -868,6 +881,7 @@ function testLoadModelSecondIteration() {
$this->assertIsA($model->ModelC, 'ModelC');
$this->assertIsA($model->ModelC->ModelD, 'ModelD');
}
+
/**
* ensure that __exists is reset on create
*
@@ -889,6 +903,7 @@ function testResetOfExistsOnCreate() {
$result = $Article->read(null, 2);
$this->assertEqual($result['Article']['title'], 'Staying alive');
}
+
/**
* testPluginAssociations method
*
@@ -1013,6 +1028,7 @@ function testPluginAssociations() {
$this->assertEqual($result, $expected);
}
+
/**
* Tests getAssociated method
*
@@ -1161,6 +1177,7 @@ function testAutoConstructAssociations() {
$this->assertEqual($TestModel->Tag->name, 'Tag');
$this->assertEqual($TestFakeModel->Tag->name, 'Tag');
}
+
/**
* test Model::__construct
*
@@ -1181,6 +1198,7 @@ function testConstruct() {
$this->assertEqual($TestModel->actsAs, $expected);
$this->assertTrue(isset($TestModel->Behaviors->Containable));
}
+
/**
* test Model::__construct
*
@@ -1198,6 +1216,7 @@ function testConstructWithAlternateDataSource() {
$NewVoid =& new TheVoid(null, false, 'other');
$this->assertEqual('other', $NewVoid->useDbConfig);
}
+
/**
* testColumnTypeFetching method
*
@@ -1216,6 +1235,7 @@ function testColumnTypeFetching() {
$this->assertEqual($model->getColumnType('Tag.id'), 'integer');
$this->assertEqual($model->getColumnType('Article.id'), 'integer');
}
+
/**
* testHabtmUniqueKey method
*
@@ -1226,6 +1246,7 @@ function testHabtmUniqueKey() {
$model =& new Item();
$this->assertFalse($model->hasAndBelongsToMany['Portfolio']['unique']);
}
+
/**
* testIdentity method
*
@@ -1248,6 +1269,7 @@ function testIdentity() {
$expected = 'AnotherTest';
$this->assertEqual($result, $expected);
}
+
/**
* testWithAssociation method
*
@@ -1499,6 +1521,7 @@ function testWithAssociation() {
$this->assertEqual($result, $expected);
}
+
/**
* testFindSelfAssociations method
*
@@ -1608,6 +1631,7 @@ function testFindSelfAssociations() {
$this->assertEqual($result, $expected);
}
+
/**
* testDynamicAssociations method
*
@@ -1715,6 +1739,7 @@ function testDynamicAssociations() {
$this->assertEqual($result, $expected);
}
+
/**
* testCreation method
*
diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php
index 233a1b1e7d9..f6745d6d466 100644
--- a/cake/tests/cases/libs/model/model_read.test.php
+++ b/cake/tests/cases/libs/model/model_read.test.php
@@ -1,5 +1,6 @@
assertEqual($result['SomethingElse'][0]['JoinThing']['doomed'], 1);
$this->assertEqual($result['SomethingElse'][1]['JoinThing']['doomed'], 0);
}
+
/**
* testGroupBy method
*
@@ -196,28 +200,24 @@ function testGroupBy() {
));
$this->assertEqual($result, $expected);
-
$result = $Thread->find('all', array(
'conditions' => array('Thread.project_id' => 1),
'group' => array('project_id')
));
$this->assertEqual($result, $expected);
-
$result = $Thread->find('all', array(
'conditions' => array('Thread.project_id' => 1),
'group' => array('project_id', 'Project.id')
));
$this->assertEqual($result, $expected);
-
$result = $Thread->find('all', array(
'conditions' => array('Thread.project_id' => 1),
'group' => array('Thread.project_id', 'Project.id')
));
$this->assertEqual($result, $expected);
-
$expected = array(
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
array('Product' => array('type' => 'Food'), array('price' => 9)),
@@ -237,6 +237,7 @@ function testGroupBy() {
'order' => 'Product.type ASC'));
$this->assertEqual($result, $expected);
}
+
/**
* testOldQuery method
*
@@ -272,6 +273,7 @@ function testOldQuery() {
$this->assertTrue(isset($this->db->_queryCache[$query]));
$this->assertTrue(is_array($results));
}
+
/**
* testPreparedQuery method
*
@@ -353,6 +355,7 @@ function testPreparedQuery() {
$this->assertTrue(isset($this->db->_queryCache[$expected]));
}
+
/**
* testParameterMismatch method
*
@@ -374,6 +377,7 @@ function testParameterMismatch() {
ob_end_clean();
$this->assertEqual($result, null);
}
+
/**
* testVeryStrangeUseCase method
*
@@ -403,6 +407,7 @@ function testVeryStrangeUseCase() {
$result = $Article->query($query, $param);
ob_end_clean();
}
+
/**
* testRecursiveUnbind method
*
@@ -2997,6 +3002,7 @@ function testRecursiveUnbind() {
)));
$this->assertEqual($result, $expected);
}
+
/**
* testSelfAssociationAfterFind method
*
@@ -3024,6 +3030,7 @@ function testSelfAssociationAfterFind() {
}
$this->assertEqual($afterFindData, $noAfterFindData);
}
+
/**
* testFindAllThreaded method
*
@@ -3500,6 +3507,7 @@ function testFindAllThreaded() {
);
$this->assertEqual($result, $expected);
}
+
/**
* test find('neighbors')
*
@@ -3933,6 +3941,7 @@ function testFindCombinedRelations() {
));
$this->assertEqual($result, $expected);
}
+
/**
* testSaveEmpty method
*
@@ -4045,7 +4054,6 @@ function testFindAllWithConditionsHavingMixedDataTypes() {
$result = $TestModel->find('all', compact('conditions', 'recursive', 'order'));
$this->assertEqual($result, $expected);
-
$conditions = array('id' => array('1', 2, '3.0'));
$order = 'Article.id ASC';
$result = $TestModel->find('all', compact('recursive', 'conditions', 'order'));
@@ -4086,6 +4094,7 @@ function testFindAllWithConditionsHavingMixedDataTypes() {
);
$this->assertEqual($result, $expected);
}
+
/**
* testBindUnbind method
*
@@ -4545,6 +4554,7 @@ function testBindUnbind() {
$this->assertEqual($TestModel2->hasMany['NewFeatureSet'], $expected);
$this->assertTrue(is_object($TestModel2->NewFeatureSet));
}
+
/**
* testBindMultipleTimes method
*
@@ -4825,6 +4835,7 @@ function testAssociationAfterFind() {
);
$this->assertEqual($result[0]['Post'][0]['Comment'][0], $expected);
}
+
/**
* Tests that callbacks can be properly disabled
*
@@ -4851,6 +4862,7 @@ function testCallbackDisabling() {
$expected = array('mariano', 'nate', 'larry', 'garrett');
$this->assertEqual($result, $expected);
}
+
/**
* testMultipleBelongsToWithSameClass method
*
@@ -4949,6 +4961,7 @@ function testMultipleBelongsToWithSameClass() {
$this->assertEqual($result, $expected);
}
+
/**
* testHabtmRecursiveBelongsTo method
*
@@ -5007,6 +5020,7 @@ function testHabtmRecursiveBelongsTo() {
$this->assertEqual($result, $expected);
}
+
/**
* testHabtmFinderQuery method
*
@@ -5055,6 +5069,7 @@ function testHabtmFinderQuery() {
$this->assertEqual($result['Tag'], $expected);
}
+
/**
* testHabtmLimitOptimization method
*
@@ -5125,6 +5140,7 @@ function testHabtmLimitOptimization() {
$this->assertEqual($result, $expected);
}
+
/**
* testHasManyLimitOptimization method
*
@@ -5239,6 +5255,7 @@ function testHasManyLimitOptimization() {
$this->assertEqual($result, $expected);
}
+
/**
* testFindAllRecursiveSelfJoin method
*
@@ -5344,10 +5361,8 @@ function testFindAllRecursiveSelfJoin() {
)))));
$this->assertEqual($result, $expected);
-
-
-
}
+
/**
* testFindAllRecursiveWithHabtm method
*
@@ -5416,6 +5431,7 @@ function testFindAllRecursiveWithHabtm() {
$this->assertIdentical($result, $expected);
}
+
/**
* testReadFakeThread method
*
@@ -5480,6 +5496,7 @@ function testReadFakeThread() {
$this->db->fullDebug = $fullDebug;
$this->assertEqual($result, $expected);
}
+
/**
* testFindFakeThread method
*
@@ -5544,6 +5561,7 @@ function testFindFakeThread() {
$this->db->fullDebug = $fullDebug;
$this->assertEqual($result, $expected);
}
+
/**
* testFindAllFakeThread method
*
@@ -5764,6 +5782,7 @@ function testFindAllFakeThread() {
$this->db->fullDebug = $fullDebug;
$this->assertEqual($result, $expected);
}
+
/**
* testConditionalNumerics method
*
@@ -6011,6 +6030,7 @@ function testFindAll() {
$this->assertEqual($result, $expected);
}
}
+
/**
* test find('list') method
*
@@ -6274,6 +6294,7 @@ function testGenerateFindList() {
);
$this->assertEqual($result, $expected);
}
+
/**
* testFindField method
*
@@ -6303,6 +6324,7 @@ function testFindField() {
$result = $TestModel->field('COUNT(*)', true);
$this->assertEqual($result, 4);
}
+
/**
* testFindUnique method
*
@@ -6325,6 +6347,7 @@ function testFindUnique() {
'password' => '5f4dcc3b5aa765d61d8327deb882cf99'
)));
}
+
/**
* test find('count') method
*
@@ -6371,6 +6394,7 @@ function testFindCountDistinct() {
$result = $TestModel->find('count', array('fields' => 'DISTINCT name'));
$this->assertEqual($result, 4);
}
+
/**
* Test find(count) with Db::expression
*
@@ -6395,6 +6419,7 @@ function testFindCountWithDbExpressions() {
)));
$this->assertEqual($result, 1);
}
+
/**
* testFindMagic method
*
@@ -6426,6 +6451,7 @@ function testFindMagic() {
));
$this->assertEqual($result, $expected);
}
+
/**
* testRead method
*
@@ -6506,6 +6532,7 @@ function testRead() {
)));
$this->assertEqual($result, $expected);
}
+
/**
* testRecursiveRead method
*
@@ -6932,6 +6959,7 @@ function testRecursiveFindAll() {
)));
$this->assertEqual($result, $expected);
}
+
/**
* testRecursiveFindAllWithLimit method
*
diff --git a/cake/tests/cases/libs/model/model_validation.test.php b/cake/tests/cases/libs/model/model_validation.test.php
index b4dcf22fdad..94a3815028d 100644
--- a/cake/tests/cases/libs/model/model_validation.test.php
+++ b/cake/tests/cases/libs/model/model_validation.test.php
@@ -1,5 +1,6 @@
assertEqual($TestModel->invalidFields(), $expected);
}
+
/**
* Tests validation parameter fieldList in invalidFields
*
diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php
index c0f45af0280..a7a00e58cd8 100644
--- a/cake/tests/cases/libs/model/model_write.test.php
+++ b/cake/tests/cases/libs/model/model_write.test.php
@@ -1,5 +1,6 @@
JoinAsJoinB->findById(1);
$this->assertEqual($result['JoinAsJoinB']['other'], $updatedValue);
}
+
/**
* testSaveDateAsFirstEntry method
*
@@ -117,6 +121,7 @@ function testSaveDateAsFirstEntry() {
$this->assertEqual($testResult['Article']['created'], '2008-01-01 00:00:00');
}
+
/**
* testUnderscoreFieldSave method
*
@@ -142,6 +147,7 @@ function testUnderscoreFieldSave() {
$currentCount = $UnderscoreField->find('count');
$this->assertEqual($currentCount, 4);
}
+
/**
* testAutoSaveUuid method
*
@@ -167,6 +173,7 @@ function testAutoSaveUuid() {
);
$this->assertEqual(strlen($result['Uuid']['id']), 36);
}
+
/**
* testZeroDefaultFieldValue method
*
@@ -187,6 +194,7 @@ function testZeroDefaultFieldValue() {
$this->assertIdentical($result['DataTest']['count'], '0');
$this->assertIdentical($result['DataTest']['float'], '0');
}
+
/**
* testNonNumericHabtmJoinKey method
*
@@ -285,6 +293,7 @@ function testNonNumericHabtmJoinKey() {
));
$this->assertEqual($result, $expected);
}
+
/**
* Tests validation parameter order in custom validation methods
*
@@ -305,6 +314,7 @@ function testAllowSimulatedFields() {
));
$this->assertEqual($TestModel->data, $expected);
}
+
/**
* test that Caches are getting cleared on save().
* ensure that both inflections of controller names are getting cleared
@@ -342,6 +352,7 @@ function testCacheClearOnSave() {
Configure::write('Cache.check', $_back['check']);
Configure::write('Cache.disable', $_back['disable']);
}
+
/**
* testSaveWithCounterCache method
*
@@ -378,6 +389,7 @@ function testSaveWithCounterCache() {
$result = $TestModel->findById(2);
$this->assertIdentical($result['Syfile']['item_count'], '0');
}
+
/**
* Tests that counter caches are updated when records are added
*
@@ -403,6 +415,7 @@ function testCounterCacheIncrease() {
$expected = 3;
$this->assertEqual($result, $expected);
}
+
/**
* Tests that counter caches are updated when records are deleted
*
@@ -424,6 +437,7 @@ function testCounterCacheDecrease() {
$expected = 1;
$this->assertEqual($result, $expected);
}
+
/**
* Tests that counter caches are updated when foreign keys of counted records change
*
@@ -446,6 +460,7 @@ function testCounterCacheUpdated() {
$this->assertEqual($users[0]['User']['post_count'], 1);
$this->assertEqual($users[1]['User']['post_count'], 2);
}
+
/**
* Test counter cache with models that use a non-standard (i.e. not using 'id')
* as their primary key.
@@ -453,14 +468,14 @@ function testCounterCacheUpdated() {
* @access public
* @return void
*/
- function testCounterCacheWithNonstandardPrimaryKey() {
- $this->loadFixtures(
+ function testCounterCacheWithNonstandardPrimaryKey() {
+ $this->loadFixtures(
'CounterCacheUserNonstandardPrimaryKey',
'CounterCachePostNonstandardPrimaryKey'
);
- $User = new CounterCacheUserNonstandardPrimaryKey();
- $Post = new CounterCachePostNonstandardPrimaryKey();
+ $User = new CounterCacheUserNonstandardPrimaryKey();
+ $Post = new CounterCachePostNonstandardPrimaryKey();
$data = $Post->find('first', array(
'conditions' => array('pid' => 1),
@@ -472,7 +487,7 @@ function testCounterCacheWithNonstandardPrimaryKey() {
$users = $User->find('all',array('order' => 'User.uid'));
$this->assertEqual($users[0]['User']['post_count'], 1);
$this->assertEqual($users[1]['User']['post_count'], 2);
- }
+ }
/**
* test Counter Cache With Self Joining table
@@ -502,6 +517,7 @@ function testCounterCacheWithSelfJoin() {
$expected = array_fill(0, 1, 1);
$this->assertEqual($result, $expected);
}
+
/**
* testSaveWithCounterCacheScope method
*
@@ -541,6 +557,7 @@ function testSaveWithCounterCacheScope() {
$result = $TestModel->findById(1);
$this->assertIdentical($result['Syfile']['item_count'], '1');
}
+
/**
* testValidatesBackwards method
*
@@ -606,6 +623,7 @@ function testValidatesBackwards() {
$result = $TestModel->validates();
$this->assertTrue($result);
}
+
/**
* testValidates method
*
@@ -958,6 +976,7 @@ function testValidates() {
);
$this->assertEqual($result, $expected);
}
+
/**
* testSaveField method
*
@@ -1026,6 +1045,7 @@ function testSaveField() {
$result = $Node->read();
$this->assertEqual(Set::extract('/ParentNode/name', $result), array('Second'));
}
+
/**
* testSaveWithCreate method
*
@@ -1247,6 +1267,7 @@ function testSaveWithCreate() {
$this->assertEqual($result, $expected);
}
+
/**
* testSaveWithSet method
*
@@ -1374,6 +1395,7 @@ function testSaveWithSet() {
);
$this->assertEqual($result, $expected);
}
+
/**
* testSaveWithNonExistentFields method
*
@@ -1425,6 +1447,7 @@ function testSaveWithNonExistentFields() {
$result = $TestModel->read(array('id', 'user_id', 'title', 'body', 'published'), 5);
$this->assertEqual($result, $expected);
}
+
/**
* testSaveFromXml method
*
@@ -1442,6 +1465,7 @@ function testSaveFromXml() {
$results = $Article->find(array('Article.title' => 'test xml'));
$this->assertTrue($results);
}
+
/**
* testSaveHabtm method
*
@@ -1913,6 +1937,7 @@ function testSaveHabtm() {
$expected = array('new record', 'new record');
$this->assertEqual(Set::extract('/JoinC/JoinAsJoinC/other', $result), $expected);
}
+
/**
* testSaveHabtmCustomKeys method
*
@@ -1963,6 +1988,7 @@ function testSaveHabtmCustomKeys() {
));
$this->assertEqual($result, $expected);
}
+
/**
* testHabtmSaveKeyResolution method
*
@@ -2052,6 +2078,7 @@ function testHabtmSaveKeyResolution() {
));
$this->assertEqual($result['Monkey'], $expected);
}
+
/**
* testCreationOfEmptyRecord method
*
@@ -2071,6 +2098,7 @@ function testCreationOfEmptyRecord() {
$this->assertTrue(isset($result['Author']['updated']));
$this->assertEqual($TestModel->find('count'), 1);
}
+
/**
* testCreateWithPKFiltering method
*
@@ -2167,6 +2195,7 @@ function testCreateWithPKFiltering() {
$this->assertEqual($result, $expected);
$this->assertFalse($TestModel->id);
}
+
/**
* testCreationWithMultipleData method
*
@@ -2338,6 +2367,7 @@ function testCreationWithMultipleData() {
))));
}
+
/**
* testCreationWithMultipleDataSameModel method
*
@@ -2396,6 +2426,7 @@ function testCreationWithMultipleDataSameModel() {
'title' => 'Brand New Article'
))));
}
+
/**
* testCreationWithMultipleDataSameModelManualInstances method
*
@@ -2434,6 +2465,7 @@ function testCreationWithMultipleDataSameModelManualInstances() {
$result = $Primary->find('count');
$this->assertEqual($result, 2);
}
+
/**
* testRecordExists method
*
@@ -2457,6 +2489,7 @@ function testRecordExists() {
$TestModel->id = 5;
$this->assertFalse($TestModel->exists());
}
+
/**
* testUpdateExisting method
*
@@ -2504,6 +2537,7 @@ function testUpdateExisting() {
$result = $Comment->save($data);
$this->assertTrue($result);
}
+
/**
* testUpdateMultiple method
*
@@ -2537,6 +2571,7 @@ function testUpdateMultiple() {
$expected = array_fill(0, 2, 'Updated today');
$this->assertEqual($result, $expected);
}
+
/**
* testHabtmUuidWithUuidId method
*
@@ -2556,6 +2591,7 @@ function testHabtmUuidWithUuidId() {
$this->assertEqual(1, count($result['Uuiditem']));
$this->assertEqual(strlen($result['Uuiditem'][0]['UuiditemsUuidportfolio']['id']), 36);
}
+
/**
* test HABTM saving when join table has no primary key and only 2 columns.
*
@@ -2579,6 +2615,7 @@ function testHabtmSavingWithNoPrimaryKeyUuidJoinTable() {
);
$this->assertTrue($Fruit->save($data));
}
+
/**
* test HABTM saving when join table has no primary key and only 2 columns, no with model is used.
*
@@ -2621,6 +2658,7 @@ function testHabtmUuidWithNumericId() {
$result = $TestModel->read(null, $id);
$this->assertEqual(1, count($result['Uuidportfolio']));
}
+
/**
* testSaveMultipleHabtm method
*
@@ -2739,6 +2777,7 @@ function testSaveMultipleHabtm() {
$this->assertEqual($result, $expected);
}
+
/**
* testSaveAll method
*
@@ -2878,6 +2917,7 @@ function testSaveAll() {
);
$this->assertEqual($result[6]['Attachment'], $expected);
}
+
/**
* Test SaveAll with Habtm relations
*
@@ -2909,6 +2949,7 @@ function testSaveAllHabtm() {
$this->assertEqual(count($result['Comment']), 1);
$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);
}
+
/**
* Test SaveAll with Habtm relations and extra join table fields
*
@@ -2952,6 +2993,7 @@ function testSaveAllHabtmWithExtraJoinTableFields() {
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[something_else_id=3]', $result));
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[doomed=1]', $result));
}
+
/**
* testSaveAllHasOne method
*
@@ -2991,6 +3033,7 @@ function testSaveAllHasOne() {
)));
$this->assertEqual($result, $expected);
}
+
/**
* testSaveAllBelongsTo method
*
@@ -3030,6 +3073,7 @@ function testSaveAllBelongsTo() {
)));
$this->assertEqual($result, $expected);
}
+
/**
* testSaveAllHasOneValidation method
*
@@ -3076,6 +3120,7 @@ function testSaveAllHasOneValidation() {
$this->assertEqual($model->validationErrors, $expected['Comment']);
$this->assertEqual($model->Attachment->validationErrors, $expected['Attachment']);
}
+
/**
* testSaveAllAtomic method
*
@@ -3149,6 +3194,7 @@ function testSaveAllAtomic() {
), array('atomic' => false));
$this->assertIdentical($result, array('Article' => true, 'Comment' => array(true, true)));
}
+
/**
* testSaveAllHasMany method
*
@@ -3225,6 +3271,7 @@ function testSaveAllHasMany() {
);
$this->assertEqual(Set::extract($result['Comment'], '{n}.comment'), $expected);
}
+
/**
* testSaveAllHasManyValidation method
*
@@ -3265,6 +3312,7 @@ function testSaveAllHasManyValidation() {
))
), array('validate' => 'only'));
}
+
/**
* testSaveAllTransaction method
*
@@ -3654,6 +3702,7 @@ function testSaveAllValidation() {
$TestModel->validate['body'] = 'notEmpty';
}
+
/**
* testSaveAllValidationOnly method
*
@@ -3706,6 +3755,7 @@ function testSaveAllValidationOnly() {
);
$this->assertEqual($TestModel->validationErrors, $expected);
}
+
/**
* testSaveAllValidateFirst method
*
@@ -3784,6 +3834,7 @@ function testSaveAllValidateFirst() {
);
$this->assertEqual($result[0]['Comment'][0]['comment'], 'Only new comment');
}
+
/**
* testUpdateWithCalculation method
*
@@ -3812,6 +3863,7 @@ function testUpdateWithCalculation() {
$result = Set::extract('/DataTest/count', $model->find('all', array('fields' => 'count')));
$this->assertEqual($result, array(6, 4, 5, 2));
}
+
/**
* testSaveAllHasManyValidationOnly method
*
diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php
index 2e75b36dd48..e4ab3333b44 100644
--- a/cake/tests/lib/cake_test_fixture.php
+++ b/cake/tests/lib/cake_test_fixture.php
@@ -40,6 +40,7 @@ class CakeTestFixture extends Object {
* @var string
**/
var $name = null;
+
/**
* Cake's DBO driver (e.g: DboMysql).
*
@@ -53,6 +54,7 @@ class CakeTestFixture extends Object {
* @access public
*/
var $table = null;
+
/**
* Instantiate the fixture.
*
diff --git a/cake/tests/test_app/views/layouts/cache_layout.ctp b/cake/tests/test_app/views/layouts/cache_layout.ctp
index 46784c1df6b..7ac370f3b8d 100644
--- a/cake/tests/test_app/views/layouts/cache_layout.ctp
+++ b/cake/tests/test_app/views/layouts/cache_layout.ctp
@@ -35,5 +35,4 @@
Additional regular text.
- +Additional regular text.
\ No newline at end of file diff --git a/cake/tests/test_app/views/layouts/email/text/default.ctp b/cake/tests/test_app/views/layouts/email/text/default.ctp index bfc1ef55277..5fc1645acba 100644 --- a/cake/tests/test_app/views/layouts/email/text/default.ctp +++ b/cake/tests/test_app/views/layouts/email/text/default.ctp @@ -26,4 +26,4 @@ -This email was sent using the CakePHP Framework, http://cakephp.org. +This email was sent using the CakePHP Framework, http://cakephp.org. \ No newline at end of file