mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Revert "Merge branch '1.3-newlines' into 1.3"
This reverts commit c088131cd8e9f53396852e8a320e2b0396807d20, reversing changes made to 9341a2bb5eda1db208019aa8a9171224fb76fc6b.
This commit is contained in:
parent
ffe801bb28
commit
15ed658a27
27 changed files with 86 additions and 227 deletions
|
@ -29,6 +29,7 @@
|
||||||
<?php echo $html->charset(); ?>
|
<?php echo $html->charset(); ?>
|
||||||
<title><?php echo $page_title; ?></title>
|
<title><?php echo $page_title; ?></title>
|
||||||
|
|
||||||
|
|
||||||
<?php if (Configure::read() == 0) { ?>
|
<?php if (Configure::read() == 0) { ?>
|
||||||
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
|
<meta http-equiv="Refresh" content="<?php echo $pause?>;url=<?php echo $url?>"/>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
@ -165,6 +165,7 @@ class Debugger extends Object {
|
||||||
$this->_templates['js']['code'] = '<div id="{:id}-code" class="cake-code-dump" ';
|
$this->_templates['js']['code'] = '<div id="{:id}-code" class="cake-code-dump" ';
|
||||||
$this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>';
|
$this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>';
|
||||||
|
|
||||||
|
|
||||||
$e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} ';
|
$e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} ';
|
||||||
$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
|
$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
|
||||||
$this->_templates['html']['error'] = $e;
|
$this->_templates['html']['error'] = $e;
|
||||||
|
|
|
@ -367,6 +367,7 @@ class CakeSchema extends Object {
|
||||||
}
|
}
|
||||||
$out .="}\n";
|
$out .="}\n";
|
||||||
|
|
||||||
|
|
||||||
$File =& new File($path . DS . $file, true);
|
$File =& new File($path . DS . $file, true);
|
||||||
$header = '$Id';
|
$header = '$Id';
|
||||||
$content = "<?php \n/* SVN FILE: {$header}$ */\n/* {$name} schema generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>";
|
$content = "<?php \n/* SVN FILE: {$header}$ */\n/* {$name} schema generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>";
|
||||||
|
|
|
@ -204,7 +204,6 @@ class DboOracle extends DboSource {
|
||||||
}
|
}
|
||||||
return $this->connected;
|
return $this->connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keeps track of the most recent Oracle error
|
* Keeps track of the most recent Oracle error
|
||||||
*
|
*
|
||||||
|
@ -1073,6 +1072,7 @@ class DboOracle extends DboSource {
|
||||||
$q = str_replace('= (', 'IN (', $q);
|
$q = str_replace('= (', 'IN (', $q);
|
||||||
$q = str_replace(' WHERE 1 = 1', '', $q);
|
$q = str_replace(' WHERE 1 = 1', '', $q);
|
||||||
|
|
||||||
|
|
||||||
$q = $this->insertQueryData($q, null, $association, $assocData, $model, $linkModel, $stack);
|
$q = $this->insertQueryData($q, null, $association, $assocData, $model, $linkModel, $stack);
|
||||||
if ($q != false) {
|
if ($q != false) {
|
||||||
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
|
$res = $this->fetchAll($q, $model->cacheQueries, $model->alias);
|
||||||
|
@ -1142,7 +1142,6 @@ class DboOracle extends DboSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a "drop table" statement for the given Schema object
|
* Generate a "drop table" statement for the given Schema object
|
||||||
*
|
*
|
||||||
|
|
|
@ -508,6 +508,7 @@ class AjaxHelper extends AppHelper {
|
||||||
$options = $this->_optionsToString($options, array('paramName', 'indicator'));
|
$options = $this->_optionsToString($options, array('paramName', 'indicator'));
|
||||||
$options = $this->_buildOptions($options, $this->autoCompleteOptions);
|
$options = $this->_buildOptions($options, $this->autoCompleteOptions);
|
||||||
|
|
||||||
|
|
||||||
$text = $this->Form->text($field, $htmlOptions);
|
$text = $this->Form->text($field, $htmlOptions);
|
||||||
$div = $this->Html->div(null, '', $divOptions);
|
$div = $this->Html->div(null, '', $divOptions);
|
||||||
$script = "{$var}new Ajax.Autocompleter('{$htmlOptions['id']}', '{$divOptions['id']}', '";
|
$script = "{$var}new Ajax.Autocompleter('{$htmlOptions['id']}', '{$divOptions['id']}', '";
|
||||||
|
@ -1017,4 +1018,5 @@ class AjaxHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -168,4 +168,5 @@ class XmlHelper extends AppHelper {
|
||||||
return $data->toString($options + array('header' => false));
|
return $data->toString($options + array('header' => false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -225,6 +225,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -236,6 +237,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$Dispatcher->parseParams($params);
|
$Dispatcher->parseParams($params);
|
||||||
$this->assertEqual($expected, $Dispatcher->params);
|
$this->assertEqual($expected, $Dispatcher->params);
|
||||||
|
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'cake.php',
|
'cake.php',
|
||||||
'-app',
|
'-app',
|
||||||
|
@ -251,6 +253,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$Dispatcher->parseParams($params);
|
$Dispatcher->parseParams($params);
|
||||||
$this->assertEqual($expected, $Dispatcher->params);
|
$this->assertEqual($expected, $Dispatcher->params);
|
||||||
|
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'./cake.php',
|
'./cake.php',
|
||||||
'bake',
|
'bake',
|
||||||
|
@ -271,6 +274,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -289,6 +293,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -309,6 +314,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -334,9 +340,11 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -360,6 +368,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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(
|
||||||
|
@ -377,10 +386,12 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
'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',
|
||||||
|
@ -399,6 +410,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$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',
|
||||||
|
@ -420,6 +432,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
||||||
$Dispatcher->parseParams($params);
|
$Dispatcher->parseParams($params);
|
||||||
$this->assertEqual($expected, $Dispatcher->params);
|
$this->assertEqual($expected, $Dispatcher->params);
|
||||||
|
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'/home/amelo/dev/cake-common/cake/console/cake.php',
|
'/home/amelo/dev/cake-common/cake/console/cake.php',
|
||||||
'-root',
|
'-root',
|
||||||
|
|
|
@ -33,6 +33,7 @@ if (!class_exists('ShellDispatcher')) {
|
||||||
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
|
require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php';
|
||||||
//require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
//require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
|
||||||
|
|
||||||
|
|
||||||
Mock::generatePartial(
|
Mock::generatePartial(
|
||||||
'ShellDispatcher', 'TestDbConfigTaskMockShellDispatcher',
|
'ShellDispatcher', 'TestDbConfigTaskMockShellDispatcher',
|
||||||
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
|
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
|
||||||
|
@ -72,7 +73,6 @@ class TEST_DATABASE_CONFIG {
|
||||||
* @subpackage cake.tests.cases.console.libs.tasks
|
* @subpackage cake.tests.cases.console.libs.tasks
|
||||||
*/
|
*/
|
||||||
class DbConfigTaskTest extends CakeTestCase {
|
class DbConfigTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* startTest method
|
* startTest method
|
||||||
*
|
*
|
||||||
|
@ -88,7 +88,6 @@ class DbConfigTaskTest extends CakeTestCase {
|
||||||
$this->Task->params['working'] = rtrim(APP, '/');
|
$this->Task->params['working'] = rtrim(APP, '/');
|
||||||
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
|
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* endTest method
|
* endTest method
|
||||||
*
|
*
|
||||||
|
@ -99,7 +98,6 @@ class DbConfigTaskTest extends CakeTestCase {
|
||||||
unset($this->Task, $this->Dispatcher);
|
unset($this->Task, $this->Dispatcher);
|
||||||
ClassRegistry::flush();
|
ClassRegistry::flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the getConfig method.
|
* Test the getConfig method.
|
||||||
*
|
*
|
||||||
|
@ -110,7 +108,6 @@ class DbConfigTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->getConfig();
|
$result = $this->Task->getConfig();
|
||||||
$this->assertEqual($result, 'otherOne');
|
$this->assertEqual($result, 'otherOne');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that initialize sets the path up.
|
* test that initialize sets the path up.
|
||||||
*
|
*
|
||||||
|
@ -123,7 +120,6 @@ class DbConfigTaskTest extends CakeTestCase {
|
||||||
$this->assertEqual($this->Task->path, APP . 'config' . DS);
|
$this->assertEqual($this->Task->path, APP . 'config' . DS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test execute and by extension __interactive
|
* test execute and by extension __interactive
|
||||||
*
|
*
|
||||||
|
|
|
@ -47,7 +47,6 @@ Mock::generatePartial(
|
||||||
'Shell', 'MockFixtureModelTask',
|
'Shell', 'MockFixtureModelTask',
|
||||||
array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll')
|
array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll')
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FixtureTaskTest class
|
* FixtureTaskTest class
|
||||||
*
|
*
|
||||||
|
@ -55,14 +54,12 @@ Mock::generatePartial(
|
||||||
* @subpackage cake.tests.cases.console.libs.tasks
|
* @subpackage cake.tests.cases.console.libs.tasks
|
||||||
*/
|
*/
|
||||||
class FixtureTaskTest extends CakeTestCase {
|
class FixtureTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fixtures
|
* fixtures
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
**/
|
**/
|
||||||
var $fixtures = array('core.article', 'core.comment');
|
var $fixtures = array('core.article', 'core.comment');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* startTest method
|
* startTest method
|
||||||
*
|
*
|
||||||
|
@ -78,7 +75,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->Dispatch->shellPaths = App::path('shells');
|
$this->Task->Dispatch->shellPaths = App::path('shells');
|
||||||
$this->Task->Template->initialize();
|
$this->Task->Template->initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* endTest method
|
* endTest method
|
||||||
*
|
*
|
||||||
|
@ -89,7 +85,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
unset($this->Task, $this->Dispatcher);
|
unset($this->Task, $this->Dispatcher);
|
||||||
ClassRegistry::flush();
|
ClassRegistry::flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that initialize sets the path
|
* test that initialize sets the path
|
||||||
*
|
*
|
||||||
|
@ -102,7 +97,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$expected = '/my/path/tests/fixtures/';
|
$expected = '/my/path/tests/fixtures/';
|
||||||
$this->assertEqual($Task->path, $expected);
|
$this->assertEqual($Task->path, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test import option array generation
|
* test import option array generation
|
||||||
*
|
*
|
||||||
|
@ -131,7 +125,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$expected = array('fromTable' => true);
|
$expected = array('fromTable' => true);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test generating a fixture with database conditions.
|
* test generating a fixture with database conditions.
|
||||||
*
|
*
|
||||||
|
@ -150,7 +143,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->assertPattern('/Second Article/', $result, 'Missing import data %s');
|
$this->assertPattern('/Second Article/', $result, 'Missing import data %s');
|
||||||
$this->assertPattern('/Third 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.
|
* test that execute passes runs bake depending with named model.
|
||||||
*
|
*
|
||||||
|
@ -164,7 +156,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
|
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that execute runs all() when args[0] = all
|
* test that execute runs all() when args[0] = all
|
||||||
*
|
*
|
||||||
|
@ -184,7 +175,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
|
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test interactive mode of execute
|
* test interactive mode of execute
|
||||||
*
|
*
|
||||||
|
@ -202,7 +192,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
|
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that bake works
|
* Test that bake works
|
||||||
*
|
*
|
||||||
|
@ -236,7 +225,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->assertNoPattern('/var \$fields/', $result);
|
$this->assertNoPattern('/var \$fields/', $result);
|
||||||
$this->assertNoPattern('/var \$records/', $result);
|
$this->assertNoPattern('/var \$records/', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that file generation includes headers and correct path for plugins.
|
* Test that file generation includes headers and correct path for plugins.
|
||||||
*
|
*
|
||||||
|
@ -253,7 +241,6 @@ class FixtureTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms')));
|
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms')));
|
||||||
$result = $this->Task->generateFixtureFile('Article', array());
|
$result = $this->Task->generateFixtureFile('Article', array());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test generating files into plugins.
|
* test generating files into plugins.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id$ */
|
/* SVN FILE: $Id$ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TestTaskTest file
|
* TestTaskTest file
|
||||||
*
|
*
|
||||||
|
@ -93,7 +92,6 @@ class TestTaskTag extends Model {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simulated Plugin
|
* Simulated Plugin
|
||||||
**/
|
**/
|
||||||
|
@ -125,7 +123,6 @@ class TestTaskCommentsController extends Controller {
|
||||||
class TestTaskTest extends CakeTestCase {
|
class TestTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag');
|
var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* startTest method
|
* startTest method
|
||||||
*
|
*
|
||||||
|
@ -139,7 +136,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->Task->Dispatch =& $this->Dispatcher;
|
$this->Task->Dispatch =& $this->Dispatcher;
|
||||||
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
$this->Task->Template =& new TemplateTask($this->Dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* endTest method
|
* endTest method
|
||||||
*
|
*
|
||||||
|
@ -149,7 +145,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
function endTest() {
|
function endTest() {
|
||||||
ClassRegistry::flush();
|
ClassRegistry::flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that file path generation doesn't continuously append paths.
|
* Test that file path generation doesn't continuously append paths.
|
||||||
*
|
*
|
||||||
|
@ -173,7 +168,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(2, 'createFile', array($file, '*'));
|
$this->Task->expectAt(2, 'createFile', array($file, '*'));
|
||||||
$this->Task->bake('Controller', 'Comments');
|
$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.
|
* methods into the test case.
|
||||||
|
@ -185,7 +179,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$expected = array('doSomething', 'doSomethingElse');
|
$expected = array('doSomething', 'doSomethingElse');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that the generation of fixtures works correctly.
|
* test that the generation of fixtures works correctly.
|
||||||
*
|
*
|
||||||
|
@ -199,7 +192,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertEqual(sort($result), sort($expected));
|
$this->assertEqual(sort($result), sort($expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that the generation of fixtures works correctly.
|
* test that the generation of fixtures works correctly.
|
||||||
*
|
*
|
||||||
|
@ -213,7 +205,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
|
|
||||||
$this->assertEqual(sort($result), sort($expected));
|
$this->assertEqual(sort($result), sort($expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test user interaction to get object type
|
* test user interaction to get object type
|
||||||
*
|
*
|
||||||
|
@ -228,7 +219,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->getObjectType();
|
$result = $this->Task->getObjectType();
|
||||||
$this->assertEqual($result, $this->Task->classTypes[1]);
|
$this->assertEqual($result, $this->Task->classTypes[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creating test subjects should clear the registry so the registry is always fresh
|
* creating test subjects should clear the registry so the registry is always fresh
|
||||||
*
|
*
|
||||||
|
@ -252,7 +242,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$keys = ClassRegistry::keys();
|
$keys = ClassRegistry::keys();
|
||||||
$this->assertFalse(in_array('random', $keys));
|
$this->assertFalse(in_array('random', $keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that getClassName returns the user choice as a classname.
|
* test that getClassName returns the user choice as a classname.
|
||||||
*
|
*
|
||||||
|
@ -273,7 +262,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$options = Configure::listObjects('model');
|
$options = Configure::listObjects('model');
|
||||||
$this->assertEqual($result, $options[0]);
|
$this->assertEqual($result, $options[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the user interaction for defining additional fixtures.
|
* Test the user interaction for defining additional fixtures.
|
||||||
*
|
*
|
||||||
|
@ -286,7 +274,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$expected = array('app.pizza', 'app.topping', 'app.side_dish');
|
$expected = array('app.pizza', 'app.topping', 'app.side_dish');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that resolving classnames works
|
* test that resolving classnames works
|
||||||
*
|
*
|
||||||
|
@ -308,7 +295,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->getRealClassname('Component', 'Auth');
|
$result = $this->Task->getRealClassname('Component', 'Auth');
|
||||||
$this->assertEqual($result, 'AuthComponent');
|
$this->assertEqual($result, 'AuthComponent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test baking files.
|
* test baking files.
|
||||||
*
|
*
|
||||||
|
@ -337,7 +323,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->assertPattern("/'app\.test_task_tag'/", $result);
|
$this->assertPattern("/'app\.test_task_tag'/", $result);
|
||||||
$this->assertPattern("/'app\.articles_tag'/", $result);
|
$this->assertPattern("/'app\.articles_tag'/", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test baking controller test files, ensure that the stub class is generated.
|
* test baking controller test files, ensure that the stub class is generated.
|
||||||
*
|
*
|
||||||
|
@ -367,7 +352,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->assertPattern("/'app\.test_task_tag'/", $result);
|
$this->assertPattern("/'app\.test_task_tag'/", $result);
|
||||||
$this->assertPattern("/'app\.articles_tag'/", $result);
|
$this->assertPattern("/'app\.articles_tag'/", $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test Constructor generation ensure that constructClasses is called for controllers
|
* test Constructor generation ensure that constructClasses is called for controllers
|
||||||
*
|
*
|
||||||
|
@ -386,7 +370,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$expected = "new FormHelper()\n";
|
$expected = "new FormHelper()\n";
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that mock class generation works for the appropriate classes
|
* Test that mock class generation works for the appropriate classes
|
||||||
*
|
*
|
||||||
|
@ -396,7 +379,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$result = $this->Task->hasMockClass('controller');
|
$result = $this->Task->hasMockClass('controller');
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test bake() with a -plugin param
|
* test bake() with a -plugin param
|
||||||
*
|
*
|
||||||
|
@ -409,7 +391,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(0, 'createFile', array($path, '*'));
|
$this->Task->expectAt(0, 'createFile', array($path, '*'));
|
||||||
$this->Task->bake('Helper', 'Form');
|
$this->Task->bake('Helper', 'Form');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test filename generation for each type + plugins
|
* Test filename generation for each type + plugins
|
||||||
*
|
*
|
||||||
|
@ -443,7 +424,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
|
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test execute with a type defined
|
* test execute with a type defined
|
||||||
*
|
*
|
||||||
|
@ -456,7 +436,6 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
|
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
|
||||||
$this->Task->execute();
|
$this->Task->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test execute with type and class name defined
|
* test execute with type and class name defined
|
||||||
*
|
*
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
App::import('Controller', array('Component', 'Controller'), false);
|
App::import('Controller', array('Component', 'Controller'), false);
|
||||||
App::import('Component', 'Cookie');
|
App::import('Component', 'Cookie');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CookieComponentTestController class
|
* CookieComponentTestController class
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelDeleteTest file
|
* ModelDeleteTest file
|
||||||
*
|
*
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
require_once dirname(__FILE__) . DS . 'model.test.php';
|
require_once dirname(__FILE__) . DS . 'model.test.php';
|
||||||
require_once dirname(__FILE__) . DS . 'model_delete.test.php';
|
require_once dirname(__FILE__) . DS . 'model_delete.test.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelDeleteTest
|
* ModelDeleteTest
|
||||||
*
|
*
|
||||||
|
@ -35,7 +33,6 @@ require_once dirname(__FILE__) . DS . 'model_delete.test.php';
|
||||||
* @subpackage cake.tests.cases.libs.model.operations
|
* @subpackage cake.tests.cases.libs.model.operations
|
||||||
*/
|
*/
|
||||||
class ModelDeleteTest extends BaseModelTest {
|
class ModelDeleteTest extends BaseModelTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeleteHabtmReferenceWithConditions method
|
* testDeleteHabtmReferenceWithConditions method
|
||||||
*
|
*
|
||||||
|
@ -126,7 +123,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeleteArticleBLinks method
|
* testDeleteArticleBLinks method
|
||||||
*
|
*
|
||||||
|
@ -155,7 +151,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeleteDependentWithConditions method
|
* testDeleteDependentWithConditions method
|
||||||
*
|
*
|
||||||
|
@ -184,7 +179,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
$this->assertTrue(is_array($result));
|
$this->assertTrue(is_array($result));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDel method
|
* testDel method
|
||||||
*
|
*
|
||||||
|
@ -234,6 +228,7 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
// make sure deleting a non-existent record doesn't break save()
|
// make sure deleting a non-existent record doesn't break save()
|
||||||
// ticket #6293
|
// ticket #6293
|
||||||
$this->loadFixtures('Uuid');
|
$this->loadFixtures('Uuid');
|
||||||
|
@ -263,7 +258,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
'id' => 'B607DAB9-88A2-46CF-B57C-842CA9E3B3B3')));
|
'id' => 'B607DAB9-88A2-46CF-B57C-842CA9E3B3B3')));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeleteAll method
|
* testDeleteAll method
|
||||||
*
|
*
|
||||||
|
@ -405,7 +399,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
|
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
|
||||||
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
|
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRecursiveDel method
|
* testRecursiveDel method
|
||||||
*
|
*
|
||||||
|
@ -441,7 +434,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
$result = $TestModel->Comment->Attachment->find('count');
|
$result = $TestModel->Comment->Attachment->find('count');
|
||||||
$this->assertEqual($result, 0);
|
$this->assertEqual($result, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDependentExclusiveDelete method
|
* testDependentExclusiveDelete method
|
||||||
*
|
*
|
||||||
|
@ -460,7 +452,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
$TestModel->delete(1);
|
$TestModel->delete(1);
|
||||||
$this->assertEqual($TestModel->Comment->find('count'), 2);
|
$this->assertEqual($TestModel->Comment->find('count'), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeleteLinks method
|
* testDeleteLinks method
|
||||||
*
|
*
|
||||||
|
@ -508,7 +499,6 @@ class ModelDeleteTest extends BaseModelTest {
|
||||||
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
|
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
|
||||||
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
|
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable method
|
* testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable method
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelDeleteTest file
|
* ModelDeleteTest file
|
||||||
*
|
*
|
||||||
|
@ -35,7 +34,6 @@ require_once dirname(__FILE__) . DS . 'model_integration.test.php';
|
||||||
* @subpackage cake.tests.cases.libs.model.operations
|
* @subpackage cake.tests.cases.libs.model.operations
|
||||||
*/
|
*/
|
||||||
class ModelIntegrationTest extends BaseModelTest {
|
class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testPkInHAbtmLinkModelArticleB
|
* testPkInHAbtmLinkModelArticleB
|
||||||
*
|
*
|
||||||
|
@ -47,7 +45,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel2 =& new ArticleB();
|
$TestModel2 =& new ArticleB();
|
||||||
$this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
|
$this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that $cacheSources can only be disabled in the db using model settings, not enabled
|
* Tests that $cacheSources can only be disabled in the db using model settings, not enabled
|
||||||
*
|
*
|
||||||
|
@ -67,7 +64,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel->setSource('join_as');
|
$TestModel->setSource('join_as');
|
||||||
$this->assertFalse($this->db->cacheSources);
|
$this->assertFalse($this->db->cacheSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testPkInHabtmLinkModel method
|
* testPkInHabtmLinkModel method
|
||||||
*
|
*
|
||||||
|
@ -96,7 +92,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($TestModel4->JoinAsJoinB->primaryKey, 'id');
|
$this->assertEqual($TestModel4->JoinAsJoinB->primaryKey, 'id');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDynamicBehaviorAttachment method
|
* testDynamicBehaviorAttachment method
|
||||||
*
|
*
|
||||||
|
@ -133,7 +128,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($TestModel->Behaviors->attached(), array());
|
$this->assertEqual($TestModel->Behaviors->attached(), array());
|
||||||
$this->assertFalse(isset($TestModel->Behaviors->Tree));
|
$this->assertFalse(isset($TestModel->Behaviors->Tree));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests cross database joins. Requires $test and $test2 to both be set in DATABASE_CONFIG
|
* 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,
|
* NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections,
|
||||||
|
@ -496,7 +490,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->_fixtures[$this->_fixtureClassMap[$class]]->drop($db2);
|
$this->_fixtures[$this->_fixtureClassMap[$class]]->drop($db2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDisplayField method
|
* testDisplayField method
|
||||||
*
|
*
|
||||||
|
@ -513,7 +506,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($Person->displayField, 'name');
|
$this->assertEqual($Person->displayField, 'name');
|
||||||
$this->assertEqual($Comment->displayField, 'id');
|
$this->assertEqual($Comment->displayField, 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSchema method
|
* testSchema method
|
||||||
*
|
*
|
||||||
|
@ -536,7 +528,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($Post->getColumnTypes(), array_combine($columns, $types));
|
$this->assertEqual($Post->getColumnTypes(), array_combine($columns, $types));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test deconstruct() with time fields.
|
* test deconstruct() with time fields.
|
||||||
*
|
*
|
||||||
|
@ -622,7 +613,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$this->assertEqual($TestModel->data, $data);
|
$this->assertEqual($TestModel->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDeconstructFields with datetime, timestamp, and date fields
|
* testDeconstructFields with datetime, timestamp, and date fields
|
||||||
*
|
*
|
||||||
|
@ -799,7 +789,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel->set($data);
|
$TestModel->set($data);
|
||||||
$this->assertEqual($TestModel->data, $data);
|
$this->assertEqual($TestModel->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testTablePrefixSwitching method
|
* testTablePrefixSwitching method
|
||||||
*
|
*
|
||||||
|
@ -853,7 +842,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($db2->fullTableName($TestModel, false), 'apples');
|
$this->assertEqual($db2->fullTableName($TestModel, false), 'apples');
|
||||||
$this->assertEqual($db1->fullTableName($TestModel, false), 'apples');
|
$this->assertEqual($db1->fullTableName($TestModel, false), 'apples');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests validation parameter order in custom validation methods
|
* Tests validation parameter order in custom validation methods
|
||||||
*
|
*
|
||||||
|
@ -864,7 +852,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$TestModel =& new ValidationTest1();
|
$TestModel =& new ValidationTest1();
|
||||||
$this->assertNull($TestModel->getAssociated('Foo'));
|
$this->assertNull($TestModel->getAssociated('Foo'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testLoadModelSecondIteration method
|
* testLoadModelSecondIteration method
|
||||||
*
|
*
|
||||||
|
@ -881,7 +868,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertIsA($model->ModelC, 'ModelC');
|
$this->assertIsA($model->ModelC, 'ModelC');
|
||||||
$this->assertIsA($model->ModelC->ModelD, 'ModelD');
|
$this->assertIsA($model->ModelC->ModelD, 'ModelD');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ensure that __exists is reset on create
|
* ensure that __exists is reset on create
|
||||||
*
|
*
|
||||||
|
@ -903,7 +889,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$result = $Article->read(null, 2);
|
$result = $Article->read(null, 2);
|
||||||
$this->assertEqual($result['Article']['title'], 'Staying alive');
|
$this->assertEqual($result['Article']['title'], 'Staying alive');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testPluginAssociations method
|
* testPluginAssociations method
|
||||||
*
|
*
|
||||||
|
@ -1028,7 +1013,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests getAssociated method
|
* Tests getAssociated method
|
||||||
*
|
*
|
||||||
|
@ -1177,7 +1161,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($TestModel->Tag->name, 'Tag');
|
$this->assertEqual($TestModel->Tag->name, 'Tag');
|
||||||
$this->assertEqual($TestFakeModel->Tag->name, 'Tag');
|
$this->assertEqual($TestFakeModel->Tag->name, 'Tag');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test Model::__construct
|
* test Model::__construct
|
||||||
*
|
*
|
||||||
|
@ -1198,7 +1181,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($TestModel->actsAs, $expected);
|
$this->assertEqual($TestModel->actsAs, $expected);
|
||||||
$this->assertTrue(isset($TestModel->Behaviors->Containable));
|
$this->assertTrue(isset($TestModel->Behaviors->Containable));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test Model::__construct
|
* test Model::__construct
|
||||||
*
|
*
|
||||||
|
@ -1216,7 +1198,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$NewVoid =& new TheVoid(null, false, 'other');
|
$NewVoid =& new TheVoid(null, false, 'other');
|
||||||
$this->assertEqual('other', $NewVoid->useDbConfig);
|
$this->assertEqual('other', $NewVoid->useDbConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testColumnTypeFetching method
|
* testColumnTypeFetching method
|
||||||
*
|
*
|
||||||
|
@ -1235,7 +1216,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$this->assertEqual($model->getColumnType('Tag.id'), 'integer');
|
$this->assertEqual($model->getColumnType('Tag.id'), 'integer');
|
||||||
$this->assertEqual($model->getColumnType('Article.id'), 'integer');
|
$this->assertEqual($model->getColumnType('Article.id'), 'integer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmUniqueKey method
|
* testHabtmUniqueKey method
|
||||||
*
|
*
|
||||||
|
@ -1246,7 +1226,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$model =& new Item();
|
$model =& new Item();
|
||||||
$this->assertFalse($model->hasAndBelongsToMany['Portfolio']['unique']);
|
$this->assertFalse($model->hasAndBelongsToMany['Portfolio']['unique']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testIdentity method
|
* testIdentity method
|
||||||
*
|
*
|
||||||
|
@ -1269,7 +1248,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
$expected = 'AnotherTest';
|
$expected = 'AnotherTest';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWithAssociation method
|
* testWithAssociation method
|
||||||
*
|
*
|
||||||
|
@ -1521,7 +1499,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindSelfAssociations method
|
* testFindSelfAssociations method
|
||||||
*
|
*
|
||||||
|
@ -1631,7 +1608,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testDynamicAssociations method
|
* testDynamicAssociations method
|
||||||
*
|
*
|
||||||
|
@ -1739,7 +1715,6 @@ class ModelIntegrationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreation method
|
* testCreation method
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelReadTest file
|
* ModelReadTest file
|
||||||
*
|
*
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
require_once dirname(__FILE__) . DS . 'model.test.php';
|
require_once dirname(__FILE__) . DS . 'model.test.php';
|
||||||
require_once dirname(__FILE__) . DS . 'model_read.test.php';
|
require_once dirname(__FILE__) . DS . 'model_read.test.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelReadTest
|
* ModelReadTest
|
||||||
*
|
*
|
||||||
|
@ -35,7 +33,6 @@ require_once dirname(__FILE__) . DS . 'model_read.test.php';
|
||||||
* @subpackage cake.tests.cases.libs.model.operations
|
* @subpackage cake.tests.cases.libs.model.operations
|
||||||
*/
|
*/
|
||||||
class ModelReadTest extends BaseModelTest {
|
class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFetchingNonUniqueFKJoinTableRecords()
|
* testFetchingNonUniqueFKJoinTableRecords()
|
||||||
*
|
*
|
||||||
|
@ -73,7 +70,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertEqual($result['SomethingElse'][0]['JoinThing']['doomed'], 1);
|
$this->assertEqual($result['SomethingElse'][0]['JoinThing']['doomed'], 1);
|
||||||
$this->assertEqual($result['SomethingElse'][1]['JoinThing']['doomed'], 0);
|
$this->assertEqual($result['SomethingElse'][1]['JoinThing']['doomed'], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testGroupBy method
|
* testGroupBy method
|
||||||
*
|
*
|
||||||
|
@ -200,24 +196,28 @@ class ModelReadTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
$result = $Thread->find('all', array(
|
$result = $Thread->find('all', array(
|
||||||
'conditions' => array('Thread.project_id' => 1),
|
'conditions' => array('Thread.project_id' => 1),
|
||||||
'group' => array('project_id')
|
'group' => array('project_id')
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
$result = $Thread->find('all', array(
|
$result = $Thread->find('all', array(
|
||||||
'conditions' => array('Thread.project_id' => 1),
|
'conditions' => array('Thread.project_id' => 1),
|
||||||
'group' => array('project_id', 'Project.id')
|
'group' => array('project_id', 'Project.id')
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
$result = $Thread->find('all', array(
|
$result = $Thread->find('all', array(
|
||||||
'conditions' => array('Thread.project_id' => 1),
|
'conditions' => array('Thread.project_id' => 1),
|
||||||
'group' => array('Thread.project_id', 'Project.id')
|
'group' => array('Thread.project_id', 'Project.id')
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
|
array('Product' => array('type' => 'Clothing'), array('price' => 32)),
|
||||||
array('Product' => array('type' => 'Food'), array('price' => 9)),
|
array('Product' => array('type' => 'Food'), array('price' => 9)),
|
||||||
|
@ -237,7 +237,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'order' => 'Product.type ASC'));
|
'order' => 'Product.type ASC'));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testOldQuery method
|
* testOldQuery method
|
||||||
*
|
*
|
||||||
|
@ -273,7 +272,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertTrue(isset($this->db->_queryCache[$query]));
|
$this->assertTrue(isset($this->db->_queryCache[$query]));
|
||||||
$this->assertTrue(is_array($results));
|
$this->assertTrue(is_array($results));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testPreparedQuery method
|
* testPreparedQuery method
|
||||||
*
|
*
|
||||||
|
@ -355,7 +353,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertTrue(isset($this->db->_queryCache[$expected]));
|
$this->assertTrue(isset($this->db->_queryCache[$expected]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testParameterMismatch method
|
* testParameterMismatch method
|
||||||
*
|
*
|
||||||
|
@ -377,7 +374,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
$this->assertEqual($result, null);
|
$this->assertEqual($result, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testVeryStrangeUseCase method
|
* testVeryStrangeUseCase method
|
||||||
*
|
*
|
||||||
|
@ -407,7 +403,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $Article->query($query, $param);
|
$result = $Article->query($query, $param);
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRecursiveUnbind method
|
* testRecursiveUnbind method
|
||||||
*
|
*
|
||||||
|
@ -3002,7 +2997,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSelfAssociationAfterFind method
|
* testSelfAssociationAfterFind method
|
||||||
*
|
*
|
||||||
|
@ -3030,7 +3024,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
}
|
}
|
||||||
$this->assertEqual($afterFindData, $noAfterFindData);
|
$this->assertEqual($afterFindData, $noAfterFindData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindAllThreaded method
|
* testFindAllThreaded method
|
||||||
*
|
*
|
||||||
|
@ -3507,7 +3500,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test find('neighbors')
|
* test find('neighbors')
|
||||||
*
|
*
|
||||||
|
@ -3941,7 +3933,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveEmpty method
|
* testSaveEmpty method
|
||||||
*
|
*
|
||||||
|
@ -4054,6 +4045,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $TestModel->find('all', compact('conditions', 'recursive', 'order'));
|
$result = $TestModel->find('all', compact('conditions', 'recursive', 'order'));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
|
||||||
$conditions = array('id' => array('1', 2, '3.0'));
|
$conditions = array('id' => array('1', 2, '3.0'));
|
||||||
$order = 'Article.id ASC';
|
$order = 'Article.id ASC';
|
||||||
$result = $TestModel->find('all', compact('recursive', 'conditions', 'order'));
|
$result = $TestModel->find('all', compact('recursive', 'conditions', 'order'));
|
||||||
|
@ -4094,7 +4086,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testBindUnbind method
|
* testBindUnbind method
|
||||||
*
|
*
|
||||||
|
@ -4554,7 +4545,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertEqual($TestModel2->hasMany['NewFeatureSet'], $expected);
|
$this->assertEqual($TestModel2->hasMany['NewFeatureSet'], $expected);
|
||||||
$this->assertTrue(is_object($TestModel2->NewFeatureSet));
|
$this->assertTrue(is_object($TestModel2->NewFeatureSet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testBindMultipleTimes method
|
* testBindMultipleTimes method
|
||||||
*
|
*
|
||||||
|
@ -4835,7 +4825,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result[0]['Post'][0]['Comment'][0], $expected);
|
$this->assertEqual($result[0]['Post'][0]['Comment'][0], $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that callbacks can be properly disabled
|
* Tests that callbacks can be properly disabled
|
||||||
*
|
*
|
||||||
|
@ -4862,7 +4851,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$expected = array('mariano', 'nate', 'larry', 'garrett');
|
$expected = array('mariano', 'nate', 'larry', 'garrett');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testMultipleBelongsToWithSameClass method
|
* testMultipleBelongsToWithSameClass method
|
||||||
*
|
*
|
||||||
|
@ -4961,7 +4949,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmRecursiveBelongsTo method
|
* testHabtmRecursiveBelongsTo method
|
||||||
*
|
*
|
||||||
|
@ -5020,7 +5007,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmFinderQuery method
|
* testHabtmFinderQuery method
|
||||||
*
|
*
|
||||||
|
@ -5069,7 +5055,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result['Tag'], $expected);
|
$this->assertEqual($result['Tag'], $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmLimitOptimization method
|
* testHabtmLimitOptimization method
|
||||||
*
|
*
|
||||||
|
@ -5140,7 +5125,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHasManyLimitOptimization method
|
* testHasManyLimitOptimization method
|
||||||
*
|
*
|
||||||
|
@ -5255,7 +5239,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindAllRecursiveSelfJoin method
|
* testFindAllRecursiveSelfJoin method
|
||||||
*
|
*
|
||||||
|
@ -5361,8 +5344,10 @@ class ModelReadTest extends BaseModelTest {
|
||||||
)))));
|
)))));
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* testFindAllRecursiveWithHabtm method
|
* testFindAllRecursiveWithHabtm method
|
||||||
*
|
*
|
||||||
|
@ -5431,7 +5416,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertIdentical($result, $expected);
|
$this->assertIdentical($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testReadFakeThread method
|
* testReadFakeThread method
|
||||||
*
|
*
|
||||||
|
@ -5496,7 +5480,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->db->fullDebug = $fullDebug;
|
$this->db->fullDebug = $fullDebug;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindFakeThread method
|
* testFindFakeThread method
|
||||||
*
|
*
|
||||||
|
@ -5561,7 +5544,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->db->fullDebug = $fullDebug;
|
$this->db->fullDebug = $fullDebug;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindAllFakeThread method
|
* testFindAllFakeThread method
|
||||||
*
|
*
|
||||||
|
@ -5782,7 +5764,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->db->fullDebug = $fullDebug;
|
$this->db->fullDebug = $fullDebug;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testConditionalNumerics method
|
* testConditionalNumerics method
|
||||||
*
|
*
|
||||||
|
@ -6030,7 +6011,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test find('list') method
|
* test find('list') method
|
||||||
*
|
*
|
||||||
|
@ -6294,7 +6274,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindField method
|
* testFindField method
|
||||||
*
|
*
|
||||||
|
@ -6324,7 +6303,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $TestModel->field('COUNT(*)', true);
|
$result = $TestModel->field('COUNT(*)', true);
|
||||||
$this->assertEqual($result, 4);
|
$this->assertEqual($result, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindUnique method
|
* testFindUnique method
|
||||||
*
|
*
|
||||||
|
@ -6347,7 +6325,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'password' => '5f4dcc3b5aa765d61d8327deb882cf99'
|
'password' => '5f4dcc3b5aa765d61d8327deb882cf99'
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test find('count') method
|
* test find('count') method
|
||||||
*
|
*
|
||||||
|
@ -6394,7 +6371,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
$result = $TestModel->find('count', array('fields' => 'DISTINCT name'));
|
$result = $TestModel->find('count', array('fields' => 'DISTINCT name'));
|
||||||
$this->assertEqual($result, 4);
|
$this->assertEqual($result, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test find(count) with Db::expression
|
* Test find(count) with Db::expression
|
||||||
*
|
*
|
||||||
|
@ -6419,7 +6395,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, 1);
|
$this->assertEqual($result, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testFindMagic method
|
* testFindMagic method
|
||||||
*
|
*
|
||||||
|
@ -6451,7 +6426,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRead method
|
* testRead method
|
||||||
*
|
*
|
||||||
|
@ -6532,7 +6506,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRecursiveRead method
|
* testRecursiveRead method
|
||||||
*
|
*
|
||||||
|
@ -6959,7 +6932,6 @@ class ModelReadTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRecursiveFindAllWithLimit method
|
* testRecursiveFindAllWithLimit method
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelValidationTest file
|
* ModelValidationTest file
|
||||||
*
|
*
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
require_once dirname(__FILE__) . DS . 'model.test.php';
|
require_once dirname(__FILE__) . DS . 'model.test.php';
|
||||||
require_once dirname(__FILE__) . DS . 'model_validation.test.php';
|
require_once dirname(__FILE__) . DS . 'model_validation.test.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelValidationTest
|
* ModelValidationTest
|
||||||
*
|
*
|
||||||
|
@ -35,7 +33,6 @@ require_once dirname(__FILE__) . DS . 'model_validation.test.php';
|
||||||
* @subpackage cake.tests.cases.libs.model.operations
|
* @subpackage cake.tests.cases.libs.model.operations
|
||||||
*/
|
*/
|
||||||
class ModelValidationTest extends BaseModelTest {
|
class ModelValidationTest extends BaseModelTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests validation parameter order in custom validation methods
|
* Tests validation parameter order in custom validation methods
|
||||||
*
|
*
|
||||||
|
@ -77,7 +74,6 @@ class ModelValidationTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($TestModel->invalidFields(), $expected);
|
$this->assertEqual($TestModel->invalidFields(), $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests validation parameter fieldList in invalidFields
|
* Tests validation parameter fieldList in invalidFields
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
/* SVN FILE: $Id: model.test.php 8225 2009-07-08 03:25:30Z mark_story $ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelWriteTest file
|
* ModelWriteTest file
|
||||||
*
|
*
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
require_once dirname(__FILE__) . DS . 'model.test.php';
|
require_once dirname(__FILE__) . DS . 'model.test.php';
|
||||||
require_once dirname(__FILE__) . DS . 'model_write.test.php';
|
require_once dirname(__FILE__) . DS . 'model_write.test.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelWriteTest
|
* ModelWriteTest
|
||||||
*
|
*
|
||||||
|
@ -35,7 +33,6 @@ require_once dirname(__FILE__) . DS . 'model_write.test.php';
|
||||||
* @subpackage cake.tests.cases.libs.model.operations
|
* @subpackage cake.tests.cases.libs.model.operations
|
||||||
*/
|
*/
|
||||||
class ModelWriteTest extends BaseModelTest {
|
class ModelWriteTest extends BaseModelTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testInsertAnotherHabtmRecordWithSameForeignKey method
|
* testInsertAnotherHabtmRecordWithSameForeignKey method
|
||||||
*
|
*
|
||||||
|
@ -90,7 +87,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->JoinAsJoinB->findById(1);
|
$result = $TestModel->JoinAsJoinB->findById(1);
|
||||||
$this->assertEqual($result['JoinAsJoinB']['other'], $updatedValue);
|
$this->assertEqual($result['JoinAsJoinB']['other'], $updatedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveDateAsFirstEntry method
|
* testSaveDateAsFirstEntry method
|
||||||
*
|
*
|
||||||
|
@ -121,7 +117,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual($testResult['Article']['created'], '2008-01-01 00:00:00');
|
$this->assertEqual($testResult['Article']['created'], '2008-01-01 00:00:00');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testUnderscoreFieldSave method
|
* testUnderscoreFieldSave method
|
||||||
*
|
*
|
||||||
|
@ -147,7 +142,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$currentCount = $UnderscoreField->find('count');
|
$currentCount = $UnderscoreField->find('count');
|
||||||
$this->assertEqual($currentCount, 4);
|
$this->assertEqual($currentCount, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testAutoSaveUuid method
|
* testAutoSaveUuid method
|
||||||
*
|
*
|
||||||
|
@ -169,7 +163,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual(strlen($result['Uuid']['id']), 36);
|
$this->assertEqual(strlen($result['Uuid']['id']), 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testZeroDefaultFieldValue method
|
* testZeroDefaultFieldValue method
|
||||||
*
|
*
|
||||||
|
@ -190,7 +183,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertIdentical($result['DataTest']['count'], '0');
|
$this->assertIdentical($result['DataTest']['count'], '0');
|
||||||
$this->assertIdentical($result['DataTest']['float'], '0');
|
$this->assertIdentical($result['DataTest']['float'], '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testNonNumericHabtmJoinKey method
|
* testNonNumericHabtmJoinKey method
|
||||||
*
|
*
|
||||||
|
@ -289,7 +281,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests validation parameter order in custom validation methods
|
* Tests validation parameter order in custom validation methods
|
||||||
*
|
*
|
||||||
|
@ -310,7 +301,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($TestModel->data, $expected);
|
$this->assertEqual($TestModel->data, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test that Caches are getting cleared on save().
|
* test that Caches are getting cleared on save().
|
||||||
* ensure that both inflections of controller names are getting cleared
|
* ensure that both inflections of controller names are getting cleared
|
||||||
|
@ -348,7 +338,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
Configure::write('Cache.check', $_back['check']);
|
Configure::write('Cache.check', $_back['check']);
|
||||||
Configure::write('Cache.disable', $_back['disable']);
|
Configure::write('Cache.disable', $_back['disable']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveWithCounterCache method
|
* testSaveWithCounterCache method
|
||||||
*
|
*
|
||||||
|
@ -385,7 +374,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->findById(2);
|
$result = $TestModel->findById(2);
|
||||||
$this->assertIdentical($result['Syfile']['item_count'], '0');
|
$this->assertIdentical($result['Syfile']['item_count'], '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that counter caches are updated when records are added
|
* Tests that counter caches are updated when records are added
|
||||||
*
|
*
|
||||||
|
@ -411,7 +399,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$expected = 3;
|
$expected = 3;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that counter caches are updated when records are deleted
|
* Tests that counter caches are updated when records are deleted
|
||||||
*
|
*
|
||||||
|
@ -433,7 +420,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$expected = 1;
|
$expected = 1;
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that counter caches are updated when foreign keys of counted records change
|
* Tests that counter caches are updated when foreign keys of counted records change
|
||||||
*
|
*
|
||||||
|
@ -456,7 +442,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual($users[0]['User']['post_count'], 1);
|
$this->assertEqual($users[0]['User']['post_count'], 1);
|
||||||
$this->assertEqual($users[1]['User']['post_count'], 2);
|
$this->assertEqual($users[1]['User']['post_count'], 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test counter cache with models that use a non-standard (i.e. not using 'id')
|
* Test counter cache with models that use a non-standard (i.e. not using 'id')
|
||||||
* as their primary key.
|
* as their primary key.
|
||||||
|
@ -513,7 +498,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$expected = array_fill(0, 1, 1);
|
$expected = array_fill(0, 1, 1);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveWithCounterCacheScope method
|
* testSaveWithCounterCacheScope method
|
||||||
*
|
*
|
||||||
|
@ -553,7 +537,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->findById(1);
|
$result = $TestModel->findById(1);
|
||||||
$this->assertIdentical($result['Syfile']['item_count'], '1');
|
$this->assertIdentical($result['Syfile']['item_count'], '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testValidatesBackwards method
|
* testValidatesBackwards method
|
||||||
*
|
*
|
||||||
|
@ -619,7 +602,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->validates();
|
$result = $TestModel->validates();
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testValidates method
|
* testValidates method
|
||||||
*
|
*
|
||||||
|
@ -972,7 +954,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveField method
|
* testSaveField method
|
||||||
*
|
*
|
||||||
|
@ -1041,7 +1022,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $Node->read();
|
$result = $Node->read();
|
||||||
$this->assertEqual(Set::extract('/ParentNode/name', $result), array('Second'));
|
$this->assertEqual(Set::extract('/ParentNode/name', $result), array('Second'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveWithCreate method
|
* testSaveWithCreate method
|
||||||
*
|
*
|
||||||
|
@ -1263,7 +1243,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveWithSet method
|
* testSaveWithSet method
|
||||||
*
|
*
|
||||||
|
@ -1391,7 +1370,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveWithNonExistentFields method
|
* testSaveWithNonExistentFields method
|
||||||
*
|
*
|
||||||
|
@ -1443,7 +1421,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->read(array('id', 'user_id', 'title', 'body', 'published'), 5);
|
$result = $TestModel->read(array('id', 'user_id', 'title', 'body', 'published'), 5);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveFromXml method
|
* testSaveFromXml method
|
||||||
*
|
*
|
||||||
|
@ -1461,7 +1438,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$results = $Article->find(array('Article.title' => 'test xml'));
|
$results = $Article->find(array('Article.title' => 'test xml'));
|
||||||
$this->assertTrue($results);
|
$this->assertTrue($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveHabtm method
|
* testSaveHabtm method
|
||||||
*
|
*
|
||||||
|
@ -1933,7 +1909,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$expected = array('new record', 'new record');
|
$expected = array('new record', 'new record');
|
||||||
$this->assertEqual(Set::extract('/JoinC/JoinAsJoinC/other', $result), $expected);
|
$this->assertEqual(Set::extract('/JoinC/JoinAsJoinC/other', $result), $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveHabtmCustomKeys method
|
* testSaveHabtmCustomKeys method
|
||||||
*
|
*
|
||||||
|
@ -1984,7 +1959,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmSaveKeyResolution method
|
* testHabtmSaveKeyResolution method
|
||||||
*
|
*
|
||||||
|
@ -2074,7 +2048,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
));
|
));
|
||||||
$this->assertEqual($result['Monkey'], $expected);
|
$this->assertEqual($result['Monkey'], $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreationOfEmptyRecord method
|
* testCreationOfEmptyRecord method
|
||||||
*
|
*
|
||||||
|
@ -2094,7 +2067,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertTrue(isset($result['Author']['updated']));
|
$this->assertTrue(isset($result['Author']['updated']));
|
||||||
$this->assertEqual($TestModel->find('count'), 1);
|
$this->assertEqual($TestModel->find('count'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreateWithPKFiltering method
|
* testCreateWithPKFiltering method
|
||||||
*
|
*
|
||||||
|
@ -2191,7 +2163,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
$this->assertFalse($TestModel->id);
|
$this->assertFalse($TestModel->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreationWithMultipleData method
|
* testCreationWithMultipleData method
|
||||||
*
|
*
|
||||||
|
@ -2363,7 +2334,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
))));
|
))));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreationWithMultipleDataSameModel method
|
* testCreationWithMultipleDataSameModel method
|
||||||
*
|
*
|
||||||
|
@ -2422,7 +2392,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
'title' => 'Brand New Article'
|
'title' => 'Brand New Article'
|
||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testCreationWithMultipleDataSameModelManualInstances method
|
* testCreationWithMultipleDataSameModelManualInstances method
|
||||||
*
|
*
|
||||||
|
@ -2461,7 +2430,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $Primary->find('count');
|
$result = $Primary->find('count');
|
||||||
$this->assertEqual($result, 2);
|
$this->assertEqual($result, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRecordExists method
|
* testRecordExists method
|
||||||
*
|
*
|
||||||
|
@ -2485,7 +2453,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$TestModel->id = 5;
|
$TestModel->id = 5;
|
||||||
$this->assertFalse($TestModel->exists());
|
$this->assertFalse($TestModel->exists());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testUpdateExisting method
|
* testUpdateExisting method
|
||||||
*
|
*
|
||||||
|
@ -2533,7 +2500,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $Comment->save($data);
|
$result = $Comment->save($data);
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testUpdateMultiple method
|
* testUpdateMultiple method
|
||||||
*
|
*
|
||||||
|
@ -2567,7 +2533,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$expected = array_fill(0, 2, 'Updated today');
|
$expected = array_fill(0, 2, 'Updated today');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testHabtmUuidWithUuidId method
|
* testHabtmUuidWithUuidId method
|
||||||
*
|
*
|
||||||
|
@ -2587,7 +2552,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual(1, count($result['Uuiditem']));
|
$this->assertEqual(1, count($result['Uuiditem']));
|
||||||
$this->assertEqual(strlen($result['Uuiditem'][0]['UuiditemsUuidportfolio']['id']), 36);
|
$this->assertEqual(strlen($result['Uuiditem'][0]['UuiditemsUuidportfolio']['id']), 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test HABTM saving when join table has no primary key and only 2 columns.
|
* test HABTM saving when join table has no primary key and only 2 columns.
|
||||||
*
|
*
|
||||||
|
@ -2611,7 +2575,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertTrue($Fruit->save($data));
|
$this->assertTrue($Fruit->save($data));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test HABTM saving when join table has no primary key and only 2 columns, no with model is used.
|
* test HABTM saving when join table has no primary key and only 2 columns, no with model is used.
|
||||||
*
|
*
|
||||||
|
@ -2654,7 +2617,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = $TestModel->read(null, $id);
|
$result = $TestModel->read(null, $id);
|
||||||
$this->assertEqual(1, count($result['Uuidportfolio']));
|
$this->assertEqual(1, count($result['Uuidportfolio']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveMultipleHabtm method
|
* testSaveMultipleHabtm method
|
||||||
*
|
*
|
||||||
|
@ -2773,7 +2735,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
|
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAll method
|
* testSaveAll method
|
||||||
*
|
*
|
||||||
|
@ -2913,7 +2874,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result[6]['Attachment'], $expected);
|
$this->assertEqual($result[6]['Attachment'], $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test SaveAll with Habtm relations
|
* Test SaveAll with Habtm relations
|
||||||
*
|
*
|
||||||
|
@ -2945,7 +2905,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual(count($result['Comment']), 1);
|
$this->assertEqual(count($result['Comment']), 1);
|
||||||
$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);
|
$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test SaveAll with Habtm relations and extra join table fields
|
* Test SaveAll with Habtm relations and extra join table fields
|
||||||
*
|
*
|
||||||
|
@ -2989,7 +2948,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[something_else_id=3]', $result));
|
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[something_else_id=3]', $result));
|
||||||
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[doomed=1]', $result));
|
$this->assertTrue(Set::matches('/SomethingElse[id=3]/JoinThing[doomed=1]', $result));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllHasOne method
|
* testSaveAllHasOne method
|
||||||
*
|
*
|
||||||
|
@ -3029,7 +2987,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllBelongsTo method
|
* testSaveAllBelongsTo method
|
||||||
*
|
*
|
||||||
|
@ -3069,7 +3026,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
)));
|
)));
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllHasOneValidation method
|
* testSaveAllHasOneValidation method
|
||||||
*
|
*
|
||||||
|
@ -3116,7 +3072,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$this->assertEqual($model->validationErrors, $expected['Comment']);
|
$this->assertEqual($model->validationErrors, $expected['Comment']);
|
||||||
$this->assertEqual($model->Attachment->validationErrors, $expected['Attachment']);
|
$this->assertEqual($model->Attachment->validationErrors, $expected['Attachment']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllAtomic method
|
* testSaveAllAtomic method
|
||||||
*
|
*
|
||||||
|
@ -3190,7 +3145,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
), array('atomic' => false));
|
), array('atomic' => false));
|
||||||
$this->assertIdentical($result, array('Article' => true, 'Comment' => array(true, true)));
|
$this->assertIdentical($result, array('Article' => true, 'Comment' => array(true, true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllHasMany method
|
* testSaveAllHasMany method
|
||||||
*
|
*
|
||||||
|
@ -3267,7 +3221,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual(Set::extract($result['Comment'], '{n}.comment'), $expected);
|
$this->assertEqual(Set::extract($result['Comment'], '{n}.comment'), $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllHasManyValidation method
|
* testSaveAllHasManyValidation method
|
||||||
*
|
*
|
||||||
|
@ -3308,7 +3261,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
))
|
))
|
||||||
), array('validate' => 'only'));
|
), array('validate' => 'only'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllTransaction method
|
* testSaveAllTransaction method
|
||||||
*
|
*
|
||||||
|
@ -3698,7 +3650,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
|
|
||||||
$TestModel->validate['body'] = 'notEmpty';
|
$TestModel->validate['body'] = 'notEmpty';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllValidationOnly method
|
* testSaveAllValidationOnly method
|
||||||
*
|
*
|
||||||
|
@ -3751,7 +3702,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($TestModel->validationErrors, $expected);
|
$this->assertEqual($TestModel->validationErrors, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllValidateFirst method
|
* testSaveAllValidateFirst method
|
||||||
*
|
*
|
||||||
|
@ -3830,7 +3780,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
);
|
);
|
||||||
$this->assertEqual($result[0]['Comment'][0]['comment'], 'Only new comment');
|
$this->assertEqual($result[0]['Comment'][0]['comment'], 'Only new comment');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testUpdateWithCalculation method
|
* testUpdateWithCalculation method
|
||||||
*
|
*
|
||||||
|
@ -3859,7 +3808,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
$result = Set::extract('/DataTest/count', $model->find('all', array('fields' => 'count')));
|
$result = Set::extract('/DataTest/count', $model->find('all', array('fields' => 'count')));
|
||||||
$this->assertEqual($result, array(6, 4, 5, 2));
|
$this->assertEqual($result, array(6, 4, 5, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testSaveAllHasManyValidationOnly method
|
* testSaveAllHasManyValidationOnly method
|
||||||
*
|
*
|
||||||
|
|
|
@ -40,7 +40,6 @@ class CakeTestFixture extends Object {
|
||||||
* @var string
|
* @var string
|
||||||
**/
|
**/
|
||||||
var $name = null;
|
var $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cake's DBO driver (e.g: DboMysql).
|
* Cake's DBO driver (e.g: DboMysql).
|
||||||
*
|
*
|
||||||
|
@ -54,7 +53,6 @@ class CakeTestFixture extends Object {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $table = null;
|
var $table = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate the fixture.
|
* Instantiate the fixture.
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,3 +36,4 @@
|
||||||
<?php echo $variable; ?>
|
<?php echo $variable; ?>
|
||||||
</cake:nocache>
|
</cake:nocache>
|
||||||
<p>Additional regular text.</p>
|
<p>Additional regular text.</p>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue