From f86d0de5eed1b785d1a3d0f1a9442f71f57c5d32 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 19 Apr 2010 23:15:59 -0400 Subject: [PATCH] Adding test to show correct functioning of containable + field() + recursive = -1. Closes #409 --- .../cases/libs/model/behaviors/containable.test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index 7b1309627..14897039c 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -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 *