mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding counterCache test cases from #4122
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6495 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
affcdd23dc
commit
b1c7938ad5
1 changed files with 9 additions and 2 deletions
|
@ -759,8 +759,6 @@ class ModelTest extends CakeTestCase {
|
|||
$result = Set::extract($this->model->find('all'), '{n}.Comment.user_id');
|
||||
$expected = array('5', '4', '1', '1', '1', '5');
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
//pr($this->model->find('all'));
|
||||
}
|
||||
|
||||
function testBindUnbind() {
|
||||
|
@ -1973,6 +1971,15 @@ class ModelTest extends CakeTestCase {
|
|||
$this->model2->delete(1);
|
||||
$result = $this->model->findById(1);
|
||||
$this->assertIdentical($result['Syfile']['item_count'], '1');
|
||||
|
||||
$this->model2->id = 2;
|
||||
$this->model2->saveField('syfile_id', 1);
|
||||
|
||||
$result = $this->model->findById(1);
|
||||
$this->assertIdentical($result['Syfile']['item_count'], '2');
|
||||
|
||||
$result = $this->model->findById(2);
|
||||
$this->assertIdentical($result['Syfile']['item_count'], null);
|
||||
}
|
||||
|
||||
function testSaveWithCounterCacheScope() {
|
||||
|
|
Loading…
Reference in a new issue