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
This commit is contained in:
mark_story 2009-03-28 02:46:23 +00:00
parent 5d23f46118
commit 6551e2a45d

View file

@ -4286,6 +4286,26 @@ class FormHelperTest extends CakeTestCase {
);
$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
*