TYPO3 CMS  TYPO3_6-2
PageGeneratorTest.php
Go to the documentation of this file.
1 <?php
3 
18 
25 
30 
35 
39  protected function setUp() {
40  $this->pageGeneratorFixture = new PageGeneratorFixture();
41  $this->contentObjectRenderer = new ContentObjectRenderer();
42  }
43 
48  return array(
49  'simple meta' => array(
50  array(
51  'author' => 'Markus Klein',
52  ),
53  FALSE,
54  array(
55  '<meta name="generator" content="TYPO3 CMS">',
56  '<meta name="author" content="Markus Klein">',
57  )
58  ),
59  'simple meta xhtml' => array(
60  array(
61  'author' => 'Markus Klein',
62  ),
63  TRUE,
64  array(
65  '<meta name="generator" content="TYPO3 CMS" />',
66  '<meta name="author" content="Markus Klein" />',
67  )
68  ),
69  'meta with nested stdWrap' => array(
70  array(
71  'author' => 'Markus ',
72  'author.' => array('stdWrap.' => array('wrap' => '|Klein'))
73  ),
74  FALSE,
75  array(
76  '<meta name="generator" content="TYPO3 CMS">',
77  '<meta name="author" content="Markus Klein">',
78  )
79  ),
80  'httpEquivalent meta' => array(
81  array(
82  'X-UA-Compatible' => 'IE=edge,chrome=1',
83  'X-UA-Compatible.' => array('httpEquivalent' => 1)
84  ),
85  FALSE,
86  array(
87  '<meta name="generator" content="TYPO3 CMS">',
88  '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">'
89  )
90  ),
91  'httpEquivalent meta xhtml' => array(
92  array(
93  'X-UA-Compatible' => 'IE=edge,chrome=1',
94  'X-UA-Compatible.' => array('httpEquivalent' => 1)
95  ),
96  TRUE,
97  array(
98  '<meta name="generator" content="TYPO3 CMS" />',
99  '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />'
100  )
101  ),
102  'refresh meta' => array(
103  array(
104  'refresh' => '10',
105  ),
106  FALSE,
107  array(
108  '<meta name="generator" content="TYPO3 CMS">',
109  '<meta http-equiv="refresh" content="10">',
110  )
111  ),
112  'meta with dot' => array(
113  array(
114  'DC.author' => 'Markus Klein',
115  ),
116  FALSE,
117  array(
118  '<meta name="generator" content="TYPO3 CMS">',
119  '<meta name="DC.author" content="Markus Klein">',
120  )
121  ),
122  'meta with colon' => array(
123  array(
124  'OG:title' => 'Magic Tests',
125  ),
126  FALSE,
127  array(
128  '<meta name="generator" content="TYPO3 CMS">',
129  '<meta name="OG:title" content="Magic Tests">',
130  )
131  ),
132  );
133  }
134 
143  public function generateMetaTagHtmlGeneratesCorrectTags(array $typoScript, $xhtml, array $expectedTags) {
144  $result = $this->pageGeneratorFixture->callGenerateMetaTagHtml($typoScript, $xhtml, $this->contentObjectRenderer);
145  $this->assertSame($expectedTags, $result);
146  }
147 
152  return array(
153  'one simple search word' => array(
154  array('test'),
155  FALSE,
156  'test',
157  ),
158  'one simple search word with standalone words' => array(
159  array('test'),
160  TRUE,
161  '[[:space:]]test[[:space:]]',
162  ),
163  'two simple search words' => array(
164  array('test', 'test2'),
165  FALSE,
166  'test|test2',
167  ),
168  'two simple search words with standalone words' => array(
169  array('test', 'test2'),
170  TRUE,
171  '[[:space:]]test[[:space:]]|[[:space:]]test2[[:space:]]',
172  ),
173  'word with regex chars' => array(
174  array('A \\ word with / a bunch of [] regex () chars .*'),
175  FALSE,
176  'A word with \\/ a bunch of \\[\\] regex \\(\\) chars \\.\\*',
177  ),
178  );
179  }
180 
189  public function initializeSearchWordDataInTsfeBuildsCorrectRegex(array $searchWordGetParameters, $enableStandaloneSearchWords, $expectedRegex) {
190 
191  $_GET['sword_list'] = $searchWordGetParameters;
192 
193  $GLOBALS['TSFE'] = new \stdClass();
194  if ($enableStandaloneSearchWords) {
195  $GLOBALS['TSFE']->config = array('config' => array('sword_standAlone' => 1));
196  }
197 
198  $this->pageGeneratorFixture->callInitializeSearchWordDataInTsfe();
199  $this->assertEquals($GLOBALS['TSFE']->sWordRegEx, $expectedRegex);
200  }
201 }
generateMetaTagHtmlGeneratesCorrectTags(array $typoScript, $xhtml, array $expectedTags)
initializeSearchWordDataInTsfeBuildsCorrectRegex(array $searchWordGetParameters, $enableStandaloneSearchWords, $expectedRegex)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]