Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created August 21, 2013 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/6296209 to your computer and use it in GitHub Desktop.
Save bakura10/6296209 to your computer and use it in GitHub Desktop.
<?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
)
)
}
}
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