submitButton() public method

Gets the submit values for a selected button.
public submitButton ( SelectorInterface $selector, hash $additional = false ) : SimpleEncoding
$selector SelectorInterface Criteria to apply.
$additional hash Additional data for the form.
return SimpleEncoding Submitted values or false if there is no such button in the form.
 function testButtonTag()
 {
     $form = new SimpleForm(new SimpleFormTag(array()), new SimpleUrl('http://host'));
     $widget = new SimpleButtonTag(array('type' => 'submit', 'name' => 'go', 'value' => 'Go', 'id' => '9'));
     $widget->addContent('Go!');
     $form->addWidget($widget);
     $this->assertTrue($form->hasSubmit(new SimpleByName('go')));
     $this->assertTrue($form->hasSubmit(new SimpleByLabel('Go!')));
     $this->assertEqual($form->submitButton(new SimpleByName('go')), new SimpleGetEncoding(array('go' => 'Go')));
     $this->assertEqual($form->submitButton(new SimpleByLabel('Go!')), new SimpleGetEncoding(array('go' => 'Go')));
     $this->assertEqual($form->submitButton(new SimpleById(9)), new SimpleGetEncoding(array('go' => 'Go')));
 }