SimpleBrowser::clickLinkById PHP Method

clickLinkById() public method

Follows a link by id attribute.
public clickLinkById ( string $id ) : string/boolean
$id string ID attribute value.
return string/boolean
    public function clickLinkById($id)
    {
        if (!($url = $this->getLinkById($id))) {
            return false;
        }
        $this->load($url, new SimpleGetEncoding());
        return $this->getContent();
    }

Usage Example

コード例 #1
0
 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());
 }
All Usage Examples Of SimpleBrowser::clickLinkById