mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-19 16:10:54 +00:00
simplyfy test and correct some test param orders
This commit is contained in:
parent
6cf147e8c8
commit
47e8e0c57a
1 changed files with 6 additions and 6 deletions
|
@ -588,7 +588,7 @@ class ModelValidationTest extends BaseModelTest {
|
||||||
$this->assertFalse($result, 'Save occurred even when with models failed. %s');
|
$this->assertFalse($result, 'Save occurred even when with models failed. %s');
|
||||||
$this->assertEquals($expectedError, $JoinThing->validationErrors);
|
$this->assertEquals($expectedError, $JoinThing->validationErrors);
|
||||||
$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));
|
$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));
|
||||||
$this->assertSame($count, 0);
|
$this->assertSame(0, $count);
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'Something' => array(
|
'Something' => array(
|
||||||
|
@ -651,7 +651,7 @@ class ModelValidationTest extends BaseModelTest {
|
||||||
$this->assertEquals($expectedError, $JoinThing->validationErrors);
|
$this->assertEquals($expectedError, $JoinThing->validationErrors);
|
||||||
|
|
||||||
$count = $Something->find('count', array('conditions' => array('Something.id' => $data['Something']['id'])));
|
$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(
|
$joinRecords = $JoinThing->find('count', array(
|
||||||
'conditions' => array('JoinThing.something_id' => $data['Something']['id'])
|
'conditions' => array('JoinThing.something_id' => $data['Something']['id'])
|
||||||
|
@ -692,11 +692,11 @@ class ModelValidationTest extends BaseModelTest {
|
||||||
$Author->create();
|
$Author->create();
|
||||||
$result = $Author->saveAll($data, array('validate' => 'first'));
|
$result = $Author->saveAll($data, array('validate' => 'first'));
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
$this->assertFalse($Author->id === null);
|
$this->assertNotNull($Author->id);
|
||||||
|
|
||||||
$id = $Author->id;
|
$id = $Author->id;
|
||||||
$count = $Author->find('count', array('conditions' => array('Author.id' => $id)));
|
$count = $Author->find('count', array('conditions' => array('Author.id' => $id)));
|
||||||
$this->assertSame($count, 1);
|
$this->assertSame(1, $count);
|
||||||
|
|
||||||
$count = $Post->find('count', array(
|
$count = $Post->find('count', array(
|
||||||
'conditions' => array('Post.author_id' => $id)
|
'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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue