Adding test to show correct functioning of containable + field() + recursive = -1. Closes #409

This commit is contained in:
Mark Story 2010-04-19 23:15:59 -04:00
parent 029d2581af
commit f86d0de5ee

View file

@ -3626,6 +3626,17 @@ class ContainableBehaviorTest extends CakeTestCase {
$this->_fixtures[$this->_fixtureClassMap['User']]->drop($db);
}
/**
* test that autoFields doesn't splice in columns that aren't part of the join.
*
* @return void
*/
function testAutoFieldsWithRecursiveNegativeOne() {
$this->Article->recursive = -1;
$result = $this->Article->field('title', array('Article.title' => 'First Article'));
$this->assertNoErrors();
$this->assertEqual($result, 'First Article', 'Field is wrong');
}
/**
* containments method
*