|
@@ -87,6 +87,7 @@ class HelperTestComment extends Model {
|
|
|
'author_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
|
'author_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'),
|
|
|
'title' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
|
|
'title' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'),
|
|
|
'body' => array('type' => 'string', 'null' => true, 'default' => '', 'length' => ''),
|
|
'body' => array('type' => 'string', 'null' => true, 'default' => '', 'length' => ''),
|
|
|
|
|
+ 'BigField' => array('type' => 'string', 'null' => true, 'default' => '', 'length' => ''),
|
|
|
'created' => array('type' => 'date', 'null' => true, 'default' => '', 'length' => ''),
|
|
'created' => array('type' => 'date', 'null' => true, 'default' => '', 'length' => ''),
|
|
|
'modified' => array('type' => 'datetime', 'null' => true, 'default' => '', 'length' => null)
|
|
'modified' => array('type' => 'datetime', 'null' => true, 'default' => '', 'length' => null)
|
|
|
);
|
|
);
|
|
@@ -228,6 +229,10 @@ class HelperTest extends CakeTestCase {
|
|
|
array(
|
|
array(
|
|
|
'HelperTest.1.Comment.body',
|
|
'HelperTest.1.Comment.body',
|
|
|
array('HelperTest', '1', 'Comment', 'body')
|
|
array('HelperTest', '1', 'Comment', 'body')
|
|
|
|
|
+ ),
|
|
|
|
|
+ array(
|
|
|
|
|
+ 'HelperTestComment.BigField',
|
|
|
|
|
+ array('HelperTestComment', 'BigField')
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -299,6 +304,22 @@ class HelperTest extends CakeTestCase {
|
|
|
$this->assertEquals($expected, $this->Helper->entity());
|
|
$this->assertEquals($expected, $this->Helper->entity());
|
|
|
|
|
|
|
|
$this->assertEquals('HelperTestComment', $this->Helper->model());
|
|
$this->assertEquals('HelperTestComment', $this->Helper->model());
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Test that setEntity doesn't make CamelCase fields that are not associations an
|
|
|
|
|
+ * associated model.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
|
|
+ public function testSetEntityAssociatedCamelCaseField() {
|
|
|
|
|
+ $this->Helper->fieldset = array('HelperTestComment' => array('fields' => array('BigField' => 'something')));
|
|
|
|
|
+ $this->Helper->setEntity('HelperTestComment', true);
|
|
|
|
|
+ $this->Helper->setEntity('HelperTestComment.BigField');
|
|
|
|
|
+
|
|
|
|
|
+ $this->assertEquals('HelperTestComment', $this->Helper->model());
|
|
|
|
|
+ $this->assertEquals('BigField', $this->Helper->field());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|