예제 #1
0
파일: Link.php 프로젝트: piradoiv/munchitos
 /**
  * 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;
 }
예제 #2
0
 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'] . '"');
 }