Exemple #1
0
 public function submit($value = 'Save', $html_attributes = array())
 {
     return FormTagHelper::submit_tag($value, $html_attributes);
 }
 public function test_submit_tag()
 {
     $actual = FormTagHelper::submit_tag();
     $matcher = array('tag' => 'input', 'attributes' => array('type' => 'submit', 'value' => 'Save', 'name' => null));
     $this->assertTag($matcher, $actual, 'Default attributes');
     $this->assertNotContains('id=', $actual, 'No id attribute by default');
     $actual = FormTagHelper::submit_tag('Update');
     $this->assertRegexp('/value="Update"/', $actual, "Setting button label");
     $actual = FormTagHelper::submit_tag('Submit', array('class' => 'blah'));
     $this->assertRegexp('/class="blah"/', $actual, "Additional attributes");
 }