forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zendframework#4996 broke File filters management
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/ZendTest/Form/TestAsset/FileInputFilterProviderFieldset.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Form | ||
*/ | ||
|
||
namespace ZendTest\Form\TestAsset; | ||
|
||
use Zend\Form\Fieldset; | ||
use Zend\InputFilter\InputFilterProviderInterface; | ||
|
||
class FileInputFilterProviderFieldset extends Fieldset implements InputFilterProviderInterface | ||
{ | ||
public function __construct($name = null, $options = array()) | ||
{ | ||
parent::__construct($name, $options); | ||
|
||
$this->add(array( | ||
'type' => 'file', | ||
'name' => 'file_field', | ||
'options' => array( | ||
'label' => 'File Label', | ||
), | ||
)); | ||
|
||
} | ||
|
||
public function getInputFilterSpecification() | ||
{ | ||
return array( | ||
'file_field' => array( | ||
'filters' => array( | ||
array( | ||
'name' => 'filerenameupload', | ||
'options' => array( | ||
'target' => __FILE__, | ||
'randomize' => true, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/ZendTest/Form/TestAsset/FileInputFilterProviderForm.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Form | ||
*/ | ||
|
||
namespace ZendTest\Form\TestAsset; | ||
|
||
use Zend\Form\Form; | ||
use Zend\InputFilter\InputFilterProviderInterface; | ||
|
||
class FileInputFilterProviderForm extends Form | ||
{ | ||
public function __construct($name = null, $options = array()) | ||
{ | ||
parent::__construct($name, $options); | ||
|
||
$this->add(array( | ||
'type' => __NAMESPACE__ . '\FileInputFilterProviderFieldset', | ||
'name' => 'file_fieldset', | ||
)); | ||
} | ||
} |