mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
5d23f46118
commit
6551e2a45d
1 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue