Beispiel #1
0
 /**
  *    Tests to see if a submit button exists with this
  *    label.
  *    @param string $label    Button label.
  *    @return boolean         True if present.
  *    @access public
  */
 function isSubmit($label)
 {
     return (bool) $this->page->getFormBySubmit(new SimpleByLabel($label));
 }
Beispiel #2
0
 function testFormCanBeSubmitted()
 {
     $page = new SimplePage(new MockSimpleHttpResponse());
     $page->acceptFormStart(new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php')));
     $page->AcceptTag(new SimpleSubmitTag(array('type' => 'submit', 'name' => 's')));
     $page->acceptFormEnd();
     $form =& $page->getFormBySubmit(new SimpleByLabel('Submit'));
     $this->assertEqual($form->submitButton(new SimpleByLabel('Submit')), new SimpleGetEncoding(array('s' => 'Submit')));
 }