mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Changing names for instance vars in test added for #3455
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5890 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
28b7fb5653
commit
ec76d6aac3
1 changed files with 8 additions and 8 deletions
|
@ -642,24 +642,24 @@ class ModelTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testCreationWithMultipleDataSameModel() {
|
function testCreationWithMultipleDataSameModel() {
|
||||||
$this->PrimaryModel =& new Article();
|
$this->Article =& new Article();
|
||||||
$this->SecondaryModel =& new Article();
|
$this->SecondaryArticle =& new Article();
|
||||||
|
|
||||||
$result = $this->PrimaryModel->field('title', array('id' => 1));
|
$result = $this->Article->field('title', array('id' => 1));
|
||||||
$this->assertEqual($result, 'First Article');
|
$this->assertEqual($result, 'First Article');
|
||||||
|
|
||||||
$data = array('Article' => array('user_id' => 2, 'title' => 'Brand New Article', 'body' => 'Brand New Article Body', 'published' => 'Y'));
|
$data = array('Article' => array('user_id' => 2, 'title' => 'Brand New Article', 'body' => 'Brand New Article Body', 'published' => 'Y'));
|
||||||
$this->PrimaryModel->create();
|
$this->Article->create();
|
||||||
$result = $this->PrimaryModel->save($data);
|
$result = $this->Article->save($data);
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
|
|
||||||
$result = $this->PrimaryModel->getInsertID();
|
$result = $this->Article->getInsertID();
|
||||||
$this->assertTrue(!empty($result));
|
$this->assertTrue(!empty($result));
|
||||||
|
|
||||||
$result = $this->PrimaryModel->field('title', array('id' => 1));
|
$result = $this->Article->field('title', array('id' => 1));
|
||||||
$this->assertEqual($result, 'First Article');
|
$this->assertEqual($result, 'First Article');
|
||||||
|
|
||||||
$articles = $this->PrimaryModel->find('all', array('fields' => array('id','title'), 'recursive' => -1));
|
$articles = $this->Article->find('all', array('fields' => array('id','title'), 'recursive' => -1));
|
||||||
$this->assertEqual($articles, array(
|
$this->assertEqual($articles, array(
|
||||||
array('Article' => array('id' => 1, 'title' => 'First Article')),
|
array('Article' => array('id' => 1, 'title' => 'First Article')),
|
||||||
array('Article' => array('id' => 2, 'title' => 'Second Article')),
|
array('Article' => array('id' => 2, 'title' => 'Second Article')),
|
||||||
|
|
Loading…
Add table
Reference in a new issue