Ejemplo n.º 1
0
 public function testGetters()
 {
     $element = new Element('test');
     $this->assertEquals('new', $element->setPlaceholder('new')->getPlaceholder());
     $this->assertEquals(array('new'), $element->setValue('new')->getValue());
     $this->assertEquals(array('new', 'new2'), $element->addValue('new2')->getValue());
     $this->assertEquals(array('new', 'new2', 'key' => 'test'), $element->addValue('test', 'key')->getValue());
     $this->assertEquals('new', $element->setTitle('new')->getTitle());
     $this->assertEquals('new', $element->setLabel('new')->getLabel());
     $this->assertEquals('new', $element->setId('new')->getId());
     $this->assertEquals(true, $element->setIsMultiple('1')->getIsMultiple());
     $this->assertEquals(true, $element->setIsMultiple(true)->isMultiple());
     $this->assertEquals(null, $element->getForm());
     $form = new Form();
     $fieldset = new Fieldset();
     // @fix it
     $this->assertInstanceOf('App\\Form\\Fieldset', $form->setForm($form)->getForm());
     $this->assertInstanceOf('App\\Form\\Fieldset', $form->setForm($fieldset)->getForm());
 }