Skip to content

Commit

Permalink
Patch setValue method for Input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Mar 14, 2016
1 parent 690723e commit d32f008
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Element/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,16 @@ public function setRequired($required)
return parent::setRequired($required);
}

/**
* Set the value of the form element object
*
* @param mixed $value
* @return Input
*/
public function setValue($value)
{
$this->setAttribute('value', $value);
return parent::setValue($value);
}

}
1 change: 1 addition & 0 deletions tests/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ public function testIsValid()
]
]
]);

$this->assertFalse($form->isValid());
$this->assertTrue($form->hasErrors());
$this->assertEquals(1, count($form->getErrors()));
Expand Down

0 comments on commit d32f008

Please sign in to comment.