Example #1
0
 public function testGetSetOptions()
 {
     $form = new Form();
     $form->setOptions(array('ignore_extraneous' => false, 'allow_empty' => false));
     $option = $form->getOptions();
     $this->assertFalse($option['ignore_extraneous']);
     $this->assertFalse($option['allow_empty']);
     $form->setOptions(array('ignore_extraneous' => true));
     $option = $form->getOptions();
     $this->assertTrue($option['ignore_extraneous']);
     $this->assertFalse($option['allow_empty']);
 }
Example #2
0
 /**
  * Test getting options with defaults
  */
 public function testGetOptions()
 {
     $options = ['foo' => 'bar', 'error:min' => 'minimal'] + Form::$defaults + ['container' => true, 'label' => true];
     $this->form->setOption('foo', 'bar');
     $this->form->setOption('error:min', 'minimal');
     $this->assertSame($options, $this->form->getOptions());
 }