Follows a link by id attribute.
public clickLinkById ( string $id ) : string/boolean | ||
$id | string | ID attribute value. |
Результат | string/boolean |
function testIdLinkFollowing() { $browser = new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); $browser->get('http://www.lastcraft.com/test/link_confirm.php'); $this->assertTrue($browser->clickLinkById(1)); $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); }
public function testIdLinkFollowing() { $browser = new SimpleBrowser(); $browser->addHeader('User-Agent: SimpleTest ' . SimpleTest::getVersion()); $browser->get($this->samples() . 'link_confirm.php'); $this->assertTrue($browser->clickLinkById(1)); $this->assertPattern('/target for the SimpleTest/', $browser->getContent()); }