Created
August 21, 2013 15:47
-
-
Save bakura10/6296209 to your computer and use it in GitHub Desktop.
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
<?php | |
class MyFieldset extends Fieldset implements InputFilterProviderInterface | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); | |
$this->add(array( | |
'type' => 'Email', | |
'name' => 'email' | |
)); | |
} | |
public function getInputFilterSpecification() | |
{ | |
return array( | |
'email' => array( | |
'required' => false | |
) | |
) | |
} | |
} |
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
public function testCanOverrideDefaultInputSettings() | |
{ | |
$myFieldset = new MyFieldset(); | |
$form = new Form(); | |
$form->add($myFieldset); | |
$inputFilter = $form->getInputFilter(); | |
$this->assertFalse($inputFilter->get('email')->isRequired()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment