Permalink
Browse files

Fixed test related to generating file inputs

  • Loading branch information...
1 parent d897ba4 commit 0bb415092ada9531301059b62339a9cd4034c831 @lorenzo lorenzo committed Feb 24, 2014
Showing with 8 additions and 6 deletions.
  1. +8 −6 tests/TestCase/View/Helper/FormHelperTest.php
View
14 tests/TestCase/View/Helper/FormHelperTest.php
@@ -1296,24 +1296,26 @@ public function testTextFieldTypeNumberGenerationForIntegers() {
* @return void
*/
public function testFileUploadFieldTypeGenerationForBinaries() {
- $this->markTestIncomplete('Need to revisit once models work again.');
- $model->setSchema(array('foo' => array(
+ $table = TableRegistry::get('Contacts', [
+ 'className' => __NAMESPACE__ . '\ContactsTable'
+ ]);
+ $table->schema(array('foo' => array(
'type' => 'binary',
'null' => false,
'default' => null,
'length' => 1024
)));
+ $this->Form->create([], ['context' => ['table' => 'Contacts']]);
- $this->Form->create('Contact');
$result = $this->Form->input('foo');
$expected = array(
'div' => array('class' => 'input file'),
- 'label' => array('for' => 'ContactFoo'),
+ 'label' => array('for' => 'foo'),
'Foo',
'/label',
array('input' => array(
- 'type' => 'file', 'name' => 'data[Contact][foo]',
- 'id' => 'ContactFoo'
+ 'type' => 'file', 'name' => 'foo',
+ 'id' => 'foo'
)),
'/div'
);

0 comments on commit 0bb4150

Please sign in to comment.