29 $pageRenderer = $this->getMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'reset',
'prepareRendering',
'renderJavaScriptAndCss',
'getPreparedMarkerArray',
'getTemplateForPart'));
30 $pageRenderer->expects($this->exactly(3))->method(
'reset');
41 public function includingNotAvailableLocalJqueryVersionThrowsException() {
43 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
44 $subject->_set(
'availableLocalJqueryVersions', array(
'1.1.1'));
45 $subject->loadJquery(
'2.2.2');
52 public function includingJqueryWithNonAlphnumericNamespaceThrowsException() {
54 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
55 $subject->loadJquery(NULL, NULL,
'12sd.12fsd');
62 public function addBodyContentAddsContent() {
64 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
65 $expectedReturnValue =
'ABCDE';
66 $subject->addBodyContent(
'A');
67 $subject->addBodyContent(
'B');
68 $subject->addBodyContent(
'C');
69 $subject->addBodyContent(
'D');
70 $subject->addBodyContent(
'E');
71 $out = $subject->getBodyContent();
72 $this->assertEquals($expectedReturnValue, $out);
78 public function addInlineLanguageLabelFileSetsInlineLanguageLabelFiles() {
80 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
83 $stripFromSelectionName = $this->
getUniqueId(
'strip_');
86 $expectedInlineLanguageLabelFile = array(
87 'fileRef' => $fileReference,
88 'selectionPrefix' => $selectionPrefix,
89 'stripFromSelectionName' => $stripFromSelectionName,
90 'errorMode' => $errorMode
93 $subject->addInlineLanguageLabelFile($fileReference, $selectionPrefix, $stripFromSelectionName, $errorMode);
94 $actualResult = $subject->getInlineLanguageLabelFiles();
96 $this->assertSame($expectedInlineLanguageLabelFile, array_pop($actualResult));
102 public function addInlineLanguageLabelFileSetsTwoDifferentInlineLanguageLabelFiles() {
104 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
106 $selectionPrefix1 = $this->
getUniqueId(
'prefix1_');
107 $stripFromSelectionName1 = $this->
getUniqueId(
'strip1_');
109 $expectedInlineLanguageLabelFile1 = array(
110 'fileRef' => $fileReference1,
111 'selectionPrefix' => $selectionPrefix1,
112 'stripFromSelectionName' => $stripFromSelectionName1,
113 'errorMode' => $errorMode1
116 $selectionPrefix2 = $this->
getUniqueId(
'prefix2_');
117 $stripFromSelectionName2 = $this->
getUniqueId(
'strip2_');
119 $expectedInlineLanguageLabelFile2 = array(
120 'fileRef' => $fileReference2,
121 'selectionPrefix' => $selectionPrefix2,
122 'stripFromSelectionName' => $stripFromSelectionName2,
123 'errorMode' => $errorMode2
126 $subject->addInlineLanguageLabelFile($fileReference1, $selectionPrefix1, $stripFromSelectionName1, $errorMode1);
127 $subject->addInlineLanguageLabelFile($fileReference2, $selectionPrefix2, $stripFromSelectionName2, $errorMode2);
128 $actualResult = $subject->getInlineLanguageLabelFiles();
130 $this->assertSame($expectedInlineLanguageLabelFile2, array_pop($actualResult));
131 $this->assertSame($expectedInlineLanguageLabelFile1, array_pop($actualResult));
137 public function addInlineLanguageLabelFileDoesNotSetSameLanguageFileTwice() {
139 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Core\\Page\\PageRenderer', array(
'dummy'), array(),
'', FALSE);
142 $stripFromSelectionName = $this->
getUniqueId(
'strip2_');
145 $subject->addInlineLanguageLabelFile($fileReference, $selectionPrefix, $stripFromSelectionName, $errorMode);
146 $subject->addInlineLanguageLabelFile($fileReference, $selectionPrefix, $stripFromSelectionName, $errorMode);
147 $this->assertSame(1, count($subject->getInlineLanguageLabelFiles()));
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
renderMethodCallsResetInAnyCase()