Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplyfy test and correct some test param orders

  • Loading branch information...
commit 47e8e0c57a3e2a79c008a1be3d2795bf1d726a64 1 parent 6cf147e
@dereuromark dereuromark authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Test/Case/Model/ModelValidationTest.php
View
12 lib/Cake/Test/Case/Model/ModelValidationTest.php
@@ -588,7 +588,7 @@ public function testValidatesWithAssociations() {
$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 @@ public function testValidatesWithModelsAndSaveAll() {
$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 @@ public function testValidatesWithModelsAndSaveAllWithoutId() {
$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 @@ public function testValidateAssociatedAtomicFalseDeepTrueWithErrors() {
),
),
);
- $this->assertEquals($result, $expected);
+ $this->assertEquals($expected, $result);
}
/**
@@ -2376,7 +2376,7 @@ public function testValidateManyAtomicFalseDeepTrueWithErrors() {
),
),
);
- $this->assertEquals($result, $expected);
+ $this->assertEquals($expected, $result);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.