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']); }
/** * 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()); }