simplyfy test and correct some test param orders

This commit is contained in:
euromark 2013-08-16 20:51:11 +02:00
parent 6cf147e8c8
commit 47e8e0c57a

View file

@ -588,7 +588,7 @@ class ModelValidationTest extends BaseModelTest {
$this->assertFalse($result, 'Save occurred even when with models failed. %s');
$this->assertEquals($expectedError, $JoinThing->validationErrors);
$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));
$this->assertSame($count, 0);
$this->assertSame(0, $count);
$data = array(
'Something' => array(
@ -651,7 +651,7 @@ class ModelValidationTest extends BaseModelTest {
$this->assertEquals($expectedError, $JoinThing->validationErrors);
$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));
$this->assertSame($count, 0);
$this->assertSame(0, $count);
$joinRecords = $JoinThing->find('count', array(
'conditions' => array('JoinThing.something_id' => $data['Something']['id'])
@ -692,11 +692,11 @@ class ModelValidationTest extends BaseModelTest {
$Author->create();
$result = $Author->saveAll($data, array('validate' => 'first'));
$this->assertTrue($result);
$this->assertFalse($Author->id === null);
$this->assertNotNull($Author->id);
$id = $Author->id;
$count = $Author->find('count', array('conditions' => array('Author.id' => $id)));
$this->assertSame($count, 1);
$this->assertSame(1, $count);
$count = $Post->find('count', array(
'conditions' => array('Post.author_id' => $id)
@ -2315,7 +2315,7 @@ class ModelValidationTest extends BaseModelTest {
),
),
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}
/**
@ -2376,7 +2376,7 @@ class ModelValidationTest extends BaseModelTest {
),
),
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}
}