Skip to content

Commit

Permalink
Fixing more errors in tests related to type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 26, 2010
1 parent f027bf0 commit cec3512
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cake/tests/cases/libs/model/model_write.test.php
Expand Up @@ -439,7 +439,7 @@ public function testCounterCacheWithSelfJoin() {
* @return void
*/
function testSaveWithCounterCacheScope() {
$this->loadFixtures('Syfile', 'Item');
$this->loadFixtures('Syfile', 'Item', 'Image', 'ItemsPortfolio', 'Portfolio');
$TestModel = new Syfile();
$TestModel2 = new Item();
$TestModel2->belongsTo['Syfile']['counterCache'] = true;
Expand All @@ -455,12 +455,13 @@ function testSaveWithCounterCacheScope() {
));

$result = $TestModel->findById(1);
$this->assertIdentical($result['Syfile']['item_count'], '1');
debug($result);
$this->assertEquals($result['Syfile']['item_count'], 1);

$TestModel2->id = 1;
$TestModel2->saveField('published', true);
$result = $TestModel->findById(1);
$this->assertIdentical($result['Syfile']['item_count'], '2');
$this->assertEquals($result['Syfile']['item_count'], 2);

$TestModel2->save(array(
'id' => 1,
Expand All @@ -469,7 +470,7 @@ function testSaveWithCounterCacheScope() {
));

$result = $TestModel->findById(1);
$this->assertIdentical($result['Syfile']['item_count'], '1');
$this->assertEquals($result['Syfile']['item_count'], 1);
}

/**
Expand Down Expand Up @@ -2416,7 +2417,7 @@ function testSaveMultipleHabtm() {
* @return void
*/
function testSaveAll() {
$this->loadFixtures('Post', 'Author', 'Comment', 'Attachment');
$this->loadFixtures('Post', 'Author', 'Comment', 'Attachment', 'Article', 'User');
$TestModel = new Post();

$result = $TestModel->find('all');
Expand Down Expand Up @@ -2556,7 +2557,7 @@ function testSaveAll() {
* @return void
*/
function testSaveAllHabtm() {
$this->loadFixtures('Article', 'Tag', 'Comment', 'User');
$this->loadFixtures('Article', 'Tag', 'Comment', 'User', 'ArticlesTag');
$data = array(
'Article' => array(
'user_id' => 1,
Expand Down

0 comments on commit cec3512

Please sign in to comment.