mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Adding test cases to Containable, disproves and closes #4934
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7229 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
605bfa5bc5
commit
64d49c8afc
1 changed files with 22 additions and 0 deletions
|
@ -3003,6 +3003,28 @@ class ContainableTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$this->assertTrue(empty($this->User->Article->hasAndBelongsToMany['Tag']['conditions']));
|
||||
|
||||
$result = $this->User->find('all', array('contain' => array(
|
||||
'Article.Tag' => array('conditions' => array('created >=' => '2007-03-18 12:24'))
|
||||
)));
|
||||
|
||||
$this->assertTrue(Set::matches('/User[id=1]', $result));
|
||||
$this->assertFalse(Set::matches('/Article[id=1]/Tag[id=1]', $result));
|
||||
$this->assertTrue(Set::matches('/Article[id=1]/Tag[id=2]', $result));
|
||||
$this->assertTrue(empty($this->User->Article->hasAndBelongsToMany['Tag']['conditions']));
|
||||
|
||||
$this->assertTrue(empty($this->User->Article->hasAndBelongsToMany['Tag']['order']));
|
||||
|
||||
$result = $this->User->find('all', array('contain' => array(
|
||||
'Article.Tag' => array('order' => 'created DESC')
|
||||
)));
|
||||
|
||||
$this->assertTrue(Set::matches('/User[id=1]', $result));
|
||||
$this->assertTrue(Set::matches('/Article[id=1]/Tag[id=1]', $result));
|
||||
$this->assertTrue(Set::matches('/Article[id=1]/Tag[id=2]', $result));
|
||||
$this->assertTrue(empty($this->User->Article->hasAndBelongsToMany['Tag']['order']));
|
||||
}
|
||||
/**
|
||||
* testOtherFinds method
|
||||
|
|
Loading…
Add table
Reference in a new issue