function testInputFieldCanBeReadBackByLabel() { $label = new SimpleLabelTag(array()); $page = new SimplePage(new MockSimpleHttpResponse()); $page->acceptFormStart(new SimpleFormTag(array("method" => "GET", "action" => "here.php"))); $page->acceptLabelStart($label); $label->addContent('l'); $page->AcceptTag(new SimpleTextTag(array("type" => "text", "name" => "a", "value" => "A"))); $page->acceptLabelEnd(); $page->AcceptTag(new SimpleSubmitTag(array("type" => "submit", "name" => "s"))); $page->acceptFormEnd(); $this->assertEqual($page->getField(new SimpleByLabel('l')), 'A'); }