Esempio n. 1
0
 /**
  * Checks that base HREF is extracted correctly
  *
  * @return void
  */
 public function textExtractBaseHref()
 {
     $baseHref = 'http://example.com/';
     $html = '<html><head><Base Href="' . $baseHref . '" /></head></html>';
     $result = $this->indexer->extractHyperLinks($html);
     $this->assertEquals($baseHref, $result, 'Incorrect base href was extracted');
 }
Esempio n. 2
0
 /**
  * @test
  */
 public function extractHyperLinksFindsCorrectPathUsingAbsRefPrefix()
 {
     $absRefPrefix = '/' . md5(uniqid(''));
     $html = 'test <a href="' . $absRefPrefix . 'index.php">test</a> test';
     $GLOBALS['TSFE'] = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
     $GLOBALS['TSFE']->config['config']['absRefPrefix'] = $absRefPrefix;
     $result = $this->fixture->extractHyperLinks($html);
     $this->assertEquals(1, count($result));
     $this->assertEquals(PATH_site . 'index.php', $result[0]['localPath']);
 }
Esempio n. 3
0
 /**
  * @test
  */
 public function extractHyperLinksFindsCorrectPathUsingAbsRefPrefix()
 {
     $absRefPrefix = '/' . $this->getUniqueId();
     $html = 'test <a href="' . $absRefPrefix . 'index.php">test</a> test';
     $GLOBALS['TSFE'] = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', false);
     $GLOBALS['TSFE']->config['config']['absRefPrefix'] = $absRefPrefix;
     $result = $this->subject->extractHyperLinks($html);
     $this->assertEquals(1, count($result));
     $this->assertEquals(PATH_site . 'index.php', $result[0]['localPath']);
 }