Added tests for issue #2391

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4843 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-04-11 21:27:16 +00:00
parent 4c7febfafa
commit cf2abbed03

View file

@ -229,14 +229,14 @@ class ModelTest extends CakeTestCase {
Configure::write('debug', DEBUG); Configure::write('debug', DEBUG);
} }
function _testIdentity() { function testIdentity() {
$this->model =& new Test(); $this->model =& new Test();
$result = $this->model->name; $result = $this->model->name;
$expected = 'Test'; $expected = 'Test';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testCreation() { function testCreation() {
$this->model =& new Test(); $this->model =& new Test();
$result = $this->model->create(); $result = $this->model->create();
$expected = array('Test' => array('notes' => 'write some notes here')); $expected = array('Test' => array('notes' => 'write some notes here'));
@ -259,7 +259,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindAllFakeThread() { function testFindAllFakeThread() {
$this->model =& new CategoryThread(); $this->model =& new CategoryThread();
$this->db->fullDebug = true; $this->db->fullDebug = true;
@ -276,7 +276,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindAll() { function testFindAll() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->findAll(); $result = $this->model->findAll();
@ -370,7 +370,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindField() { function testFindField() {
$this->model =& new User(); $this->model =& new User();
$this->model->id = 1; $this->model->id = 1;
@ -391,7 +391,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, 4); $this->assertEqual($result, 4);
} }
function _testBindUnbind() { function testBindUnbind() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->hasMany; $result = $this->model->hasMany;
@ -519,7 +519,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindCount() { function testFindCount() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->findCount(); $result = $this->model->findCount();
$this->assertEqual($result, 4); $this->assertEqual($result, 4);
@ -536,7 +536,7 @@ class ModelTest extends CakeTestCase {
$this->db->fullDebug = false; $this->db->fullDebug = false;
} }
function _testFindMagic() { function testFindMagic() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->findByUser('mariano'); $result = $this->model->findByUser('mariano');
@ -552,7 +552,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testRead() { function testRead() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->read(); $result = $this->model->read();
@ -591,7 +591,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testRecursiveRead() { function testRecursiveRead() {
$this->model =& new User(); $this->model =& new User();
$result = $this->model->bindModel(array('hasMany' => array('Article')), false); $result = $this->model->bindModel(array('hasMany' => array('Article')), false);
@ -639,7 +639,7 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testRecursiveFindAll() { function testRecursiveFindAll() {
$this->model =& new Article(); $this->model =& new Article();
$result = $this->model->findAll(array('Article.user_id' => 1)); $result = $this->model->findAll(array('Article.user_id' => 1));
@ -894,7 +894,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testSaveField() { function testSaveField() {
$this->model =& new Article(); $this->model =& new Article();
$this->model->id = 1; $this->model->id = 1;
@ -932,7 +932,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertFalse($result); $this->assertFalse($result);
} }
function _testSave() { function testSave() {
$this->model =& new User(); $this->model =& new User();
$data = array('User' => array('user' => 'user', 'password' => '')); $data = array('User' => array('user' => 'user', 'password' => ''));
@ -1044,7 +1044,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testRecursiveDel() { function testRecursiveDel() {
$this->model =& new Article(); $this->model =& new Article();
$result = $this->model->del(2); $result = $this->model->del(2);
@ -1073,7 +1073,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertEqual($result, 0); $this->assertEqual($result, 0);
} }
function _testFindAllThreaded() { function testFindAllThreaded() {
$this->model =& new Category(); $this->model =& new Category();
$result = $this->model->findAllThreaded(); $result = $this->model->findAllThreaded();
@ -1157,7 +1157,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindNeighbours() { function testFindNeighbours() {
$this->model =& new Article(); $this->model =& new Article();
$result = $this->model->findNeighbours(null, 'Article.id', '2'); $result = $this->model->findNeighbours(null, 'Article.id', '2');
@ -1181,7 +1181,7 @@ function testRecursiveFindAllWithLimit() {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
function _testFindCombinedRelations() { function testFindCombinedRelations() {
$this->model =& new Apple(); $this->model =& new Apple();
$result = $this->model->findAll(); $result = $this->model->findAll();