/** * Returns the URL where the link goes. * * @return String The linked URL. */ public function href() { $url = $this->node->attr('href'); if ($this->url) { $deriver = new AbsoluteUrlDeriver(); $deriver->init($url, $this->url); $url = $deriver->getAbsoluteUrl(); } return $url; }
protected function assertDerivedUrl($testData = array()) { $this->deriver->init($testData['non-absolute-url'], $testData['source-url']); $this->assertEquals($testData['expected-derived-url'], (string) $this->deriver->getAbsoluteUrl(), 'Expected derived URL "' . $testData['expected-derived-url'] . '" not formed from non-absolute URL "' . $testData['non-absolute-url'] . '" and source URL "' . $testData['source-url'] . '"'); }