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:
mariano.iglesias 2007-10-24 16:10:20 +00:00
parent 28b7fb5653
commit ec76d6aac3

View file

@ -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')),