/** * Test setting and getting the name */ public function testGetName() { $ret = $this->input->setName('foo'); $this->assertSame($this->input, $ret); $this->assertSame('foo', $this->input->getName()); $this->assertSame('foo', $this->input->getAttr('name')); }
public function testVerificaSeOsDadosForamInseridos() { $input = new Input(); $input->setType("text"); $input->setId("inputUsuario"); $input->setName("usuario"); $input->setClass("form-control"); $input->setProtected("protected"); $input->setLabel("Usuário"); $input->setAlert("Erro no field."); $input->setValue("valor"); $this->assertEquals("text", $input->getType()); $this->assertEquals("inputUsuario", $input->getId()); $this->assertEquals("usuario", $input->getName()); $this->assertEquals("form-control", $input->getClass()); $this->assertEquals("protected", $input->getProtected()); $this->assertEquals("Usuário", $input->getLabel()); $this->assertEquals("Erro no field.", $input->getAlert()); $this->assertEquals("valor", $input->getValue()); }
/** * \brief Adds an input to the form * \param Input $input An input */ public function addInput(Input $input) { $this->inputs[$input->getName()] = $input; return $this; }