Permalink
Browse files

Adding test for file input creation on hasOne relationship. Refs #6223

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8132 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
1 parent 5d23f46 commit 6551e2a45d767e3194bb22a7979fa33569b7a03a @markstory markstory committed Mar 28, 2009
Showing with 20 additions and 0 deletions.
  1. +20 −0 cake/tests/cases/libs/view/helpers/form.test.php
View
20 cake/tests/cases/libs/view/helpers/form.test.php
@@ -4287,6 +4287,26 @@ function testFileUploadField() {
$this->assertTags($result, $expected);
}
/**
+ * test File upload input on a model not used in create();
+ *
+ * @return void
+ **/
+ function testFileUploadOnOtherModel() {
+ ClassRegistry::removeObject('view');
+ $controller =& new Controller();
+ $controller->name = 'ValidateUsers';
+ $controller->uses = array('ValidateUser');
+ $controller->constructClasses();
+ $view =& new View($controller, true);
+
+ $this->Form->create('ValidateUser', array('type' => 'file'));
+ $result = $this->Form->file('ValidateProfile.city');
+ $expected = array(
+ 'input' => array('type' => 'file', 'name' => 'data[ValidateProfile][city]', 'value' => '', 'id' => 'ValidateProfileCity')
+ );
+ $this->assertTags($result, $expected);
+ }
+/**
* testButton method
*
* @access public

0 comments on commit 6551e2a

Please sign in to comment.