43 $this->fixture = $this->getMock(
'TYPO3\CMS\IndexedSearch\Indexer', array(
'dummy'));
50 if ($this->temporaryFileName) {
51 @unlink($this->temporaryFileName);
60 $html =
'test <a href="' . $this->
getUniqueId() .
'">test</a> test';
61 $result = $this->fixture->extractHyperLinks($html);
62 $this->assertEquals(1, count(
$result));
63 $this->assertEquals(
'',
$result[0][
'localPath']);
70 $this->temporaryFileName = tempnam(sys_get_temp_dir(),
't3unit-');
71 $html =
'test <a href="testfile">test</a> test';
72 $GLOBALS[
'T3_VAR'][
'ext'][
'indexed_search'][
'indexLocalFiles'] = array(
75 $result = $this->fixture->extractHyperLinks($html);
76 $this->assertEquals(1, count(
$result));
77 $this->assertEquals($this->temporaryFileName,
$result[0][
'localPath']);
85 $html =
'test <a href="' . $baseURL .
'index.php">test</a> test';
86 $result = $this->fixture->extractHyperLinks($html);
87 $this->assertEquals(1, count(
$result));
88 $this->assertEquals(PATH_site .
'index.php',
$result[0][
'localPath']);
95 $html =
'test <a href="index.php">test</a> test';
96 $result = $this->fixture->extractHyperLinks($html);
97 $this->assertEquals(1, count(
$result));
98 $this->assertEquals(PATH_site .
'index.php',
$result[0][
'localPath']);
105 $path = substr(PATH_typo3, strlen(PATH_site) - 1);
106 $html =
'test <a href="' . $path .
'index.php">test</a> test';
107 $result = $this->fixture->extractHyperLinks($html);
108 $this->assertEquals(1, count(
$result));
109 $this->assertEquals(PATH_typo3 .
'index.php',
$result[0][
'localPath']);
117 $html =
'test <a href="' . $absRefPrefix .
'index.php">test</a> test';
118 $GLOBALS[
'TSFE'] = $this->getMock(
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(),
'', FALSE);
119 $GLOBALS[
'TSFE']->config[
'config'][
'absRefPrefix'] = $absRefPrefix;
120 $result = $this->fixture->extractHyperLinks($html);
121 $this->assertEquals(1, count(
$result));
122 $this->assertEquals(PATH_site .
'index.php',
$result[0][
'localPath']);
129 $baseHref =
'http://example.com/';
130 $html =
'<html><head><Base Href="' . $baseHref .
'" /></head></html>';
131 $result = $this->fixture->extractBaseHref($html);
132 $this->assertEquals($baseHref,
$result);
144 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8"/>
145 <title>Some Title</title>
146 <link href=
'css/normalize.css' rel=
'stylesheet' type=
'text/css'/>
150 <div
class=
"non_searchable">
151 not searchable content
153 <!--TYPO3SEARCH_begin-->
154 <div
class=
"searchable">
157 <!--TYPO3SEARCH_end-->
158 <div
class=
"non_searchable">
159 not searchable content
166 <div
class=
"searchable">
172 $result = $this->fixture->typoSearchTags($body);
174 $this->assertEquals($expected, $body);
186 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8"/>
187 <title>Some Title</title>
188 <link href=
'css/normalize.css' rel=
'stylesheet' type=
'text/css'/>
192 <div
class=
"non_searchable">
193 not searchable content
195 <!--TYPO3SEARCH_begin-->
196 <div
class=
"searchable">
199 <!--TYPO3SEARCH_end-->
200 <div
class=
"non_searchable">
201 not searchable content
203 <!--TYPO3SEARCH_begin-->
204 <div
class=
"searchable">
207 <!--TYPO3SEARCH_end-->
208 <div
class=
"non_searchable">
209 not searchable content
216 <div
class=
"searchable">
220 <div
class=
"searchable">
226 $result = $this->fixture->typoSearchTags($body);
228 $this->assertEquals($expected, $body);
typoSearchTagsHandlesMultipleMarkerPairs()
typoSearchTagsRemovesBodyContentOutsideMarkers()
extractHyperLinksFindsCorrectPathUsingAbsRefPrefix()
static getIndpEnv($getEnvName)
extractHyperLinksReturnsCorrectFileUsingT3Vars()
static shortMD5($input, $len=10)
extractHyperLinksRecurnsCorrectPathWithBaseUrl()
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
extractBaseHrefExtractsBaseHref()
extractHyperLinksDoesNotReturnNonExistingLocalPath()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
extractHyperLinksFindsCorrectPathForPathWithinTypo3Directory()
extractHyperLinksFindsCorrectPathWithAbsolutePath()