‪TYPO3CMS  10.4
ContentObjectRendererTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Exception;
21 use Prophecy\Argument;
24 use ‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as CacheFrontendInterface;
35 use TYPO3\CMS\Core\Package\PackageManager;
72 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
73 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
74 
78 class ‪ContentObjectRendererTest extends UnitTestCase
79 {
81 
85  protected ‪$resetSingletonInstances = true;
86 
90  protected ‪$subject;
91 
96 
100  protected ‪$templateServiceMock;
101 
107  protected ‪$contentObjectMap = [
108  'TEXT' => TextContentObject::class,
109  'CASE' => CaseContentObject::class,
110  'COBJ_ARRAY' => ContentObjectArrayContentObject::class,
111  'COA' => ContentObjectArrayContentObject::class,
112  'COA_INT' => ContentObjectArrayInternalContentObject::class,
113  'USER' => UserContentObject::class,
114  'USER_INT' => UserInternalContentObject::class,
115  'FILES' => FilesContentObject::class,
116  'IMAGE' => ImageContentObject::class,
117  'IMG_RESOURCE' => ImageResourceContentObject::class,
118  'CONTENT' => ContentContentObject::class,
119  'RECORDS' => RecordsContentObject::class,
120  'HMENU' => HierarchicalMenuContentObject::class,
121  'CASEFUNC' => CaseContentObject::class,
122  'LOAD_REGISTER' => LoadRegisterContentObject::class,
123  'RESTORE_REGISTER' => RestoreRegisterContentObject::class,
124  'TEMPLATE' => TemplateContentObject::class,
125  'FLUIDTEMPLATE' => FluidTemplateContentObject::class,
126  'SVG' => ScalableVectorGraphicsContentObject::class,
127  'EDITPANEL' => EditPanelContentObject::class
128  ];
129 
133  protected ‪$cacheManager;
134 
135  protected ‪$backupEnvironment = true;
136 
140  protected function ‪setUp(): void
141  {
142  parent::setUp();
143 
144  $site = $this->‪createSiteWithLanguage([
145  'base' => '/',
146  'languageId' => 2,
147  'locale' => 'en_UK',
148  'typo3Language' => 'default',
149  ]);
150 
151  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1534278180;
152  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
153  ->disableOriginalConstructor()
154  ->getMock();
155  $this->templateServiceMock =
156  $this->getMockBuilder(TemplateService::class)
157  ->setConstructorArgs([null, $packageManagerMock])
158  ->setMethods(['linkData'])
159  ->getMock();
160  $pageRepositoryMock =
161  $this->getAccessibleMock(PageRepository::class, ['getRawRecord', 'getMountPointInfo']);
162  $this->frontendControllerMock =
163  $this->getAccessibleMock(
164  TypoScriptFrontendController::class,
165  ['sL'],
166  [],
167  '',
168  false
169  );
170  $this->frontendControllerMock->_set('context', GeneralUtility::makeInstance(Context::class));
171  $this->frontendControllerMock->tmpl = ‪$this->templateServiceMock;
172  $this->frontendControllerMock->config = [];
173  $this->frontendControllerMock->page = [];
174  $this->frontendControllerMock->sys_page = $pageRepositoryMock;
175  $this->frontendControllerMock->_set('language', $site->getLanguageById(2));
177 
178  $this->cacheManager = $this->prophesize(CacheManager::class);
179  GeneralUtility::setSingletonInstance(CacheManager::class, $this->cacheManager->reveal());
180 
181  $this->subject = $this->getAccessibleMock(
182  ContentObjectRenderer::class,
183  ['getResourceFactory', 'getEnvironmentVariable'],
184  [$this->frontendControllerMock]
185  );
186 
187  $logger = $this->prophesize(Logger::class);
188  $this->subject->setLogger($logger->reveal());
189  $this->subject->setContentObjectClassMap($this->contentObjectMap);
190  $this->subject->start([], 'tt_content');
191  }
192 
194  // Utility functions
196 
201  {
202  return ‪$GLOBALS['TSFE'];
203  }
204 
211  protected function ‪handleCharset(string &‪$subject, string &$expected): void
212  {
213  ‪$subject = mb_convert_encoding(‪$subject, 'utf-8', 'iso-8859-1');
214  $expected = mb_convert_encoding($expected, 'utf-8', 'iso-8859-1');
215  }
216 
218  // Tests concerning the getImgResource hook
220 
224  {
225  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
226  $cacheProphecy = $this->prophesize(CacheFrontendInterface::class);
227  $cacheManagerProphecy->getCache('imagesizes')->willReturn($cacheProphecy->reveal());
228  $cacheProphecy->get(Argument::cetera())->willReturn(false);
229  $cacheProphecy->set(Argument::cetera(), null)->willReturn(false);
230  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
231 
232  $resourceFactory = $this->createMock(ResourceFactory::class);
233  $this->subject->expects(self::any())->method('getResourceFactory')->willReturn($resourceFactory);
234 
235  $className = ‪StringUtility::getUniqueId('tx_coretest');
236  $getImgResourceHookMock = $this->getMockBuilder(ContentObjectGetImageResourceHookInterface::class)
237  ->setMethods(['getImgResourcePostProcess'])
238  ->setMockClassName($className)
239  ->getMock();
240  $getImgResourceHookMock
241  ->expects(self::once())
242  ->method('getImgResourcePostProcess')
243  ->willReturnCallback([$this, 'isGetImgResourceHookCalledCallback']);
244  $getImgResourceHookObjects = [$getImgResourceHookMock];
245  $this->subject->_set('getImgResourceHookObjects', $getImgResourceHookObjects);
246  $this->subject->getImgResource('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', []);
247  }
248 
260  string $file,
261  array $fileArray,
262  $imageResource,
264  ): array {
265  self::assertEquals('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', $file);
266  self::assertEquals('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', $imageResource['origFile']);
267  self::assertTrue(is_array($fileArray));
268  self::assertTrue($parent instanceof ‪ContentObjectRenderer);
269  return $imageResource;
270  }
271 
273  // Tests related to getContentObject
275 
290  {
291  $className = TextContentObject::class;
292  $contentObjectName = 'TEST_TEXT';
293  $this->subject->registerContentObjectClass(
294  $className,
295  $contentObjectName
296  );
297  $object = $this->subject->getContentObject($contentObjectName);
298  self::assertInstanceOf($className, $object);
299  }
300 
309  {
310  $className = TextContentObject::class;
311  $contentObjectName = 'TEST_TEXT';
312  $classMap = [$contentObjectName => $className];
313  $this->subject->setContentObjectClassMap($classMap);
314  $object = $this->subject->getContentObject($contentObjectName);
315  self::assertInstanceOf($className, $object);
316  }
317 
327  {
328  $className = TextContentObject::class;
329  $contentObjectName = 'TEST_TEXT';
330  $classMap = [];
331  $this->subject->setContentObjectClassMap($classMap);
332  $classMap[$contentObjectName] = $className;
333  $object = $this->subject->getContentObject($contentObjectName);
334  self::assertNull($object);
335  }
336 
341  public function ‪willReturnNullForUnregisteredObject(): void
342  {
343  $object = $this->subject->getContentObject('FOO');
344  self::assertNull($object);
345  }
346 
352  {
353  $this->expectException(ContentRenderingException::class);
354  $this->subject->registerContentObjectClass(
355  \stdClass::class,
356  'STDCLASS'
357  );
358  $this->subject->getContentObject('STDCLASS');
359  }
360 
364  public function ‪registersAllDefaultContentObjectsDataProvider(): array
365  {
366  $dataProvider = [];
367  foreach ($this->contentObjectMap as $name => $className) {
368  $dataProvider[] = [$name, $className];
369  }
370  return $dataProvider;
371  }
372 
382  public function ‪registersAllDefaultContentObjects(
383  string $objectName,
384  string $className
385  ): void {
386  self::assertTrue(
387  is_subclass_of($className, AbstractContentObject::class)
388  );
389  $object = $this->subject->getContentObject($objectName);
390  self::assertInstanceOf($className, $object);
391  }
392 
394  // Tests concerning getQueryArguments()
396 
399  public function ‪getQueryArgumentsExcludesParameters(): void
400  {
401  $this->subject->expects(self::any())->method('getEnvironmentVariable')->with(self::equalTo('QUERY_STRING'))->willReturn(
402  'key1=value1&key2=value2&key3[key31]=value31&key3[key32][key321]=value321&key3[key32][key322]=value322'
403  );
404  $getQueryArgumentsConfiguration = [];
405  $getQueryArgumentsConfiguration['exclude'] = [];
406  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
407  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
408  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
409  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
410  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2&key3[key32][key322]=value322');
411  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
412  self::assertEquals($expectedResult, $actualResult);
413  }
414 
418  public function ‪getQueryArgumentsExcludesGetParameters(): void
419  {
420  $_GET = [
421  'key1' => 'value1',
422  'key2' => 'value2',
423  'key3' => [
424  'key31' => 'value31',
425  'key32' => [
426  'key321' => 'value321',
427  'key322' => 'value322'
428  ]
429  ]
430  ];
431  $getQueryArgumentsConfiguration = [];
432  $getQueryArgumentsConfiguration['method'] = 'GET';
433  $getQueryArgumentsConfiguration['exclude'] = [];
434  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
435  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
436  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
437  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
438  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2&key3[key32][key322]=value322');
439  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
440  self::assertEquals($expectedResult, $actualResult);
441  }
442 
446  public function ‪getQueryArgumentsOverrulesSingleParameter(): void
447  {
448  $this->subject->expects(self::any())->method('getEnvironmentVariable')->with(self::equalTo('QUERY_STRING'))->willReturn(
449  'key1=value1'
450  );
451  $getQueryArgumentsConfiguration = [];
452  $overruleArguments = [
453  // Should be overridden
454  'key1' => 'value1Overruled',
455  // Shouldn't be set: Parameter doesn't exist in source array and is not forced
456  'key2' => 'value2Overruled'
457  ];
458  $expectedResult = '&key1=value1Overruled';
459  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments);
460  self::assertEquals($expectedResult, $actualResult);
461  }
462 
467  {
468  $_GET = [
469  'key1' => 'value1',
470  'key2' => 'value2',
471  'key3' => [
472  'key31' => 'value31',
473  'key32' => [
474  'key321' => 'value321',
475  'key322' => 'value322'
476  ]
477  ]
478  ];
479  $getQueryArgumentsConfiguration = [];
480  $getQueryArgumentsConfiguration['method'] = 'GET';
481  $getQueryArgumentsConfiguration['exclude'] = [];
482  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
483  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
484  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
485  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
486  $overruleArguments = [
487  // Should be overridden
488  'key2' => 'value2Overruled',
489  'key3' => [
490  'key32' => [
491  // Shouldn't be set: Parameter is excluded and not forced
492  'key321' => 'value321Overruled',
493  // Should be overridden: Parameter is not excluded
494  'key322' => 'value322Overruled',
495  // Shouldn't be set: Parameter doesn't exist in source array and is not forced
496  'key323' => 'value323Overruled'
497  ]
498  ]
499  ];
500  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key322]=value322Overruled');
501  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments);
502  self::assertEquals($expectedResult, $actualResult);
503  }
504 
509  {
510  $this->subject->expects(self::any())->method('getEnvironmentVariable')->with(self::equalTo('QUERY_STRING'))->willReturn(
511  'key1=value1&key2=value2&key3[key31]=value31&key3[key32][key321]=value321&key3[key32][key322]=value322'
512  );
513  $_GET = [
514  'key1' => 'value1',
515  'key2' => 'value2',
516  'key3' => [
517  'key31' => 'value31',
518  'key32' => [
519  'key321' => 'value321',
520  'key322' => 'value322'
521  ]
522  ]
523  ];
524  $getQueryArgumentsConfiguration = [];
525  $getQueryArgumentsConfiguration['exclude'] = [];
526  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
527  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
528  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
529  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key322]';
530  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
531  $overruleArguments = [
532  // Should be overridden
533  'key2' => 'value2Overruled',
534  'key3' => [
535  'key32' => [
536  // Should be set: Parameter is excluded but forced
537  'key321' => 'value321Overruled',
538  // Should be set: Parameter doesn't exist in source array but is forced
539  'key323' => 'value323Overruled'
540  ]
541  ]
542  ];
543  // implicitly using default 'QUERY_STRING' as 'method'
544  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key321]=value321Overruled&key3[key32][key323]=value323Overruled');
545  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, true);
546  self::assertEquals($expectedResult, $actualResult);
547  $getQueryArgumentsConfiguration['method'] = 'GET';
548  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, true);
549  self::assertEquals($expectedResult, $actualResult);
550  }
551 
556  {
557  return [
558  'GET,POST' => [
559  'GET,POST',
560  'Assigning typolink.addQueryString.method = GET,POST or POST,GET is not supported anymore since TYPO3 v10.0 - falling back to GET',
561  '&common=GET&get=GET'
562  ],
563  'POST,GET' => [
564  'POST,GET',
565  'Assigning typolink.addQueryString.method = GET,POST or POST,GET is not supported anymore since TYPO3 v10.0 - falling back to GET',
566  '&common=GET&get=GET'
567  ],
568  'POST' => [
569  'POST',
570  'Assigning typolink.addQueryString.method = POST is not supported anymore since TYPO3 v10.0',
571  ''
572  ],
573  ];
574  }
575 
584  public function ‪getQueryArgumentsHandlesRemovedMethods(string $method, string $expectedMessage, string $expectedResult): void
585  {
586  $_GET = ['common' => 'GET', 'get' => 'GET'];
587  $configuration = ['method' => $method];
588  $this->expectWarning();
589  $this->expectExceptionMessage($expectedMessage);
590  self::assertSame($expectedResult, $this->subject->getQueryArguments($configuration));
591  }
592 
599  private function ‪rawUrlEncodeSquareBracketsInUrl(string $string): string
600  {
601  return str_replace(['[', ']'], ['%5B', '%5D'], $string);
602  }
603 
605  // Tests concerning crop
607 
610  public function ‪cropIsMultibyteSafe(): void
611  {
612  self::assertEquals('бла', $this->subject->crop('бла', '3|...'));
613  }
614 
616 
618  // Tests concerning cropHTML
620 
628  public function ‪cropHTMLDataProvider(): array
629  {
630  $plainText = 'Kasper Sk' . chr(229) . 'rh' . chr(248)
631  . 'j implemented the original version of the crop function.';
632  $textWithMarkup = '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
633  . chr(229) . 'rh' . chr(248) . 'j</a> implemented</strong> the '
634  . 'original version of the crop function.';
635  $textWithEntities = 'Kasper Sk&aring;rh&oslash;j implemented the; '
636  . 'original version of the crop function.';
637  $textWithLinebreaks = "Lorem ipsum dolor sit amet,\n"
638  . "consetetur sadipscing elitr,\n"
639  . 'sed diam nonumy eirmod tempor invidunt ut labore e'
640  . 't dolore magna aliquyam';
641  $textWith2000Chars = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ips &amp;. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vesti&amp;';
642  $textWith1000AmpHtmlEntity = str_repeat('&amp;', 1000);
643  $textWith2000AmpHtmlEntity = str_repeat('&amp;', 2000);
644 
645  return [
646  'plain text; 11|...' => [
647  'Kasper Sk' . chr(229) . 'r...',
648  $plainText,
649  '11|...',
650  ],
651  'plain text; -58|...' => [
652  '...h' . chr(248) . 'j implemented the original version of '
653  . 'the crop function.',
654  $plainText,
655  '-58|...',
656  ],
657  'plain text; 4|...|1' => [
658  'Kasp...',
659  $plainText,
660  '4|...|1',
661  ],
662  'plain text; 20|...|1' => [
663  'Kasper Sk' . chr(229) . 'rh' . chr(248) . 'j...',
664  $plainText,
665  '20|...|1',
666  ],
667  'plain text; -5|...|1' => [
668  '...tion.',
669  $plainText,
670  '-5|...|1',
671  ],
672  'plain text; -49|...|1' => [
673  '...the original version of the crop function.',
674  $plainText,
675  '-49|...|1',
676  ],
677  'text with markup; 11|...' => [
678  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
679  . chr(229) . 'r...</a></strong>',
680  $textWithMarkup,
681  '11|...',
682  ],
683  'text with markup; 13|...' => [
684  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
685  . chr(229) . 'rh' . chr(248) . '...</a></strong>',
686  $textWithMarkup,
687  '13|...',
688  ],
689  'text with markup; 14|...' => [
690  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
691  . chr(229) . 'rh' . chr(248) . 'j</a>...</strong>',
692  $textWithMarkup,
693  '14|...',
694  ],
695  'text with markup; 15|...' => [
696  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
697  . chr(229) . 'rh' . chr(248) . 'j</a> ...</strong>',
698  $textWithMarkup,
699  '15|...',
700  ],
701  'text with markup; 29|...' => [
702  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
703  . chr(229) . 'rh' . chr(248) . 'j</a> implemented</strong> '
704  . 'th...',
705  $textWithMarkup,
706  '29|...',
707  ],
708  'text with markup; -58|...' => [
709  '<strong><a href="mailto:kasper@typo3.org">...h' . chr(248)
710  . 'j</a> implemented</strong> the original version of the crop '
711  . 'function.',
712  $textWithMarkup,
713  '-58|...',
714  ],
715  'text with markup 4|...|1' => [
716  '<strong><a href="mailto:kasper@typo3.org">Kasp...</a>'
717  . '</strong>',
718  $textWithMarkup,
719  '4|...|1',
720  ],
721  'text with markup; 11|...|1' => [
722  '<strong><a href="mailto:kasper@typo3.org">Kasper...</a>'
723  . '</strong>',
724  $textWithMarkup,
725  '11|...|1',
726  ],
727  'text with markup; 13|...|1' => [
728  '<strong><a href="mailto:kasper@typo3.org">Kasper...</a>'
729  . '</strong>',
730  $textWithMarkup,
731  '13|...|1',
732  ],
733  'text with markup; 14|...|1' => [
734  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
735  . chr(229) . 'rh' . chr(248) . 'j</a>...</strong>',
736  $textWithMarkup,
737  '14|...|1',
738  ],
739  'text with markup; 15|...|1' => [
740  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
741  . chr(229) . 'rh' . chr(248) . 'j</a>...</strong>',
742  $textWithMarkup,
743  '15|...|1',
744  ],
745  'text with markup; 29|...|1' => [
746  '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
747  . chr(229) . 'rh' . chr(248) . 'j</a> implemented</strong>...',
748  $textWithMarkup,
749  '29|...|1',
750  ],
751  'text with markup; -66|...|1' => [
752  '<strong><a href="mailto:kasper@typo3.org">...Sk' . chr(229)
753  . 'rh' . chr(248) . 'j</a> implemented</strong> the original v'
754  . 'ersion of the crop function.',
755  $textWithMarkup,
756  '-66|...|1',
757  ],
758  'text with entities 9|...' => [
759  'Kasper Sk...',
760  $textWithEntities,
761  '9|...',
762  ],
763  'text with entities 10|...' => [
764  'Kasper Sk&aring;...',
765  $textWithEntities,
766  '10|...',
767  ],
768  'text with entities 11|...' => [
769  'Kasper Sk&aring;r...',
770  $textWithEntities,
771  '11|...',
772  ],
773  'text with entities 13|...' => [
774  'Kasper Sk&aring;rh&oslash;...',
775  $textWithEntities,
776  '13|...',
777  ],
778  'text with entities 14|...' => [
779  'Kasper Sk&aring;rh&oslash;j...',
780  $textWithEntities,
781  '14|...',
782  ],
783  'text with entities 15|...' => [
784  'Kasper Sk&aring;rh&oslash;j ...',
785  $textWithEntities,
786  '15|...',
787  ],
788  'text with entities 16|...' => [
789  'Kasper Sk&aring;rh&oslash;j i...',
790  $textWithEntities,
791  '16|...',
792  ],
793  'text with entities -57|...' => [
794  '...j implemented the; original version of the crop function.',
795  $textWithEntities,
796  '-57|...',
797  ],
798  'text with entities -58|...' => [
799  '...&oslash;j implemented the; original version of the crop '
800  . 'function.',
801  $textWithEntities,
802  '-58|...',
803  ],
804  'text with entities -59|...' => [
805  '...h&oslash;j implemented the; original version of the crop '
806  . 'function.',
807  $textWithEntities,
808  '-59|...',
809  ],
810  'text with entities 4|...|1' => [
811  'Kasp...',
812  $textWithEntities,
813  '4|...|1',
814  ],
815  'text with entities 9|...|1' => [
816  'Kasper...',
817  $textWithEntities,
818  '9|...|1',
819  ],
820  'text with entities 10|...|1' => [
821  'Kasper...',
822  $textWithEntities,
823  '10|...|1',
824  ],
825  'text with entities 11|...|1' => [
826  'Kasper...',
827  $textWithEntities,
828  '11|...|1',
829  ],
830  'text with entities 13|...|1' => [
831  'Kasper...',
832  $textWithEntities,
833  '13|...|1',
834  ],
835  'text with entities 14|...|1' => [
836  'Kasper Sk&aring;rh&oslash;j...',
837  $textWithEntities,
838  '14|...|1',
839  ],
840  'text with entities 15|...|1' => [
841  'Kasper Sk&aring;rh&oslash;j...',
842  $textWithEntities,
843  '15|...|1',
844  ],
845  'text with entities 16|...|1' => [
846  'Kasper Sk&aring;rh&oslash;j...',
847  $textWithEntities,
848  '16|...|1',
849  ],
850  'text with entities -57|...|1' => [
851  '...implemented the; original version of the crop function.',
852  $textWithEntities,
853  '-57|...|1',
854  ],
855  'text with entities -58|...|1' => [
856  '...implemented the; original version of the crop function.',
857  $textWithEntities,
858  '-58|...|1',
859  ],
860  'text with entities -59|...|1' => [
861  '...implemented the; original version of the crop function.',
862  $textWithEntities,
863  '-59|...|1',
864  ],
865  'text with dash in html-element 28|...|1' => [
866  'Some text with a link to <link email.address@example.org - '
867  . 'mail "Open email window">my...</link>',
868  'Some text with a link to <link email.address@example.org - m'
869  . 'ail "Open email window">my email.address@example.org<'
870  . '/link> and text after it',
871  '28|...|1',
872  ],
873  'html elements with dashes in attributes' => [
874  '<em data-foo="x">foobar</em>foo',
875  '<em data-foo="x">foobar</em>foobaz',
876  '9',
877  ],
878  'html elements with iframe embedded 24|...|1' => [
879  'Text with iframe <iframe src="//what.ever/"></iframe> and...',
880  'Text with iframe <iframe src="//what.ever/">'
881  . '</iframe> and text after it',
882  '24|...|1',
883  ],
884  'html elements with script tag embedded 24|...|1' => [
885  'Text with script <script>alert(\'foo\');</script> and...',
886  'Text with script <script>alert(\'foo\');</script> '
887  . 'and text after it',
888  '24|...|1',
889  ],
890  'text with linebreaks' => [
891  "Lorem ipsum dolor sit amet,\nconsetetur sadipscing elitr,\ns"
892  . 'ed diam nonumy eirmod tempor invidunt ut labore e'
893  . 't dolore magna',
894  $textWithLinebreaks,
895  '121',
896  ],
897  'long text under the crop limit' => [
898  'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit' . ' ...',
899  $textWith2000Chars,
900  '962|...',
901  ],
902  'long text above the crop limit' => [
903  'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ips &amp;. N' . '...',
904  $textWith2000Chars,
905  '1000|...',
906  ],
907  'long text above the crop limit #2' => [
908  'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ips &amp;. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vesti&amp;' . '...',
909  $textWith2000Chars . $textWith2000Chars,
910  '2000|...',
911  ],
912  // ensure that large number of html entities do not break the the regexp splittin
913  'long text with large number of html entities' => [
914  $textWith1000AmpHtmlEntity . '...',
915  $textWith2000AmpHtmlEntity,
916  '1000|...',
917  ],
918  ];
919  }
920 
930  public function ‪cropHTML(string $expect, string $content, string $conf): void
931  {
932  $this->‪handleCharset($content, $expect);
933  self::assertSame(
934  $expect,
935  $this->subject->cropHTML($content, $conf)
936  );
937  }
938 
944  public function ‪roundDataProvider(): array
945  {
946  return [
947  // floats
948  'down' => [1.0, 1.11, []],
949  'up' => [2.0, 1.51, []],
950  'rounds up from x.50' => [2.0, 1.50, []],
951  'down with decimals' => [0.12, 0.1231, ['decimals' => 2]],
952  'up with decimals' => [0.13, 0.1251, ['decimals' => 2]],
953  'ceil' => [1.0, 0.11, ['roundType' => 'ceil']],
954  'ceil does not accept decimals' => [
955  1.0,
956  0.111,
957  [
958  'roundType' => 'ceil',
959  'decimals' => 2,
960  ],
961  ],
962  'floor' => [2.0, 2.99, ['roundType' => 'floor']],
963  'floor does not accept decimals' => [
964  2.0,
965  2.999,
966  [
967  'roundType' => 'floor',
968  'decimals' => 2,
969  ],
970  ],
971  'round, down' => [1.0, 1.11, ['roundType' => 'round']],
972  'round, up' => [2.0, 1.55, ['roundType' => 'round']],
973  'round does accept decimals' => [
974  5.56,
975  5.5555,
976  [
977  'roundType' => 'round',
978  'decimals' => 2,
979  ],
980  ],
981  // strings
982  'emtpy string' => [0.0, '', []],
983  'word string' => [0.0, 'word', []],
984  'float string' => [1.0, '1.123456789', []],
985  // other types
986  'null' => [0.0, null, []],
987  'false' => [0.0, false, []],
988  'true' => [1.0, true, []]
989  ];
990  }
991 
1009  public function ‪round(float $expect, $content, array $conf): void
1010  {
1011  self::assertSame(
1012  $expect,
1013  $this->subject->_call('round', $content, $conf)
1014  );
1015  }
1016 
1020  public function ‪recursiveStdWrapProperlyRendersBasicString(): void
1021  {
1022  $stdWrapConfiguration = [
1023  'noTrimWrap' => '|| 123|',
1024  'stdWrap.' => [
1025  'wrap' => '<b>|</b>'
1026  ]
1027  ];
1028  self::assertSame(
1029  '<b>Test</b> 123',
1030  $this->subject->stdWrap('Test', $stdWrapConfiguration)
1031  );
1032  }
1033 
1037  public function ‪recursiveStdWrapIsOnlyCalledOnce(): void
1038  {
1039  $stdWrapConfiguration = [
1040  'append' => 'TEXT',
1041  'append.' => [
1042  'data' => 'register:Counter'
1043  ],
1044  'stdWrap.' => [
1045  'append' => 'LOAD_REGISTER',
1046  'append.' => [
1047  'Counter.' => [
1048  'prioriCalc' => 'intval',
1049  'cObject' => 'TEXT',
1050  'cObject.' => [
1051  'data' => 'register:Counter',
1052  'wrap' => '|+1',
1053  ]
1054  ]
1055  ]
1056  ]
1057  ];
1058  self::assertSame(
1059  'Counter:1',
1060  $this->subject->stdWrap('Counter:', $stdWrapConfiguration)
1061  );
1062  }
1063 
1069  public function ‪numberFormatDataProvider(): array
1070  {
1071  return [
1072  'testing decimals' => [
1073  '0.80',
1074  0.8,
1075  ['decimals' => 2]
1076  ],
1077  'testing decimals with input as string' => [
1078  '0.80',
1079  '0.8',
1080  ['decimals' => 2]
1081  ],
1082  'testing dec_point' => [
1083  '0,8',
1084  0.8,
1085  ['decimals' => 1, 'dec_point' => ',']
1086  ],
1087  'testing thousands_sep' => [
1088  '1.000',
1089  999.99,
1090  [
1091  'decimals' => 0,
1092  'thousands_sep.' => ['char' => 46]
1093  ]
1094  ],
1095  'testing mixture' => [
1096  '1.281.731,5',
1097  1281731.45,
1098  [
1099  'decimals' => 1,
1100  'dec_point.' => ['char' => 44],
1101  'thousands_sep.' => ['char' => 46]
1102  ]
1103  ]
1104  ];
1105  }
1106 
1116  public function ‪numberFormat(string $expects, $content, array $conf): void
1117  {
1118  self::assertSame(
1119  $expects,
1120  $this->subject->numberFormat($content, $conf)
1121  );
1122  }
1123 
1129  public function ‪replacementDataProvider(): array
1130  {
1131  return [
1132  'multiple replacements, including regex' => [
1133  'There is an animal, an animal and an animal around the block! Yeah!',
1134  'There_is_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!',
1135  [
1136  '20.' => [
1137  'search' => '_',
1138  'replace.' => ['char' => '32']
1139  ],
1140  '120.' => [
1141  'search' => 'in da hood',
1142  'replace' => 'around the block'
1143  ],
1144  '130.' => [
1145  'search' => '#a (Cat|Dog|Tiger)#i',
1146  'replace' => 'an animal',
1147  'useRegExp' => '1'
1148  ]
1149  ]
1150  ],
1151  'replacement with optionSplit, normal pattern' => [
1152  'There1is2a3cat,3a3dog3and3a3tiger3in3da3hood!3Yeah!',
1153  'There_is_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!',
1154  [
1155  '10.' => [
1156  'search' => '_',
1157  'replace' => '1 || 2 || 3',
1158  'useOptionSplitReplace' => '1',
1159  'useRegExp' => '0'
1160  ]
1161  ]
1162  ],
1163  'replacement with optionSplit, using regex' => [
1164  'There is a tiny cat, a midsized dog and a big tiger in da hood! Yeah!',
1165  'There is a cat, a dog and a tiger in da hood! Yeah!',
1166  [
1167  '10.' => [
1168  'search' => '#(a) (Cat|Dog|Tiger)#i',
1169  'replace' => '${1} tiny ${2} || ${1} midsized ${2} || ${1} big ${2}',
1170  'useOptionSplitReplace' => '1',
1171  'useRegExp' => '1'
1172  ]
1173  ]
1174  ]
1175  ];
1176  }
1177 
1187  public function ‪replacement(string $expects, string $content, array $conf): void
1188  {
1189  self::assertSame(
1190  $expects,
1191  $this->subject->_call('replacement', $content, $conf)
1192  );
1193  }
1194 
1200  public function ‪calcAgeDataProvider(): array
1201  {
1202  return [
1203  'minutes' => [
1204  '2 min',
1205  120,
1206  ' min| hrs| days| yrs',
1207  ],
1208  'hours' => [
1209  '2 hrs',
1210  7200,
1211  ' min| hrs| days| yrs',
1212  ],
1213  'days' => [
1214  '7 days',
1215  604800,
1216  ' min| hrs| days| yrs',
1217  ],
1218  'day with provided singular labels' => [
1219  '1 day',
1220  86400,
1221  ' min| hrs| days| yrs| min| hour| day| year',
1222  ],
1223  'years' => [
1224  '45 yrs',
1225  1417997800,
1226  ' min| hrs| days| yrs',
1227  ],
1228  'different labels' => [
1229  '2 Minutes',
1230  120,
1231  ' Minutes| Hrs| Days| Yrs',
1232  ],
1233  'negative values' => [
1234  '-7 days',
1235  -604800,
1236  ' min| hrs| days| yrs',
1237  ],
1238  'default label values for wrong label input' => [
1239  '2 min',
1240  121,
1241  '10',
1242  ],
1243  'default singular label values for wrong label input' => [
1244  '1 year',
1245  31536000,
1246  '10',
1247  ]
1248  ];
1249  }
1250 
1260  public function ‪calcAge(string $expect, int $timestamp, string $labels): void
1261  {
1262  self::assertSame(
1263  $expect,
1264  $this->subject->calcAge($timestamp, $labels)
1265  );
1266  }
1267 
1271  public function ‪stdWrapReturnsExpectationDataProvider(): array
1272  {
1273  return [
1274  'Prevent silent bool conversion' => [
1275  '1+1',
1276  [
1277  'prioriCalc.' => [
1278  'wrap' => '|',
1279  ],
1280  ],
1281  '1+1',
1282  ],
1283  ];
1284  }
1285 
1293  public function ‪stdWrapReturnsExpectation(string $content, array $configuration, string $expectation): void
1294  {
1295  self::assertSame($expectation, $this->subject->stdWrap($content, $configuration));
1296  }
1297 
1303  public function ‪substringDataProvider(): array
1304  {
1305  return [
1306  'sub -1' => ['g', 'substring', '-1'],
1307  'sub -1,0' => ['g', 'substring', '-1,0'],
1308  'sub -1,-1' => ['', 'substring', '-1,-1'],
1309  'sub -1,1' => ['g', 'substring', '-1,1'],
1310  'sub 0' => ['substring', 'substring', '0'],
1311  'sub 0,0' => ['substring', 'substring', '0,0'],
1312  'sub 0,-1' => ['substrin', 'substring', '0,-1'],
1313  'sub 0,1' => ['s', 'substring', '0,1'],
1314  'sub 1' => ['ubstring', 'substring', '1'],
1315  'sub 1,0' => ['ubstring', 'substring', '1,0'],
1316  'sub 1,-1' => ['ubstrin', 'substring', '1,-1'],
1317  'sub 1,1' => ['u', 'substring', '1,1'],
1318  'sub' => ['substring', 'substring', ''],
1319  ];
1320  }
1321 
1331  public function ‪substring(string $expect, string $content, string $conf): void
1332  {
1333  self::assertSame($expect, $this->subject->substring($content, $conf));
1334  }
1335 
1337  // Tests concerning getData()
1339 
1343  public function ‪getDataWithTypeGpDataProvider(): array
1344  {
1345  return [
1346  'Value in get-data' => ['onlyInGet', 'GetValue'],
1347  'Value in post-data' => ['onlyInPost', 'PostValue'],
1348  'Value in post-data overriding get-data' => ['inGetAndPost', 'ValueInPost'],
1349  ];
1350  }
1351 
1360  public function ‪getDataWithTypeGp(string $key, string $expectedValue): void
1361  {
1362  $_GET = [
1363  'onlyInGet' => 'GetValue',
1364  'inGetAndPost' => 'ValueInGet',
1365  ];
1366  $_POST = [
1367  'onlyInPost' => 'PostValue',
1368  'inGetAndPost' => 'ValueInPost',
1369  ];
1370  self::assertEquals($expectedValue, $this->subject->getData('gp:' . $key));
1371  }
1372 
1378  public function ‪getDataWithTypeTsfe(): void
1379  {
1380  self::assertEquals(‪$GLOBALS['TSFE']->metaCharset, $this->subject->getData('tsfe:metaCharset'));
1381  }
1382 
1388  public function ‪getDataWithTypeGetenv(): void
1389  {
1390  $envName = ‪StringUtility::getUniqueId('frontendtest');
1391  $value = ‪StringUtility::getUniqueId('someValue');
1392  putenv($envName . '=' . $value);
1393  self::assertEquals($value, $this->subject->getData('getenv:' . $envName));
1394  }
1395 
1401  public function ‪getDataWithTypeGetindpenv(): void
1402  {
1403  $this->subject->expects(self::once())->method('getEnvironmentVariable')
1404  ->with(self::equalTo('SCRIPT_FILENAME'))->willReturn('dummyPath');
1405  self::assertEquals('dummyPath', $this->subject->getData('getindpenv:SCRIPT_FILENAME'));
1406  }
1407 
1413  public function ‪getDataWithTypeField(): void
1414  {
1415  $key = 'someKey';
1416  $value = 'someValue';
1417  $field = [$key => $value];
1418 
1419  self::assertEquals($value, $this->subject->getData('field:' . $key, $field));
1420  }
1429  {
1430  $key = 'somekey|level1|level2';
1431  $value = 'somevalue';
1432  $field = ['somekey' => ['level1' => ['level2' => 'somevalue']]];
1433 
1434  self::assertEquals($value, $this->subject->getData('field:' . $key, $field));
1435  }
1436 
1438  {
1439  return [
1440  'no whitespace' => [
1441  'typoScriptPath' => 'file:current:uid',
1442  ],
1443  'always whitespace' => [
1444  'typoScriptPath' => 'file : current : uid',
1445  ],
1446  'mixed whitespace' => [
1447  'typoScriptPath' => 'file:current : uid',
1448  ],
1449  ];
1450  }
1458  public function ‪getDataWithTypeFileReturnsUidOfFileObject(string $typoScriptPath): void
1459  {
1461  $file = $this->createMock(File::class);
1462  $file->expects(self::once())->method('getUid')->willReturn($uid);
1463  $this->subject->setCurrentFile($file);
1464  self::assertEquals($uid, $this->subject->getData($typoScriptPath));
1465  }
1466 
1472  public function ‪getDataWithTypeParameters(): void
1473  {
1474  $key = ‪StringUtility::getUniqueId('someKey');
1475  $value = ‪StringUtility::getUniqueId('someValue');
1476  $this->subject->parameters[$key] = $value;
1477 
1478  self::assertEquals($value, $this->subject->getData('parameters:' . $key));
1479  }
1480 
1486  public function ‪getDataWithTypeRegister(): void
1487  {
1488  $key = ‪StringUtility::getUniqueId('someKey');
1489  $value = ‪StringUtility::getUniqueId('someValue');
1490  ‪$GLOBALS['TSFE']->register[$key] = $value;
1491 
1492  self::assertEquals($value, $this->subject->getData('register:' . $key));
1493  }
1494 
1500  public function ‪getDataWithTypeSession(): void
1501  {
1502  $frontendUser = $this->getMockBuilder(FrontendUserAuthentication::class)
1503  ->setMethods(['getSessionData'])
1504  ->getMock();
1505  $frontendUser->expects(self::once())->method('getSessionData')->with('myext')->willReturn([
1506  'mydata' => [
1507  'someValue' => 42,
1508  ],
1509  ]);
1510  ‪$GLOBALS['TSFE']->fe_user = $frontendUser;
1511 
1512  self::assertEquals(42, $this->subject->getData('session:myext|mydata|someValue'));
1513  }
1514 
1520  public function ‪getDataWithTypeLevel(): void
1521  {
1522  $rootline = [
1523  0 => ['uid' => 1, 'title' => 'title1'],
1524  1 => ['uid' => 2, 'title' => 'title2'],
1525  2 => ['uid' => 3, 'title' => 'title3'],
1526  ];
1527 
1528  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1529  self::assertEquals(2, $this->subject->getData('level'));
1530  }
1531 
1537  public function ‪getDataWithTypeGlobal(): void
1538  {
1539  self::assertEquals(‪$GLOBALS['TSFE']->metaCharset, $this->subject->getData('global:TSFE|metaCharset'));
1540  }
1541 
1547  public function ‪getDataWithTypeLeveltitle(): void
1548  {
1549  $rootline = [
1550  0 => ['uid' => 1, 'title' => 'title1'],
1551  1 => ['uid' => 2, 'title' => 'title2'],
1552  2 => ['uid' => 3, 'title' => ''],
1553  ];
1554 
1555  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1556  self::assertEquals('', $this->subject->getData('leveltitle:-1'));
1557  // since "title3" is not set, it will slide to "title2"
1558  self::assertEquals('title2', $this->subject->getData('leveltitle:-1,slide'));
1559  }
1560 
1566  public function ‪getDataWithTypeLevelmedia(): void
1567  {
1568  $rootline = [
1569  0 => ['uid' => 1, 'title' => 'title1', 'media' => 'media1'],
1570  1 => ['uid' => 2, 'title' => 'title2', 'media' => 'media2'],
1571  2 => ['uid' => 3, 'title' => 'title3', 'media' => ''],
1572  ];
1573 
1574  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1575  self::assertEquals('', $this->subject->getData('levelmedia:-1'));
1576  // since "title3" is not set, it will slide to "title2"
1577  self::assertEquals('media2', $this->subject->getData('levelmedia:-1,slide'));
1578  }
1579 
1585  public function ‪getDataWithTypeLeveluid(): void
1586  {
1587  $rootline = [
1588  0 => ['uid' => 1, 'title' => 'title1'],
1589  1 => ['uid' => 2, 'title' => 'title2'],
1590  2 => ['uid' => 3, 'title' => 'title3'],
1591  ];
1592 
1593  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1594  self::assertEquals(3, $this->subject->getData('leveluid:-1'));
1595  // every element will have a uid - so adding slide doesn't really make sense, just for completeness
1596  self::assertEquals(3, $this->subject->getData('leveluid:-1,slide'));
1597  }
1598 
1604  public function ‪getDataWithTypeLevelfield(): void
1605  {
1606  $rootline = [
1607  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1608  1 => ['uid' => 2, 'title' => 'title2', 'testfield' => 'field2'],
1609  2 => ['uid' => 3, 'title' => 'title3', 'testfield' => ''],
1610  ];
1611 
1612  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1613  self::assertEquals('', $this->subject->getData('levelfield:-1,testfield'));
1614  self::assertEquals('field2', $this->subject->getData('levelfield:-1,testfield,slide'));
1615  }
1616 
1622  public function ‪getDataWithTypeFullrootline(): void
1623  {
1624  $rootline1 = [
1625  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1626  ];
1627  $rootline2 = [
1628  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1629  1 => ['uid' => 2, 'title' => 'title2', 'testfield' => 'field2'],
1630  2 => ['uid' => 3, 'title' => 'title3', 'testfield' => 'field3'],
1631  ];
1632 
1633  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline1;
1634  ‪$GLOBALS['TSFE']->rootLine = $rootline2;
1635  self::assertEquals('field2', $this->subject->getData('fullrootline:-1,testfield'));
1636  }
1637 
1643  public function ‪getDataWithTypeDate(): void
1644  {
1645  $format = 'Y-M-D';
1646  $defaultFormat = 'd/m Y';
1647 
1648  self::assertEquals(date($format, ‪$GLOBALS['EXEC_TIME']), $this->subject->getData('date:' . $format));
1649  self::assertEquals(date($defaultFormat, ‪$GLOBALS['EXEC_TIME']), $this->subject->getData('date'));
1650  }
1651 
1657  public function ‪getDataWithTypePage(): void
1658  {
1659  $uid = random_int(0, mt_getrandmax());
1660  ‪$GLOBALS['TSFE']->page['uid'] = $uid;
1661  self::assertEquals($uid, $this->subject->getData('page:uid'));
1662  }
1663 
1669  public function ‪getDataWithTypeCurrent(): void
1670  {
1671  $key = ‪StringUtility::getUniqueId('someKey');
1672  $value = ‪StringUtility::getUniqueId('someValue');
1673  $this->subject->data[$key] = $value;
1674  $this->subject->currentValKey = $key;
1675  self::assertEquals($value, $this->subject->getData('current'));
1676  }
1677 
1683  public function ‪getDataWithTypeDb(): void
1684  {
1685  $dummyRecord = ['uid' => 5, 'title' => 'someTitle'];
1686 
1687  ‪$GLOBALS['TSFE']->sys_page->expects(self::atLeastOnce())->method('getRawRecord')->with(
1688  'tt_content',
1689  '106'
1690  )->willReturn($dummyRecord);
1691  self::assertEquals($dummyRecord['title'], $this->subject->getData('db:tt_content:106:title'));
1692  }
1693 
1699  public function ‪getDataWithTypeLll(): void
1700  {
1701  $key = ‪StringUtility::getUniqueId('someKey');
1702  $value = ‪StringUtility::getUniqueId('someValue');
1703  ‪$GLOBALS['TSFE']->expects(self::once())->method('sL')->with('LLL:' . $key)->willReturn($value);
1704  self::assertEquals($value, $this->subject->getData('lll:' . $key));
1705  }
1706 
1712  public function ‪getDataWithTypePath(): void
1713  {
1714  $filenameIn = 'typo3/sysext/frontend/Public/Icons/Extension.svg';
1715  self::assertEquals($filenameIn, $this->subject->getData('path:' . $filenameIn));
1716  }
1717 
1723  public function ‪getDataWithTypeContext(): void
1724  {
1725  $context = new ‪Context([
1726  'workspace' => new ‪WorkspaceAspect(3),
1727  'frontend.user' => new ‪UserAspect(new ‪FrontendUserAuthentication(), [0, -1])
1728  ]);
1729  GeneralUtility::setSingletonInstance(Context::class, $context);
1730  self::assertEquals(3, $this->subject->getData('context:workspace:id'));
1731  self::assertEquals('0,-1', $this->subject->getData('context:frontend.user:groupIds'));
1732  self::assertFalse($this->subject->getData('context:frontend.user:isLoggedIn'));
1733  self::assertSame('', $this->subject->getData('context:frontend.user:foozball'));
1734  }
1735 
1741  public function ‪getDataWithTypeSite(): void
1742  {
1743  $site = new ‪Site('my-site', 123, [
1744  'base' => 'http://example.com',
1745  'custom' => [
1746  'config' => [
1747  'nested' => 'yeah'
1748  ]
1749  ]
1750  ]);
1751  $this->frontendControllerMock->_set('site', $site);
1752  self::assertEquals('http://example.com', $this->subject->getData('site:base'));
1753  self::assertEquals('yeah', $this->subject->getData('site:custom.config.nested'));
1754  }
1755 
1761  public function ‪getDataWithTypeSiteWithBaseVariants(): void
1762  {
1763  $packageManager = new PackageManager(new ‪DependencyOrderingService());
1764  GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager);
1765  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
1766  $cacheManagerProphecy->getCache('core')->willReturn(new ‪NullFrontend('core'));
1767  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
1768  putenv('LOCAL_DEVELOPMENT=1');
1769 
1770  $site = new ‪Site('my-site', 123, [
1771  'base' => 'http://prod.com',
1772  'baseVariants' => [
1773  [
1774  'base' => 'http://staging.com',
1775  'condition' => 'applicationContext == "Production/Staging"'
1776  ],
1777  [
1778  'base' => 'http://dev.com',
1779  'condition' => 'getenv("LOCAL_DEVELOPMENT") == 1'
1780  ],
1781  ]
1782  ]);
1783 
1784  $this->frontendControllerMock->_set('site', $site);
1785  self::assertEquals('http://dev.com', $this->subject->getData('site:base'));
1786  }
1787 
1793  public function ‪getDataWithTypeSiteLanguage(): void
1794  {
1795  $site = $this->‪createSiteWithLanguage([
1796  'base' => '/',
1797  'languageId' => 1,
1798  'locale' => 'de_DE',
1799  'title' => 'languageTitle',
1800  'navigationTitle' => 'German'
1801  ]);
1802  $language = $site->getLanguageById(1);
1803  $this->frontendControllerMock->_set('language', $language);
1804  self::assertEquals('German', $this->subject->getData('siteLanguage:navigationTitle'));
1805  }
1806 
1812  public function ‪getDataWithTypeParentRecordNumber(): void
1813  {
1814  $recordNumber = random_int(0, mt_getrandmax());
1815  $this->subject->parentRecordNumber = $recordNumber;
1816  self::assertEquals($recordNumber, $this->subject->getData('cobj:parentRecordNumber'));
1817  }
1818 
1824  public function ‪getDataWithTypeDebugRootline(): void
1825  {
1826  $rootline = [
1827  0 => ['uid' => 1, 'title' => 'title1'],
1828  1 => ['uid' => 2, 'title' => 'title2'],
1829  2 => ['uid' => 3, 'title' => ''],
1830  ];
1831  $expectedResult = 'array(3items)0=>array(2items)uid=>1(integer)title=>"title1"(6chars)1=>array(2items)uid=>2(integer)title=>"title2"(6chars)2=>array(2items)uid=>3(integer)title=>""(0chars)';
1832  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1833 
1835  $result = $this->subject->getData('debug:rootLine');
1836  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1837 
1838  self::assertEquals($expectedResult, $cleanedResult);
1839  }
1840 
1846  public function ‪getDataWithTypeDebugFullRootline(): void
1847  {
1848  $rootline = [
1849  0 => ['uid' => 1, 'title' => 'title1'],
1850  1 => ['uid' => 2, 'title' => 'title2'],
1851  2 => ['uid' => 3, 'title' => ''],
1852  ];
1853  $expectedResult = 'array(3items)0=>array(2items)uid=>1(integer)title=>"title1"(6chars)1=>array(2items)uid=>2(integer)title=>"title2"(6chars)2=>array(2items)uid=>3(integer)title=>""(0chars)';
1854  ‪$GLOBALS['TSFE']->rootLine = $rootline;
1855 
1857  $result = $this->subject->getData('debug:fullRootLine');
1858  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1859 
1860  self::assertEquals($expectedResult, $cleanedResult);
1861  }
1862 
1868  public function ‪getDataWithTypeDebugData(): void
1869  {
1870  $key = ‪StringUtility::getUniqueId('someKey');
1871  $value = ‪StringUtility::getUniqueId('someValue');
1872  $this->subject->data = [$key => $value];
1873 
1874  $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
1875 
1877  $result = $this->subject->getData('debug:data');
1878  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1879 
1880  self::assertEquals($expectedResult, $cleanedResult);
1881  }
1882 
1888  public function ‪getDataWithTypeDebugRegister(): void
1889  {
1890  $key = ‪StringUtility::getUniqueId('someKey');
1891  $value = ‪StringUtility::getUniqueId('someValue');
1892  ‪$GLOBALS['TSFE']->register = [$key => $value];
1893 
1894  $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
1895 
1897  $result = $this->subject->getData('debug:register');
1898  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1899 
1900  self::assertEquals($expectedResult, $cleanedResult);
1901  }
1902 
1908  public function ‪getDataWithTypeDebugPage(): void
1909  {
1910  $uid = random_int(0, mt_getrandmax());
1911  ‪$GLOBALS['TSFE']->page = ['uid' => $uid];
1912 
1913  $expectedResult = 'array(1item)uid=>' . $uid . '(integer)';
1914 
1916  $result = $this->subject->getData('debug:page');
1917  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1919  self::assertEquals($expectedResult, $cleanedResult);
1920  }
1921 
1925  public function ‪aTagParamsHasLeadingSpaceIfNotEmpty(): void
1926  {
1927  $aTagParams = $this->subject->getATagParams(['ATagParams' => 'data-test="testdata"']);
1928  self::assertEquals(' data-test="testdata"', $aTagParams);
1929  }
1930 
1935  {
1936  ‪$GLOBALS['TSFE']->ATagParams = 'data-global="dataglobal"';
1937  $aTagParams = $this->subject->getATagParams(['ATagParams' => 'data-test="testdata"']);
1938  self::assertEquals(' data-global="dataglobal" data-test="testdata"', $aTagParams);
1939  }
1940 
1944  public function ‪aTagParamsHasNoLeadingSpaceIfEmpty(): void
1945  {
1946  // make sure global ATagParams are empty
1947  ‪$GLOBALS['TSFE']->ATagParams = '';
1948  $aTagParams = $this->subject->getATagParams(['ATagParams' => '']);
1949  self::assertEquals('', $aTagParams);
1950  }
1951 
1955  public function ‪renderingContentObjectThrowsException(): void
1956  {
1957  $this->expectException(\LogicException::class);
1958  $this->expectExceptionCode(1414513947);
1959  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
1960  $this->subject->render($contentObjectFixture, []);
1961  }
1962 
1967  {
1969  new ‪ApplicationContext('Production'),
1970  true,
1971  false,
1976  ‪Environment::getBackendPath() . '/index.php',
1977  ‪Environment::isWindows() ? 'WINDOWS' : 'UNIX'
1978  );
1979  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
1980  $this->subject->render($contentObjectFixture, []);
1981  }
1982 
1987  {
1988  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
1989 
1990  $configuration = [
1991  'exceptionHandler' => '1'
1992  ];
1993  $this->subject->render($contentObjectFixture, $configuration);
1994  }
1995 
2000  {
2001  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2002 
2003  $this->frontendControllerMock->config['config']['contentObjectExceptionHandler'] = '1';
2004  $this->subject->render($contentObjectFixture, []);
2005  }
2006 
2011  {
2012  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2013  $this->expectException(\LogicException::class);
2014  $this->expectExceptionCode(1414513947);
2015  $this->frontendControllerMock->config['config']['contentObjectExceptionHandler'] = '1';
2016  $configuration = [
2017  'exceptionHandler' => '0'
2018  ];
2019  $this->subject->render($contentObjectFixture, $configuration);
2020  }
2021 
2025  public function ‪renderedErrorMessageCanBeCustomized(): void
2026  {
2027  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2028 
2029  $configuration = [
2030  'exceptionHandler' => '1',
2031  'exceptionHandler.' => [
2032  'errorMessage' => 'New message for testing',
2033  ]
2034  ];
2036  self::assertSame('New message for testing', $this->subject->render($contentObjectFixture, $configuration));
2037  }
2038 
2043  {
2044  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2045 
2046  $this->frontendControllerMock
2047  ->config['config']['contentObjectExceptionHandler.'] = [
2048  'errorMessage' => 'Global message for testing',
2049  ];
2050  $configuration = [
2051  'exceptionHandler' => '1',
2052  'exceptionHandler.' => [
2053  'errorMessage' => 'New message for testing',
2054  ]
2055  ];
2057  self::assertSame('New message for testing', $this->subject->render($contentObjectFixture, $configuration));
2058  }
2059 
2064  {
2065  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2066 
2067  $configuration = [
2068  'exceptionHandler' => '1',
2069  'exceptionHandler.' => [
2070  'ignoreCodes.' => ['10.' => '1414513947'],
2071  ]
2072  ];
2073  $this->expectException(\LogicException::class);
2074  $this->expectExceptionCode(1414513947);
2075  $this->subject->render($contentObjectFixture, $configuration);
2076  }
2077 
2082  {
2083  $contentObjectFixture = $this->getMockBuilder(AbstractContentObject::class)
2084  ->setConstructorArgs([$this->subject])
2085  ->getMock();
2086  $contentObjectFixture->expects(self::once())
2087  ->method('render')
2088  ->willReturnCallback(function () {
2089  throw new \LogicException('Exception during rendering', 1414513947);
2090  });
2091  return $contentObjectFixture;
2092  }
2093 
2097  protected function ‪getLibParseFunc(): array
2098  {
2099  return [
2100  'makelinks' => '1',
2101  'makelinks.' => [
2102  'http.' => [
2103  'keep' => '{$styles.content.links.keep}',
2104  'extTarget' => '',
2105  'mailto.' => [
2106  'keep' => 'path',
2107  ],
2108  ],
2109  ],
2110  'tags' => [
2111  'link' => 'TEXT',
2112  'link.' => [
2113  'current' => '1',
2114  'typolink.' => [
2115  'parameter.' => [
2116  'data' => 'parameters : allParams',
2117  ],
2118  ],
2119  'parseFunc.' => [
2120  'constants' => '1',
2121  ],
2122  ],
2123  ],
2124 
2125  'allowTags' => 'a, abbr, acronym, address, article, aside, b, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, dfn, dl, div, dt, em, font, footer, header, h1, h2, h3, h4, h5, h6, hr, i, img, ins, kbd, label, li, link, meta, nav, ol, p, pre, q, samp, sdfield, section, small, span, strike, strong, style, sub, sup, table, thead, tbody, tfoot, td, th, tr, title, tt, u, ul, var',
2126  'denyTags' => '*',
2127  'sword' => '<span class="csc-sword">|</span>',
2128  'constants' => '1',
2129  'nonTypoTagStdWrap.' => [
2130  'HTMLparser' => '1',
2131  'HTMLparser.' => [
2132  'keepNonMatchedTags' => '1',
2133  'htmlSpecialChars' => '2',
2134  ],
2135  ],
2136  ];
2137  }
2138 
2143  {
2144  return [
2145  'Link to url' => [
2146  'TYPO3',
2147  [
2148  'directImageLink' => false,
2149  'parameter' => 'http://typo3.org',
2150  ],
2151  '<a href="http://typo3.org">TYPO3</a>',
2152  ],
2153  'Link to url without schema' => [
2154  'TYPO3',
2155  [
2156  'directImageLink' => false,
2157  'parameter' => 'typo3.org',
2158  ],
2159  '<a href="http://typo3.org">TYPO3</a>',
2160  ],
2161  'Link to url without link text' => [
2162  '',
2163  [
2164  'directImageLink' => false,
2165  'parameter' => 'http://typo3.org',
2166  ],
2167  '<a href="http://typo3.org">http://typo3.org</a>',
2168  ],
2169  'Link to url with attributes' => [
2170  'TYPO3',
2171  [
2172  'parameter' => 'http://typo3.org',
2173  'ATagParams' => 'class="url-class"',
2174  'extTarget' => '_blank',
2175  'title' => 'Open new window',
2176  ],
2177  '<a href="http://typo3.org" title="Open new window" target="_blank" class="url-class" rel="noreferrer">TYPO3</a>',
2178  ],
2179  'Link to url with attributes and custom target name' => [
2180  'TYPO3',
2181  [
2182  'parameter' => 'http://typo3.org',
2183  'ATagParams' => 'class="url-class"',
2184  'extTarget' => 'someTarget',
2185  'title' => 'Open new window',
2186  ],
2187  '<a href="http://typo3.org" title="Open new window" target="someTarget" class="url-class" rel="noreferrer">TYPO3</a>',
2188  ],
2189  'Link to url with attributes in parameter' => [
2190  'TYPO3',
2191  [
2192  'parameter' => 'http://typo3.org _blank url-class "Open new window"',
2193  ],
2194  '<a href="http://typo3.org" title="Open new window" target="_blank" class="url-class" rel="noreferrer">TYPO3</a>',
2195  ],
2196  'Link to url with attributes in parameter and custom target name' => [
2197  'TYPO3',
2198  [
2199  'parameter' => 'http://typo3.org someTarget url-class "Open new window"',
2200  ],
2201  '<a href="http://typo3.org" title="Open new window" target="someTarget" class="url-class" rel="noreferrer">TYPO3</a>',
2202  ],
2203  'Link to url with script tag' => [
2204  '',
2205  [
2206  'directImageLink' => false,
2207  'parameter' => 'http://typo3.org<script>alert(123)</script>',
2208  ],
2209  '<a href="http://typo3.org&lt;script&gt;alert(123)&lt;/script&gt;">http://typo3.org&lt;script&gt;alert(123)&lt;/script&gt;</a>',
2210  ],
2211  'Link to email address' => [
2212  'Email address',
2213  [
2214  'parameter' => 'foo@bar.org',
2215  ],
2216  '<a href="mailto:foo@bar.org">Email address</a>',
2217  ],
2218  'Link to email address without link text' => [
2219  '',
2220  [
2221  'parameter' => 'foo@bar.org',
2222  ],
2223  '<a href="mailto:foo@bar.org">foo@bar.org</a>',
2224  ],
2225  'Link to email with attributes' => [
2226  'Email address',
2227  [
2228  'parameter' => 'foo@bar.org',
2229  'ATagParams' => 'class="email-class"',
2230  'title' => 'Write an email',
2231  ],
2232  '<a href="mailto:foo@bar.org" title="Write an email" class="email-class">Email address</a>',
2233  ],
2234  'Link to email with attributes in parameter' => [
2235  'Email address',
2236  [
2237  'parameter' => 'foo@bar.org - email-class "Write an email"',
2238  ],
2239  '<a href="mailto:foo@bar.org" title="Write an email" class="email-class">Email address</a>',
2240  ],
2241  ];
2242  }
2243 
2251  public function ‪typolinkReturnsCorrectLinksForEmailsAndUrls($linkText, $configuration, $expectedResult): void
2252  {
2253  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
2254  ->disableOriginalConstructor()
2255  ->getMock();
2256  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
2257  ->setConstructorArgs([null, $packageManagerMock])
2258  ->setMethods(['dummy'])
2259  ->getMock();
2260  $templateServiceObjectMock->setup = [
2261  'lib.' => [
2262  'parseFunc.' => $this->‪getLibParseFunc(),
2263  ],
2264  ];
2265  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
2266  $typoScriptFrontendControllerMockObject->config = [
2267  'config' => [],
2268  ];
2269  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
2270  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
2271 
2272  $this->cacheManager->getCache('runtime')->willReturn(new NullFrontend('dummy'));
2273  $this->cacheManager->getCache('core')->willReturn(new NullFrontend('dummy'));
2274 
2275  GeneralUtility::setSingletonInstance(SiteConfiguration::class, new SiteConfiguration(‪Environment::getConfigPath() . '/sites'));
2276 
2277  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
2278 
2279  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2280  }
2281 
2291  array $settings,
2292  $linkText,
2293  $mailAddress,
2294  $expected
2295  ): void {
2296  $this->‪getFrontendController()->spamProtectEmailAddresses = $settings['spamProtectEmailAddresses'];
2297  $this->‪getFrontendController()->config['config'] = $settings;
2298  $typoScript = ['parameter' => $mailAddress];
2300  self::assertEquals($expected, $this->subject->typoLink($linkText, $typoScript));
2301  }
2302 
2307  {
2308  return [
2309  'plain mail without mailto scheme' => [
2310  [
2311  'spamProtectEmailAddresses' => '',
2312  'spamProtectEmailAddresses_atSubst' => '',
2313  'spamProtectEmailAddresses_lastDotSubst' => '',
2314  ],
2315  'some.body@test.typo3.org',
2316  'some.body@test.typo3.org',
2317  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2318  ],
2319  'plain mail with mailto scheme' => [
2320  [
2321  'spamProtectEmailAddresses' => '',
2322  'spamProtectEmailAddresses_atSubst' => '',
2323  'spamProtectEmailAddresses_lastDotSubst' => '',
2324  ],
2325  'some.body@test.typo3.org',
2326  'mailto:some.body@test.typo3.org',
2327  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2328  ],
2329  'plain with at and dot substitution' => [
2330  [
2331  'spamProtectEmailAddresses' => '0',
2332  'spamProtectEmailAddresses_atSubst' => '(at)',
2333  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2334  ],
2335  'some.body@test.typo3.org',
2336  'mailto:some.body@test.typo3.org',
2337  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2338  ],
2339  'mono-alphabetic substitution offset +1' => [
2340  [
2341  'spamProtectEmailAddresses' => '1',
2342  'spamProtectEmailAddresses_atSubst' => '',
2343  'spamProtectEmailAddresses_lastDotSubst' => '',
2344  ],
2345  'some.body@test.typo3.org',
2346  'mailto:some.body@test.typo3.org',
2347  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body(at)test.typo3.org</a>',
2348  ],
2349  'mono-alphabetic substitution offset +1 with at substitution' => [
2350  [
2351  'spamProtectEmailAddresses' => '1',
2352  'spamProtectEmailAddresses_atSubst' => '@',
2353  'spamProtectEmailAddresses_lastDotSubst' => '',
2354  ],
2355  'some.body@test.typo3.org',
2356  'mailto:some.body@test.typo3.org',
2357  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body@test.typo3.org</a>',
2358  ],
2359  'mono-alphabetic substitution offset +1 with at and dot substitution' => [
2360  [
2361  'spamProtectEmailAddresses' => '1',
2362  'spamProtectEmailAddresses_atSubst' => '(at)',
2363  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2364  ],
2365  'some.body@test.typo3.org',
2366  'mailto:some.body@test.typo3.org',
2367  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body(at)test.typo3(dot)org</a>',
2368  ],
2369  'mono-alphabetic substitution offset -1 with at and dot substitution' => [
2370  [
2371  'spamProtectEmailAddresses' => '-1',
2372  'spamProtectEmailAddresses_atSubst' => '(at)',
2373  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2374  ],
2375  'some.body@test.typo3.org',
2376  'mailto:some.body@test.typo3.org',
2377  '<a href="javascript:linkTo_UnCryptMailto(%27lzhksn9rnld-ancxZsdrs-sxon2-nqf%27);">some.body(at)test.typo3(dot)org</a>',
2378  ],
2379  'mono-alphabetic substitution offset 2 with at and dot substitution and encoded subject' => [
2380  [
2381  'spamProtectEmailAddresses' => '2',
2382  'spamProtectEmailAddresses_atSubst' => '(at)',
2383  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2384  ],
2385  'some.body@test.typo3.org',
2386  'mailto:some.body@test.typo3.org?subject=foo%20bar',
2387  '<a href="javascript:linkTo_UnCryptMailto(%27ocknvq%2Cuqog0dqfaBvguv0varq50qti%3Fuwdlgev%3Dhqq%2542dct%27);">some.body@test.typo3.org</a>',
2388  ],
2389  'entity substitution with at and dot substitution' => [
2390  [
2391  'spamProtectEmailAddresses' => 'ascii',
2392  'spamProtectEmailAddresses_atSubst' => '',
2393  'spamProtectEmailAddresses_lastDotSubst' => '',
2394  ],
2395  'some.body@test.typo3.org',
2396  'mailto:some.body@test.typo3.org',
2397  '<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#115;&#111;&#109;&#101;&#46;&#98;&#111;&#100;&#121;&#64;&#116;&#101;&#115;&#116;&#46;&#116;&#121;&#112;&#111;&#51;&#46;&#111;&#114;&#103;">some.body(at)test.typo3.org</a>',
2398  ],
2399  'entity substitution with at and dot substitution with at and dot substitution' => [
2400  [
2401  'spamProtectEmailAddresses' => 'ascii',
2402  'spamProtectEmailAddresses_atSubst' => '(at)',
2403  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2404  ],
2405  'some.body@test.typo3.org',
2406  'mailto:some.body@test.typo3.org',
2407  '<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#115;&#111;&#109;&#101;&#46;&#98;&#111;&#100;&#121;&#64;&#116;&#101;&#115;&#116;&#46;&#116;&#121;&#112;&#111;&#51;&#46;&#111;&#114;&#103;">some.body(at)test.typo3(dot)org</a>',
2408  ],
2409  ];
2410  }
2411 
2415  public function ‪typolinkReturnsCorrectLinksFilesDataProvider(): array
2416  {
2417  return [
2418  'Link to file' => [
2419  'My file',
2420  [
2421  'directImageLink' => false,
2422  'parameter' => 'fileadmin/foo.bar',
2423  ],
2424  '<a href="fileadmin/foo.bar">My file</a>',
2425  ],
2426  'Link to file without link text' => [
2427  '',
2428  [
2429  'directImageLink' => false,
2430  'parameter' => 'fileadmin/foo.bar',
2431  ],
2432  '<a href="fileadmin/foo.bar">fileadmin/foo.bar</a>',
2433  ],
2434  'Link to file with attributes' => [
2435  'My file',
2436  [
2437  'parameter' => 'fileadmin/foo.bar',
2438  'ATagParams' => 'class="file-class"',
2439  'fileTarget' => '_blank',
2440  'title' => 'Title of the file',
2441  ],
2442  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2443  ],
2444  'Link to file with attributes and additional href' => [
2445  'My file',
2446  [
2447  'parameter' => 'fileadmin/foo.bar',
2448  'ATagParams' => 'href="foo-bar"',
2449  'fileTarget' => '_blank',
2450  'title' => 'Title of the file',
2451  ],
2452  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank">My file</a>',
2453  ],
2454  'Link to file with attributes and additional href and class' => [
2455  'My file',
2456  [
2457  'parameter' => 'fileadmin/foo.bar',
2458  'ATagParams' => 'href="foo-bar" class="file-class"',
2459  'fileTarget' => '_blank',
2460  'title' => 'Title of the file',
2461  ],
2462  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2463  ],
2464  'Link to file with attributes and additional class and href' => [
2465  'My file',
2466  [
2467  'parameter' => 'fileadmin/foo.bar',
2468  'ATagParams' => 'class="file-class" href="foo-bar"',
2469  'fileTarget' => '_blank',
2470  'title' => 'Title of the file',
2471  ],
2472  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2473  ],
2474  'Link to file with attributes and additional class and href and title' => [
2475  'My file',
2476  [
2477  'parameter' => 'fileadmin/foo.bar',
2478  'ATagParams' => 'class="file-class" href="foo-bar" title="foo-bar"',
2479  'fileTarget' => '_blank',
2480  'title' => 'Title of the file',
2481  ],
2482  '<a href="fileadmin/foo.bar" title="foo-bar" target="_blank" class="file-class">My file</a>',
2483  ],
2484  'Link to file with attributes and empty ATagParams' => [
2485  'My file',
2486  [
2487  'parameter' => 'fileadmin/foo.bar',
2488  'ATagParams' => '',
2489  'fileTarget' => '_blank',
2490  'title' => 'Title of the file',
2491  ],
2492  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank">My file</a>',
2493  ],
2494  'Link to file with attributes in parameter' => [
2495  'My file',
2496  [
2497  'parameter' => 'fileadmin/foo.bar _blank file-class "Title of the file"',
2498  ],
2499  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2500  ],
2501  'Link to file with script tag in name' => [
2502  '',
2503  [
2504  'directImageLink' => false,
2505  'parameter' => 'fileadmin/<script>alert(123)</script>',
2506  ],
2507  '<a href="fileadmin/&lt;script&gt;alert(123)&lt;/script&gt;">fileadmin/&lt;script&gt;alert(123)&lt;/script&gt;</a>',
2508  ],
2509  ];
2510  }
2511 
2519  public function ‪typolinkReturnsCorrectLinksFiles($linkText, $configuration, $expectedResult): void
2520  {
2521  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
2522  ->disableOriginalConstructor()
2523  ->getMock();
2524  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
2525  ->setConstructorArgs([null, $packageManagerMock])
2526  ->setMethods(['dummy'])
2527  ->getMock();
2528  $templateServiceObjectMock->setup = [
2529  'lib.' => [
2530  'parseFunc.' => $this->‪getLibParseFunc(),
2531  ],
2532  ];
2533  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
2534  $typoScriptFrontendControllerMockObject->config = [
2535  'config' => [],
2536  ];
2537  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
2538  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
2539 
2540  $resourceFactory = $this->prophesize(ResourceFactory::class);
2541  GeneralUtility::setSingletonInstance(ResourceFactory::class, $resourceFactory->reveal());
2542 
2543  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
2545  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2546  }
2547 
2552  {
2553  return [
2554  'Link to file' => [
2555  'My file',
2556  [
2557  'directImageLink' => false,
2558  'parameter' => 'fileadmin/foo.bar',
2559  ],
2560  '/',
2561  '<a href="/fileadmin/foo.bar">My file</a>',
2562  ],
2563  'Link to file with longer absRefPrefix' => [
2564  'My file',
2565  [
2566  'directImageLink' => false,
2567  'parameter' => 'fileadmin/foo.bar',
2568  ],
2569  '/sub/',
2570  '<a href="/sub/fileadmin/foo.bar">My file</a>',
2571  ],
2572  'Link to absolute file' => [
2573  'My file',
2574  [
2575  'directImageLink' => false,
2576  'parameter' => '/images/foo.bar',
2577  ],
2578  '/',
2579  '<a href="/images/foo.bar">My file</a>',
2580  ],
2581  'Link to absolute file with longer absRefPrefix' => [
2582  'My file',
2583  [
2584  'directImageLink' => false,
2585  'parameter' => '/images/foo.bar',
2586  ],
2587  '/sub/',
2588  '<a href="/images/foo.bar">My file</a>',
2589  ],
2590  'Link to absolute file with identical longer absRefPrefix' => [
2591  'My file',
2592  [
2593  'directImageLink' => false,
2594  'parameter' => '/sub/fileadmin/foo.bar',
2595  ],
2596  '/sub/',
2597  '<a href="/sub/fileadmin/foo.bar">My file</a>',
2598  ],
2599  'Link to file with empty absRefPrefix' => [
2600  'My file',
2601  [
2602  'directImageLink' => false,
2603  'parameter' => 'fileadmin/foo.bar',
2604  ],
2605  '',
2606  '<a href="fileadmin/foo.bar">My file</a>',
2607  ],
2608  'Link to absolute file with empty absRefPrefix' => [
2609  'My file',
2610  [
2611  'directImageLink' => false,
2612  'parameter' => '/fileadmin/foo.bar',
2613  ],
2614  '',
2615  '<a href="/fileadmin/foo.bar">My file</a>',
2616  ],
2617  'Link to file with attributes with absRefPrefix' => [
2618  'My file',
2619  [
2620  'parameter' => 'fileadmin/foo.bar',
2621  'ATagParams' => 'class="file-class"',
2622  'fileTarget' => '_blank',
2623  'title' => 'Title of the file',
2624  ],
2625  '/',
2626  '<a href="/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2627  ],
2628  'Link to file with attributes with longer absRefPrefix' => [
2629  'My file',
2630  [
2631  'parameter' => 'fileadmin/foo.bar',
2632  'ATagParams' => 'class="file-class"',
2633  'fileTarget' => '_blank',
2634  'title' => 'Title of the file',
2635  ],
2636  '/sub/',
2637  '<a href="/sub/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2638  ],
2639  'Link to absolute file with attributes with absRefPrefix' => [
2640  'My file',
2641  [
2642  'parameter' => '/images/foo.bar',
2643  'ATagParams' => 'class="file-class"',
2644  'fileTarget' => '_blank',
2645  'title' => 'Title of the file',
2646  ],
2647  '/',
2648  '<a href="/images/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2649  ],
2650  'Link to absolute file with attributes with longer absRefPrefix' => [
2651  'My file',
2652  [
2653  'parameter' => '/images/foo.bar',
2654  'ATagParams' => 'class="file-class"',
2655  'fileTarget' => '_blank',
2656  'title' => 'Title of the file',
2657  ],
2658  '/sub/',
2659  '<a href="/images/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2660  ],
2661  'Link to absolute file with attributes with identical longer absRefPrefix' => [
2662  'My file',
2663  [
2664  'parameter' => '/sub/fileadmin/foo.bar',
2665  'ATagParams' => 'class="file-class"',
2666  'fileTarget' => '_blank',
2667  'title' => 'Title of the file',
2668  ],
2669  '/sub/',
2670  '<a href="/sub/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2671  ],
2672  ];
2673  }
2674 
2684  $linkText,
2685  $configuration,
2686  $absRefPrefix,
2687  $expectedResult
2688  ): void {
2689  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
2690  ->disableOriginalConstructor()
2691  ->getMock();
2692  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
2693  ->setConstructorArgs([null, $packageManagerMock])
2694  ->setMethods(['dummy'])
2695  ->getMock();
2696  $templateServiceObjectMock->setup = [
2697  'lib.' => [
2698  'parseFunc.' => $this->‪getLibParseFunc(),
2699  ],
2700  ];
2701  $resourceFactory = $this->prophesize(ResourceFactory::class);
2702  GeneralUtility::setSingletonInstance(ResourceFactory::class, $resourceFactory->reveal());
2703 
2704  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
2705  $typoScriptFrontendControllerMockObject->config = [
2706  'config' => [],
2707  ];
2708  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
2709  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
2710  ‪$GLOBALS['TSFE']->absRefPrefix = $absRefPrefix;
2711  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
2713  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2714  }
2715 
2719  public function ‪typolinkOpensInNewWindow()
2720  {
2721  $this->cacheManager->getCache('runtime')->willReturn(new ‪NullFrontend('runtime'));
2722  $this->cacheManager->getCache('core')->willReturn(new ‪NullFrontend('runtime'));
2723  GeneralUtility::setSingletonInstance(SiteConfiguration::class, new ‪SiteConfiguration(‪Environment::getConfigPath() . '/sites'));
2724  $linkText = 'Nice Text';
2725  $configuration = [
2726  'parameter' => 'https://example.com 13x84:target=myexample'
2727  ];
2728  $expectedResult = '<a href="https://example.com" target="myexample" onclick="openPic(\'https:\/\/example.com\',\'myexample\',\'width=13,height=84\');return false;" rel="noreferrer">Nice Text</a>';
2729  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2730  $linkText = 'Nice Text with default window name';
2731  $configuration = [
2732  'parameter' => 'https://example.com 13x84'
2733  ];
2734  $expectedResult = '<a href="https://example.com" target="FEopenLink" onclick="openPic(\'https:\/\/example.com\',\'FEopenLink\',\'width=13,height=84\');return false;" rel="noreferrer">Nice Text with default window name</a>';
2735  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2736 
2737  $linkText = 'Nice Text with default window name';
2738  $configuration = [
2739  'parameter' => 'https://example.com 13x84'
2740  ];
2741  $expectedResult = '<a href="https://example.com" target="FEopenLink" onclick="openPic(\'https:\/\/example.com\',\'FEopenLink\',\'width=13,height=84\');return false;" rel="noreferrer">Nice Text with default window name</a>';
2742  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2743 
2744  ‪$GLOBALS['TSFE']->xhtmlDoctype = 'xhtml_strict';
2745  $linkText = 'Nice Text with default window name';
2746  $configuration = [
2747  'parameter' => 'https://example.com 13x84'
2748  ];
2749  $expectedResult = '<a href="https://example.com" onclick="openPic(\'https:\/\/example.com\',\'FEopenLink\',\'width=13,height=84\');return false;" rel="noreferrer">Nice Text with default window name</a>';
2750  self::assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2751  }
2752 
2757  {
2758  $linkService = $this->prophesize(LinkService::class);
2759  GeneralUtility::setSingletonInstance(LinkService::class, $linkService->reveal());
2760  $linkService->resolve('foo')->willThrow(InvalidPathException::class);
2762  self::assertSame('foo', $this->subject->typoLink('foo', ['parameter' => 'foo']));
2763  }
2764 
2768  public function ‪typoLinkLogsErrorIfNoLinkResolvingIsPossible(): void
2769  {
2770  $linkService = $this->prophesize(LinkService::class);
2771  GeneralUtility::setSingletonInstance(LinkService::class, $linkService->reveal());
2772  $linkService->resolve('foo')->willThrow(InvalidPathException::class);
2773 
2774  $logger = $this->prophesize(Logger::class);
2775  $logger->warning('The link could not be generated', Argument::any())->shouldBeCalled();
2776  $this->subject->setLogger($logger->reveal());
2777  $this->subject->typoLink('foo', ['parameter' => 'foo']);
2778  }
2779 
2783  public function ‪stdWrap_splitObjReturnsCount(): void
2784  {
2785  $conf = [
2786  'token' => ',',
2787  'returnCount' => 1
2788  ];
2789  $expectedResult = 5;
2790  $amountOfEntries = $this->subject->splitObj('1, 2, 3, 4, 5', $conf);
2791  self::assertSame(
2792  $expectedResult,
2793  $amountOfEntries
2794  );
2795  }
2796 
2802  public function ‪calculateCacheKeyDataProvider(): array
2803  {
2804  $value = ‪StringUtility::getUniqueId('value');
2805  $wrap = [‪StringUtility::getUniqueId('wrap')];
2806  $valueConf = ['key' => $value];
2807  $wrapConf = ['key.' => $wrap];
2808  $conf = array_merge($valueConf, $wrapConf);
2809  $will = ‪StringUtility::getUniqueId('stdWrap');
2810 
2811  return [
2812  'no conf' => [
2813  '',
2814  [],
2815  0,
2816  null,
2817  null,
2818  null
2819  ],
2820  'value conf only' => [
2821  $value,
2822  $valueConf,
2823  0,
2824  null,
2825  null,
2826  null
2827  ],
2828  'wrap conf only' => [
2829  $will,
2830  $wrapConf,
2831  1,
2832  '',
2833  $wrap,
2834  $will
2835  ],
2836  'full conf' => [
2837  $will,
2838  $conf,
2839  1,
2840  $value,
2841  $wrap,
2842  $will
2843  ],
2844  ];
2845  }
2846 
2862  public function ‪calculateCacheKey(string $expect, array $conf, int $times, $with, $withWrap, $will): void
2863  {
2864  ‪$subject = $this->getAccessibleMock(ContentObjectRenderer::class, ['stdWrap']);
2865  ‪$subject->expects(self::exactly($times))
2866  ->method('stdWrap')
2867  ->with($with, $withWrap)
2868  ->willReturn($will);
2869 
2870  $result = ‪$subject->_call('calculateCacheKey', $conf);
2871  self::assertSame($expect, $result);
2872  }
2873 
2879  public function ‪getFromCacheDtataProvider(): array
2880  {
2881  $conf = [‪StringUtility::getUniqueId('conf')];
2882  return [
2883  'empty cache key' => [
2884  false,
2885  $conf,
2886  '',
2887  0,
2888  null,
2889  ],
2890  'non-empty cache key' => [
2891  'value',
2892  $conf,
2893  'non-empty-key',
2894  1,
2895  'value',
2896  ],
2897  ];
2898  }
2899 
2916  public function ‪getFromCache($expect, $conf, $cacheKey, $times, $cached): void
2917  {
2918  ‪$subject = $this->getAccessibleMock(
2919  ContentObjectRenderer::class,
2920  ['calculateCacheKey']
2921  );
2922  ‪$subject
2923  ->expects(self::exactly(1))
2924  ->method('calculateCacheKey')
2925  ->with($conf)
2926  ->willReturn($cacheKey);
2927  $cacheFrontend = $this->createMock(CacheFrontendInterface::class);
2928  $cacheFrontend
2929  ->expects(self::exactly($times))
2930  ->method('get')
2931  ->with($cacheKey)
2932  ->willReturn($cached);
2933  ‪$cacheManager = $this->createMock(CacheManager::class);
2935  ->method('getCache')
2936  ->willReturn($cacheFrontend);
2937  GeneralUtility::setSingletonInstance(
2938  CacheManager::class,
2940  );
2941  self::assertSame($expect, ‪$subject->_call('getFromCache', $conf));
2942  }
2943 
2949  public function ‪getFieldValDataProvider(): array
2950  {
2951  return [
2952  'invalid single key' => [null, 'invalid'],
2953  'single key of null' => [null, 'null'],
2954  'single key of empty string' => ['', 'empty'],
2955  'single key of non-empty string' => ['string 1', 'string1'],
2956  'single key of boolean false' => [false, 'false'],
2957  'single key of boolean true' => [true, 'true'],
2958  'single key of integer 0' => [0, 'zero'],
2959  'single key of integer 1' => [1, 'one'],
2960  'single key to be trimmed' => ['string 1', ' string1 '],
2961 
2962  'split nothing' => ['', '//'],
2963  'split one before' => ['string 1', 'string1//'],
2964  'split one after' => ['string 1', '//string1'],
2965  'split two ' => ['string 1', 'string1//string2'],
2966  'split three ' => ['string 1', 'string1//string2//string3'],
2967  'split to be trimmed' => ['string 1', ' string1 // string2 '],
2968  '0 is not empty' => [0, '// zero'],
2969  '1 is not empty' => [1, '// one'],
2970  'true is not empty' => [true, '// true'],
2971  'false is empty' => ['', '// false'],
2972  'null is empty' => ['', '// null'],
2973  'empty string is empty' => ['', '// empty'],
2974  'string is not empty' => ['string 1', '// string1'],
2975  'first non-empty winns' => [0, 'false//empty//null//zero//one'],
2976  'empty string is fallback' => ['', 'false // empty // null'],
2977  ];
2978  }
2979 
3018  public function ‪getFieldVal($expect, string ‪$fields): void
3019  {
3020  $data = [
3021  'string1' => 'string 1',
3022  'string2' => 'string 2',
3023  'string3' => 'string 3',
3024  'empty' => '',
3025  'null' => null,
3026  'false' => false,
3027  'true' => true,
3028  'zero' => 0,
3029  'one' => 1,
3030  ];
3031  $this->subject->_set('data', $data);
3032  self::assertSame($expect, $this->subject->getFieldVal(‪$fields));
3033  }
3034 
3040  public function ‪caseshiftDataProvider(): array
3041  {
3042  return [
3043  'lower' => ['x y', 'X Y', 'lower'],
3044  'upper' => ['X Y', 'x y', 'upper'],
3045  'capitalize' => ['One Two', 'one two', 'capitalize'],
3046  'ucfirst' => ['One two', 'one two', 'ucfirst'],
3047  'lcfirst' => ['oNE TWO', 'ONE TWO', 'lcfirst'],
3048  'uppercamelcase' => ['CamelCase', 'camel_case', 'uppercamelcase'],
3049  'lowercamelcase' => ['camelCase', 'camel_case', 'lowercamelcase'],
3050  ];
3051  }
3052 
3062  public function ‪caseshift(string $expect, string $content, string $case): void
3063  {
3064  self::assertSame(
3065  $expect,
3066  $this->subject->caseshift($content, $case)
3067  );
3068  }
3069 
3075  public function ‪HTMLcaseshiftDataProvider(): array
3076  {
3077  $case = ‪StringUtility::getUniqueId('case');
3078  return [
3079  'simple text' => [
3080  'TEXT',
3081  'text',
3082  $case,
3083  [['text', $case]],
3084  ['TEXT']
3085  ],
3086  'simple tag' => [
3087  '<i>TEXT</i>',
3088  '<i>text</i>',
3089  $case,
3090  [['', $case], ['text', $case]],
3091  ['', 'TEXT']
3092  ],
3093  'multiple nested tags with classes' => [
3094  '<div class="typo3">'
3095  . '<p>A <b>BOLD<\b> WORD.</p>'
3096  . '<p>AN <i>ITALIC<\i> WORD.</p>'
3097  . '</div>',
3098  '<div class="typo3">'
3099  . '<p>A <b>bold<\b> word.</p>'
3100  . '<p>An <i>italic<\i> word.</p>'
3101  . '</div>',
3102  $case,
3103  [
3104  ['', $case],
3105  ['', $case],
3106  ['A ', $case],
3107  ['bold', $case],
3108  [' word.', $case],
3109  ['', $case],
3110  ['An ', $case],
3111  ['italic', $case],
3112  [' word.', $case],
3113  ['', $case],
3114  ],
3115  ['', '', 'A ', 'BOLD', ' WORD.', '', 'AN ', 'ITALIC', ' WORD.', '']
3116  ],
3117  ];
3118  }
3119 
3136  public function ‪HTMLcaseshift(string $expect, string $content, string $case, array $with, array $will): void
3137  {
3138  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3139  ->setMethods(['caseshift'])->getMock();
3140  ‪$subject
3141  ->expects(self::exactly(count($with)))
3142  ->method('caseshift')
3143  ->withConsecutive(...$with)
3144  ->will(self::onConsecutiveCalls(...$will));
3145  self::assertSame(
3146  $expect,
3147  ‪$subject->‪HTMLcaseshift($content, $case)
3148  );
3149  }
3150 
3151  /***************************************************************************
3152  * General tests for stdWrap_
3153  ***************************************************************************/
3154 
3166  public function ‪allStdWrapProcessorsAreCallable(): void
3167  {
3168  $callable = 0;
3169  $notCallable = 0;
3170  $processors = ['invalidProcessor'];
3171  foreach (array_keys($this->subject->_get('stdWrapOrder')) as $key) {
3172  $processors[] = strtr($key, ['.' => '']);
3173  }
3174  foreach (array_unique($processors) as $processor) {
3175  $method = [‪$this->subject, 'stdWrap_' . $processor];
3176  if (is_callable($method)) {
3177  $callable += 1;
3178  } else {
3179  $notCallable += 1;
3180  }
3181  }
3182  self::assertSame(1, $notCallable);
3183  self::assertSame(83, $callable);
3184  }
3185 
3206  {
3207  $timeTrackerProphecy = $this->prophesize(TimeTracker::class);
3208  GeneralUtility::setSingletonInstance(TimeTracker::class, $timeTrackerProphecy->reveal());
3209 
3210  // `parseFunc` issues deprecation in case `htmlSanitize` is not given
3211  $expectExceptions = ['numRows', 'parseFunc', 'split', 'bytes'];
3212  $count = 0;
3213  $processors = [];
3214  $exceptions = [];
3215  foreach (array_keys($this->subject->_get('stdWrapOrder')) as $key) {
3216  $processors[] = strtr($key, ['.' => '']);
3217  }
3218  foreach (array_unique($processors) as $processor) {
3219  $count += 1;
3220  try {
3221  $conf = [$processor => '', $processor . '.' => ['table' => 'tt_content']];
3222  $method = 'stdWrap_' . $processor;
3223  $this->subject->$method('', $conf);
3224  } catch (\Exception $e) {
3225  $exceptions[] = $processor;
3226  }
3227  }
3228  self::assertSame($expectExceptions, $exceptions);
3229  self::assertSame(83, $count);
3230  }
3231 
3232  /***************************************************************************
3233  * End general tests for stdWrap_
3234  ***************************************************************************/
3235 
3236  /***************************************************************************
3237  * Tests for stdWrap_ in alphabetical order (all uppercase before lowercase)
3238  ***************************************************************************/
3239 
3246  {
3247  return [
3248  'preProcess' => [
3249  'stdWrap_stdWrapPreProcess',
3250  'stdWrapPreProcess'
3251  ],
3252  'override' => [
3253  'stdWrap_stdWrapOverride',
3254  'stdWrapOverride'
3255  ],
3256  'process' => [
3257  'stdWrap_stdWrapProcess',
3258  'stdWrapProcess'
3259  ],
3260  'postProcess' => [
3261  'stdWrap_stdWrapPostProcess',
3262  'stdWrapPostProcess'
3263  ],
3264  ];
3265  }
3266 
3283  string $stdWrapMethod,
3284  string $hookObjectCall
3285  ): void {
3286  $conf = [‪StringUtility::getUniqueId('conf')];
3287  $content = ‪StringUtility::getUniqueId('content');
3288  $processed1 = ‪StringUtility::getUniqueId('processed1');
3289  $processed2 = ‪StringUtility::getUniqueId('processed2');
3290  $hookObject1 = $this->createMock(
3291  ContentObjectStdWrapHookInterface::class
3292  );
3293  $hookObject1->expects(self::once())
3294  ->method($hookObjectCall)
3295  ->with($content, $conf)
3296  ->willReturn($processed1);
3297  $hookObject2 = $this->createMock(
3298  ContentObjectStdWrapHookInterface::class
3299  );
3300  $hookObject2->expects(self::once())
3301  ->method($hookObjectCall)
3302  ->with($processed1, $conf)
3303  ->willReturn($processed2);
3304  $this->subject->_set(
3305  'stdWrapHookObjects',
3306  [$hookObject1, $hookObject2]
3307  );
3308  $result = $this->subject->$stdWrapMethod($content, $conf);
3309  self::assertSame($processed2, $result);
3310  }
3311 
3317  public function ‪stdWrap_HTMLparserDataProvider(): array
3318  {
3319  $content = ‪StringUtility::getUniqueId('content');
3320  $parsed = ‪StringUtility::getUniqueId('parsed');
3321  return [
3322  'no config' => [
3323  $content,
3324  $content,
3325  [],
3326  0,
3327  $parsed
3328  ],
3329  'no array' => [
3330  $content,
3331  $content,
3332  ['HTMLparser.' => 1],
3333  0,
3334  $parsed
3335  ],
3336  'empty array' => [
3337  $parsed,
3338  $content,
3339  ['HTMLparser.' => []],
3340  1,
3341  $parsed
3342  ],
3343  'non-empty array' => [
3344  $parsed,
3345  $content,
3346  ['HTMLparser.' => [true]],
3347  1,
3348  $parsed
3349  ],
3350  ];
3351  }
3352 
3375  public function ‪stdWrap_HTMLparser(
3376  string $expect,
3377  string $content,
3378  array $conf,
3379  int $times,
3380  string $will
3381  ): void {
3382  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3383  ->setMethods(['HTMLparser_TSbridge'])->getMock();
3384  ‪$subject
3385  ->expects(self::exactly($times))
3386  ->method('HTMLparser_TSbridge')
3387  ->with($content, $conf['HTMLparser.'] ?? [])
3388  ->willReturn($will);
3389  self::assertSame(
3390  $expect,
3392  );
3393  }
3394 
3399  {
3400  return [
3401  'No Tag' => [
3402  [],
3403  ['addPageCacheTags' => ''],
3404  ],
3405  'Two expectedTags' => [
3406  ['tag1', 'tag2'],
3407  ['addPageCacheTags' => 'tag1,tag2'],
3408  ],
3409  'Two expectedTags plus one with stdWrap' => [
3410  ['tag1', 'tag2', 'tag3'],
3411  [
3412  'addPageCacheTags' => 'tag1,tag2',
3413  'addPageCacheTags.' => ['wrap' => '|,tag3']
3414  ],
3415  ],
3416  ];
3417  }
3425  public function ‪stdWrap_addPageCacheTagsAddsPageTags(array $expectedTags, array $configuration): void
3426  {
3427  $this->subject->stdWrap_addPageCacheTags('', $configuration);
3428  self::assertEquals($expectedTags, $this->frontendControllerMock->_get('pageCacheTags'));
3429  }
3430 
3443  public function ‪stdWrap_age(): void
3444  {
3445  $now = 10;
3446  $content = '9';
3447  $conf = ['age' => ‪StringUtility::getUniqueId('age')];
3448  $return = ‪StringUtility::getUniqueId('return');
3449  $difference = $now - (int)$content;
3450  ‪$GLOBALS['EXEC_TIME'] = $now;
3451  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3452  ->setMethods(['calcAge'])->getMock();
3453  ‪$subject
3454  ->expects(self::once())
3455  ->method('calcAge')
3456  ->with($difference, $conf['age'])
3457  ->willReturn($return);
3458  self::assertSame($return, ‪$subject->‪stdWrap_age($content, $conf));
3459  }
3460 
3474  public function ‪stdWrap_append(): void
3475  {
3476  $debugKey = '/stdWrap/.append';
3477  $content = ‪StringUtility::getUniqueId('content');
3478  $conf = [
3479  'append' => ‪StringUtility::getUniqueId('append'),
3480  'append.' => [‪StringUtility::getUniqueId('append.')],
3481  ];
3482  $return = ‪StringUtility::getUniqueId('return');
3483  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3484  ->setMethods(['cObjGetSingle'])->getMock();
3485  ‪$subject
3486  ->expects(self::once())
3487  ->method('cObjGetSingle')
3488  ->with($conf['append'], $conf['append.'], $debugKey)
3489  ->willReturn($return);
3490  self::assertSame(
3491  $content . $return,
3492  ‪$subject->‪stdWrap_append($content, $conf)
3493  );
3494  }
3495 
3501  public function ‪stdWrapBrDataProvider(): array
3502  {
3503  return [
3504  'no xhtml with LF in between' => [
3505  'one<br>' . LF . 'two',
3506  'one' . LF . 'two',
3507  null
3508  ],
3509  'no xhtml with LF in between and around' => [
3510  '<br>' . LF . 'one<br>' . LF . 'two<br>' . LF,
3511  LF . 'one' . LF . 'two' . LF,
3512  null
3513  ],
3514  'xhtml with LF in between' => [
3515  'one<br />' . LF . 'two',
3516  'one' . LF . 'two',
3517  'xhtml_strict'
3518  ],
3519  'xhtml with LF in between and around' => [
3520  '<br />' . LF . 'one<br />' . LF . 'two<br />' . LF,
3521  LF . 'one' . LF . 'two' . LF,
3522  'xhtml_strict'
3523  ],
3524  ];
3525  }
3526 
3536  public function ‪stdWrap_br($expected, $input, $xhtmlDoctype): void
3537  {
3538  ‪$GLOBALS['TSFE']->xhtmlDoctype = $xhtmlDoctype;
3539  self::assertSame($expected, $this->subject->stdWrap_br($input));
3540  }
3541 
3547  public function ‪stdWrapBrTagDataProvider(): array
3548  {
3549  $noConfig = [];
3550  $config1 = ['brTag' => '<br/>'];
3551  $config2 = ['brTag' => '<br>'];
3552  return [
3553  'no config: one break at the beginning' => [LF . 'one' . LF . 'two', 'onetwo', $noConfig],
3554  'no config: multiple breaks at the beginning' => [LF . LF . 'one' . LF . 'two', 'onetwo', $noConfig],
3555  'no config: one break at the end' => ['one' . LF . 'two' . LF, 'onetwo', $noConfig],
3556  'no config: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'onetwo', $noConfig],
3557 
3558  'config1: one break at the beginning' => [LF . 'one' . LF . 'two', '<br/>one<br/>two', $config1],
3559  'config1: multiple breaks at the beginning' => [
3560  LF . LF . 'one' . LF . 'two',
3561  '<br/><br/>one<br/>two',
3562  $config1
3563  ],
3564  'config1: one break at the end' => ['one' . LF . 'two' . LF, 'one<br/>two<br/>', $config1],
3565  'config1: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'one<br/>two<br/><br/>', $config1],
3566 
3567  'config2: one break at the beginning' => [LF . 'one' . LF . 'two', '<br>one<br>two', $config2],
3568  'config2: multiple breaks at the beginning' => [
3569  LF . LF . 'one' . LF . 'two',
3570  '<br><br>one<br>two',
3571  $config2
3572  ],
3573  'config2: one break at the end' => ['one' . LF . 'two' . LF, 'one<br>two<br>', $config2],
3574  'config2: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'one<br>two<br><br>', $config2],
3575  ];
3576  }
3577 
3587  public function ‪stdWrap_brTag(string $input, string $expected, array $config): void
3588  {
3589  self::assertEquals($expected, $this->subject->stdWrap_brTag($input, $config));
3590  }
3591 
3597  public function ‪stdWrap_bytesDataProvider(): array
3598  {
3599  return [
3600  'value 1234 default' => [
3601  '1.21 Ki',
3602  '1234',
3603  ['labels' => '', 'base' => 0],
3604  ],
3605  'value 1234 si' => [
3606  '1.23 k',
3607  '1234',
3608  ['labels' => 'si', 'base' => 0],
3609  ],
3610  'value 1234 iec' => [
3611  '1.21 Ki',
3612  '1234',
3613  ['labels' => 'iec', 'base' => 0],
3614  ],
3615  'value 1234 a-i' => [
3616  '1.23b',
3617  '1234',
3618  ['labels' => 'a|b|c|d|e|f|g|h|i', 'base' => 1000],
3619  ],
3620  'value 1234 a-i invalid base' => [
3621  '1.21b',
3622  '1234',
3623  ['labels' => 'a|b|c|d|e|f|g|h|i', 'base' => 54],
3624  ],
3625  'value 1234567890 default' => [
3626  '1.15 Gi',
3627  '1234567890',
3628  ['labels' => '', 'base' => 0],
3629  ]
3630  ];
3631  }
3632 
3654  public function ‪stdWrap_bytes(string $expect, string $content, array $conf): void
3655  {
3656  $locale = 'en_US.UTF-8';
3657  try {
3658  $this->setLocale(LC_NUMERIC, $locale);
3659  } catch (‪Exception $e) {
3660  self::markTestSkipped('Locale ' . $locale . ' is not available.');
3661  }
3662  $conf = ['bytes.' => $conf];
3663  self::assertSame(
3664  $expect,
3665  $this->subject->stdWrap_bytes($content, $conf)
3666  );
3667  }
3668 
3682  public function ‪stdWrap_cObject(): void
3683  {
3684  $debugKey = '/stdWrap/.cObject';
3685  $content = ‪StringUtility::getUniqueId('content');
3686  $conf = [
3687  'cObject' => ‪StringUtility::getUniqueId('cObject'),
3688  'cObject.' => [‪StringUtility::getUniqueId('cObject.')],
3689  ];
3690  $return = ‪StringUtility::getUniqueId('return');
3691  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3692  ->setMethods(['cObjGetSingle'])->getMock();
3693  ‪$subject
3694  ->expects(self::once())
3695  ->method('cObjGetSingle')
3696  ->with($conf['cObject'], $conf['cObject.'], $debugKey)
3697  ->willReturn($return);
3698  self::assertSame(
3699  $return,
3700  ‪$subject->‪stdWrap_cObject($content, $conf)
3701  );
3702  }
3703 
3709  public function ‪stdWrap_orderedStdWrapDataProvider(): array
3710  {
3711  $confA = [‪StringUtility::getUniqueId('conf A')];
3712  $confB = [‪StringUtility::getUniqueId('conf B')];
3713  return [
3714  'standard case: order 1, 2' => [
3715  $confA,
3716  $confB,
3717  ['1.' => $confA, '2.' => $confB]
3718  ],
3719  'inverted: order 2, 1' => [
3720  $confB,
3721  $confA,
3722  ['2.' => $confA, '1.' => $confB]
3723  ],
3724  '0 as integer: order 0, 2' => [
3725  $confA,
3726  $confB,
3727  ['0.' => $confA, '2.' => $confB]
3728  ],
3729  'negative integers: order 2, -2' => [
3730  $confB,
3731  $confA,
3732  ['2.' => $confA, '-2.' => $confB]
3733  ],
3734  'chars are casted to key 0, that is not in the array' => [
3735  null,
3736  $confB,
3737  ['2.' => $confB, 'xxx.' => $confA]
3738  ],
3739  ];
3740  }
3741 
3764  public function ‪stdWrap_orderedStdWrap($firstConf, array $secondConf, array $conf): void
3765  {
3766  $content = ‪StringUtility::getUniqueId('content');
3767  $between = ‪StringUtility::getUniqueId('between');
3768  $expect = ‪StringUtility::getUniqueId('expect');
3769  $conf['orderedStdWrap.'] = $conf;
3770  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3771  ->setMethods(['stdWrap'])->getMock();
3772  ‪$subject
3773  ->expects(self::exactly(2))
3774  ->method('stdWrap')
3775  ->withConsecutive([$content, $firstConf], [$between, $secondConf])
3776  ->will(self::onConsecutiveCalls($between, $expect));
3777  self::assertSame(
3778  $expect,
3779  ‪$subject->‪stdWrap_orderedStdWrap($content, $conf)
3780  );
3781  }
3782 
3788  public function ‪stdWrap_cacheReadDataProvider(): array
3789  {
3790  $cacheConf = [‪StringUtility::getUniqueId('cache.')];
3791  $conf = ['cache.' => $cacheConf];
3792  return [
3793  'no conf' => [
3794  'content',
3795  'content',
3796  [],
3797  0,
3798  null,
3799  null,
3800  ],
3801  'no cache. conf' => [
3802  'content',
3803  'content',
3804  ['otherConf' => 1],
3805  0,
3806  null,
3807  null,
3808  ],
3809  'non-cached simulation' => [
3810  'content',
3811  'content',
3812  $conf,
3813  1,
3814  $cacheConf,
3815  false,
3816  ],
3817  'cached simulation' => [
3818  'cachedContent',
3819  'content',
3820  $conf,
3821  1,
3822  $cacheConf,
3823  'cachedContent',
3824  ],
3825  ];
3826  }
3827 
3844  public function ‪stdWrap_cacheRead(
3845  string $expect,
3846  string $input,
3847  array $conf,
3848  int $times,
3849  $with,
3850  $will
3851  ): void {
3852  ‪$subject = $this->getAccessibleMock(
3853  ContentObjectRenderer::class,
3854  ['getFromCache']
3855  );
3856  ‪$subject
3857  ->expects(self::exactly($times))
3858  ->method('getFromCache')
3859  ->with($with)
3860  ->willReturn($will);
3861  self::assertSame(
3862  $expect,
3863  ‪$subject->‪stdWrap_cacheRead($input, $conf)
3864  );
3865  }
3866 
3872  public function ‪stdWrap_cacheStoreDataProvider(): array
3873  {
3874  $confCache = [‪StringUtility::getUniqueId('cache.')];
3875  $key = [‪StringUtility::getUniqueId('key')];
3876  return [
3877  'Return immediate with no conf' => [
3878  null,
3879  0,
3880  null,
3881  0,
3882  ],
3883  'Return immediate with empty key' => [
3884  $confCache,
3885  1,
3886  '0',
3887  0,
3888  ],
3889  'Call all methods' => [
3890  $confCache,
3891  1,
3892  $key,
3893  1,
3894  ],
3895  ];
3896  }
3897 
3919  public function ‪stdWrap_cacheStore(
3920  $confCache,
3921  int $timesCCK,
3922  $key,
3923  int $times
3924  ): void {
3925  $content = ‪StringUtility::getUniqueId('content');
3926  $conf = [];
3927  $conf['cache.'] = $confCache;
3928  $tags = [‪StringUtility::getUniqueId('tags')];
3929  $lifetime = ‪StringUtility::getUniqueId('lifetime');
3930  $params = [
3931  'key' => $key,
3932  'content' => $content,
3933  'lifetime' => $lifetime,
3934  'tags' => $tags
3935  ];
3936  ‪$subject = $this->getAccessibleMock(
3937  ContentObjectRenderer::class,
3938  [
3939  'calculateCacheKey',
3940  'calculateCacheTags',
3941  'calculateCacheLifetime'
3942  ]
3943  );
3944  ‪$subject
3945  ->expects(self::exactly($timesCCK))
3946  ->method('calculateCacheKey')
3947  ->with($confCache)
3948  ->willReturn($key);
3949  ‪$subject
3950  ->expects(self::exactly($times))
3951  ->method('calculateCacheTags')
3952  ->with($confCache)
3953  ->willReturn($tags);
3954  ‪$subject
3955  ->expects(self::exactly($times))
3956  ->method('calculateCacheLifetime')
3957  ->with($confCache)
3958  ->willReturn($lifetime);
3959  $cacheFrontend = $this->createMock(CacheFrontendInterface::class);
3960  $cacheFrontend
3961  ->expects(self::exactly($times))
3962  ->method('set')
3963  ->with($key, $content, $tags, $lifetime)
3964  ->willReturn(null);
3965  ‪$cacheManager = $this->createMock(CacheManager::class);
3967  ->method('getCache')
3968  ->willReturn($cacheFrontend);
3969  GeneralUtility::setSingletonInstance(
3970  CacheManager::class,
3972  );
3973  [$countCalls, $test] = [0, $this];
3974  $closure = function ($par1, $par2) use (
3975  $test,
3976  ‪$subject,
3977  $params,
3978  &$countCalls
3979  ) {
3980  $test->assertSame($params, $par1);
3981  $test->assertSame(‪$subject, $par2);
3982  $countCalls++;
3983  };
3984  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] = [
3985  $closure,
3986  $closure,
3987  $closure
3988  ];
3989  self::assertSame(
3990  $content,
3991  ‪$subject->‪stdWrap_cacheStore($content, $conf)
3992  );
3993  self::assertSame($times * 3, $countCalls);
3994  }
3995 
4008  public function ‪stdWrap_case(): void
4009  {
4010  $content = ‪StringUtility::getUniqueId();
4011  $conf = [
4012  'case' => ‪StringUtility::getUniqueId('used'),
4013  'case.' => [‪StringUtility::getUniqueId('discarded')],
4014  ];
4015  $return = ‪StringUtility::getUniqueId();
4016  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4017  ->setMethods(['HTMLcaseshift'])->getMock();
4018  ‪$subject
4019  ->expects(self::once())
4020  ->method('HTMLcaseshift')
4021  ->with($content, $conf['case'])
4022  ->willReturn($return);
4023  self::assertSame(
4024  $return,
4025  ‪$subject->‪stdWrap_case($content, $conf)
4026  );
4027  }
4028 
4034  public function ‪stdWrap_char(): void
4035  {
4036  $input = 'discarded';
4037  $expected = 'C';
4038  self::assertEquals($expected, $this->subject->stdWrap_char($input, ['char' => '67']));
4039  }
4040 
4053  public function ‪stdWrap_crop(): void
4054  {
4055  $content = ‪StringUtility::getUniqueId('content');
4056  $conf = [
4057  'crop' => ‪StringUtility::getUniqueId('crop'),
4058  'crop.' => ‪StringUtility::getUniqueId('not used'),
4059  ];
4060  $return = ‪StringUtility::getUniqueId('return');
4061  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4062  ->setMethods(['crop'])->getMock();
4063  ‪$subject
4064  ->expects(self::once())
4065  ->method('crop')
4066  ->with($content, $conf['crop'])
4067  ->willReturn($return);
4068  self::assertSame(
4069  $return,
4070  ‪$subject->‪stdWrap_crop($content, $conf)
4071  );
4072  }
4073 
4086  public function ‪stdWrap_cropHTML(): void
4087  {
4088  $content = ‪StringUtility::getUniqueId('content');
4089  $conf = [
4090  'cropHTML' => ‪StringUtility::getUniqueId('cropHTML'),
4091  'cropHTML.' => ‪StringUtility::getUniqueId('not used'),
4092  ];
4093  $return = ‪StringUtility::getUniqueId('return');
4094  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4095  ->setMethods(['cropHTML'])->getMock();
4096  ‪$subject
4097  ->expects(self::once())
4098  ->method('cropHTML')
4099  ->with($content, $conf['cropHTML'])
4100  ->willReturn($return);
4101  self::assertSame(
4102  $return,
4103  ‪$subject->‪stdWrap_cropHTML($content, $conf)
4104  );
4105  }
4106 
4112  public function ‪stdWrap_csConvDataProvider(): array
4113  {
4114  return [
4115  'empty string from ISO-8859-15' => [
4116  '',
4117  mb_convert_encoding('', 'ISO-8859-15', 'UTF-8'),
4118  ['csConv' => 'ISO-8859-15']
4119  ],
4120  'empty string from BIG-5' => [
4121  '',
4122  mb_convert_encoding('', 'BIG-5'),
4123  ['csConv' => 'BIG-5']
4124  ],
4125  '"0" from ISO-8859-15' => [
4126  '0',
4127  mb_convert_encoding('0', 'ISO-8859-15', 'UTF-8'),
4128  ['csConv' => 'ISO-8859-15']
4129  ],
4130  '"0" from BIG-5' => [
4131  '0',
4132  mb_convert_encoding('0', 'BIG-5'),
4133  ['csConv' => 'BIG-5']
4134  ],
4135  'euro symbol from ISO-88859-15' => [
4136  '€',
4137  mb_convert_encoding('€', 'ISO-8859-15', 'UTF-8'),
4138  ['csConv' => 'ISO-8859-15']
4139  ],
4140  'good morning from BIG-5' => [
4141  '早安',
4142  mb_convert_encoding('早安', 'BIG-5'),
4143  ['csConv' => 'BIG-5']
4144  ],
4145  ];
4146  }
4147 
4157  public function ‪stdWrap_csConv(string $expected, string $input, array $conf): void
4158  {
4159  self::assertSame(
4160  $expected,
4161  $this->subject->stdWrap_csConv($input, $conf)
4162  );
4163  }
4164 
4176  public function ‪stdWrap_current(): void
4177  {
4178  $data = [
4179  'currentValue_kidjls9dksoje' => 'default',
4180  'currentValue_new' => 'new',
4181  ];
4182  $this->subject->_set('data', $data);
4183  self::assertSame(
4184  'currentValue_kidjls9dksoje',
4185  $this->subject->_get('currentValKey')
4186  );
4187  self::assertSame(
4188  'default',
4189  $this->subject->stdWrap_current('discarded', ['discarded'])
4190  );
4191  $this->subject->_set('currentValKey', 'currentValue_new');
4192  self::assertSame(
4193  'new',
4194  $this->subject->stdWrap_current('discarded', ['discarded'])
4195  );
4196  }
4197 
4203  public function ‪stdWrap_dataDataProvider(): array
4204  {
4205  $data = [‪StringUtility::getUniqueId('data')];
4206  $alt = [‪StringUtility::getUniqueId('alternativeData')];
4207  return [
4208  'default' => [$data, $data, ''],
4209  'alt is array' => [$alt, $data, $alt],
4210  'alt is empty array' => [[], $data, []],
4211  'alt null' => [$data, $data, null],
4212  'alt string' => [$data, $data, 'xxx'],
4213  'alt int' => [$data, $data, 1],
4214  'alt bool' => [$data, $data, true],
4215  ];
4216  }
4217 
4236  public function ‪stdWrap_data(array $expect, array $data, $alt): void
4237  {
4238  $conf = ['data' => ‪StringUtility::getUniqueId('conf.data')];
4239  $return = ‪StringUtility::getUniqueId('return');
4240  ‪$subject = $this->getAccessibleMock(
4241  ContentObjectRenderer::class,
4242  ['getData']
4243  );
4244  ‪$subject->_set('data', $data);
4245  ‪$subject->_set('alternativeData', $alt);
4246  ‪$subject
4247  ->expects(self::once())
4248  ->method('getData')
4249  ->with($conf['data'], $expect)
4250  ->willReturn($return);
4251  self::assertSame($return, ‪$subject->‪stdWrap_data('discard', $conf));
4252  self::assertSame('', ‪$subject->_get('alternativeData'));
4253  }
4254 
4267  public function ‪stdWrap_dataWrap(): void
4268  {
4269  $content = ‪StringUtility::getUniqueId('content');
4270  $conf = [
4271  'dataWrap' => ‪StringUtility::getUniqueId('dataWrap'),
4272  'dataWrap.' => [‪StringUtility::getUniqueId('not used')],
4273  ];
4274  $return = ‪StringUtility::getUniqueId('return');
4275  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4276  ->setMethods(['dataWrap'])->getMock();
4277  ‪$subject
4278  ->expects(self::once())
4279  ->method('dataWrap')
4280  ->with($content, $conf['dataWrap'])
4281  ->willReturn($return);
4282  self::assertSame(
4283  $return,
4284  ‪$subject->‪stdWrap_dataWrap($content, $conf)
4285  );
4286  }
4287 
4293  public function ‪stdWrap_dateDataProvider(): array
4294  {
4295  // Fictive execution time: 2015-10-02 12:00
4296  $now = 1443780000;
4297  return [
4298  'given timestamp' => [
4299  '02.10.2015',
4300  $now,
4301  ['date' => 'd.m.Y'],
4302  $now
4303  ],
4304  'empty string' => [
4305  '02.10.2015',
4306  '',
4307  ['date' => 'd.m.Y'],
4308  $now
4309  ],
4310  'testing null' => [
4311  '02.10.2015',
4312  null,
4313  ['date' => 'd.m.Y'],
4314  $now
4315  ],
4316  'given timestamp return GMT' => [
4317  '02.10.2015 10:00:00',
4318  $now,
4319  [
4320  'date' => 'd.m.Y H:i:s',
4321  'date.' => ['GMT' => true],
4322  ],
4323  $now
4324  ]
4325  ];
4326  }
4327 
4338  public function ‪stdWrap_date(string $expected, $content, array $conf, int $now): void
4339  {
4340  ‪$GLOBALS['EXEC_TIME'] = $now;
4341  self::assertEquals(
4342  $expected,
4343  $this->subject->stdWrap_date($content, $conf)
4344  );
4345  }
4346 
4352  public function ‪stdWrap_debug(): void
4353  {
4354  $expect = '<pre>&lt;p class=&quot;class&quot;&gt;&lt;br/&gt;'
4355  . '&lt;/p&gt;</pre>';
4356  $content = '<p class="class"><br/></p>';
4357  self::assertSame($expect, $this->subject->stdWrap_debug($content));
4358  }
4359 
4386  public function ‪stdWrap_debugData(): void
4387  {
4388  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
4389  $content = ‪StringUtility::getUniqueId('content');
4390  $key = ‪StringUtility::getUniqueId('key');
4391  $value = ‪StringUtility::getUniqueId('value');
4392  $altValue = ‪StringUtility::getUniqueId('value alt');
4393  $this->subject->data = [$key => $value];
4394  // Without alternative data only data is returned.
4395  ob_start();
4396  $result = $this->subject->stdWrap_debugData($content);
4397  $out = ob_get_clean();
4398  self::assertSame($result, $content);
4399  self::assertStringContainsString('$cObj->data', $out);
4400  self::assertStringContainsString($value, $out);
4401  self::assertStringNotContainsString($altValue, $out);
4402  // By adding alternative data both are returned together.
4403  $this->subject->alternativeData = [$key => $altValue];
4404  ob_start();
4405  $this->subject->stdWrap_debugData($content);
4406  $out = ob_get_clean();
4407  self::assertStringNotContainsString('$cObj->alternativeData', $out);
4408  self::assertStringContainsString($value, $out);
4409  self::assertStringContainsString($altValue, $out);
4410  }
4411 
4417  public function ‪stdWrap_debugFuncDataProvider(): array
4418  {
4419  return [
4420  'expect array by string' => [true, '2'],
4421  'expect array by integer' => [true, 2],
4422  'do not expect array' => [false, ''],
4423  ];
4424  }
4425 
4447  public function ‪stdWrap_debugFunc(bool $expectArray, $confDebugFunc): void
4448  {
4449  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
4450  $content = ‪StringUtility::getUniqueId('content');
4451  $conf = ['debugFunc' => $confDebugFunc];
4452  ob_start();
4453  $result = $this->subject->stdWrap_debugFunc($content, $conf);
4454  $out = ob_get_clean();
4455  self::assertSame($result, $content);
4456  self::assertStringContainsString($content, $out);
4457  if ($expectArray) {
4458  self::assertStringContainsString('=>', $out);
4459  } else {
4460  self::assertStringNotContainsString('=>', $out);
4461  }
4462  }
4463 
4469  public function ‪stdWrapDoubleBrTagDataProvider(): array
4470  {
4471  return [
4472  'no config: void input' => [
4473  '',
4474  '',
4475  [],
4476  ],
4477  'no config: single break' => [
4478  'one' . LF . 'two',
4479  'one' . LF . 'two',
4480  [],
4481  ],
4482  'no config: double break' => [
4483  'onetwo',
4484  'one' . LF . LF . 'two',
4485  [],
4486  ],
4487  'no config: double break with whitespace' => [
4488  'onetwo',
4489  'one' . LF . "\t" . ' ' . "\t" . ' ' . LF . 'two',
4490  [],
4491  ],
4492  'no config: single break around' => [
4493  LF . 'one' . LF,
4494  LF . 'one' . LF,
4495  [],
4496  ],
4497  'no config: double break around' => [
4498  'one',
4499  LF . LF . 'one' . LF . LF,
4500  [],
4501  ],
4502  'empty string: double break around' => [
4503  'one',
4504  LF . LF . 'one' . LF . LF,
4505  ['doubleBrTag' => ''],
4506  ],
4507  'br tag: double break' => [
4508  'one<br/>two',
4509  'one' . LF . LF . 'two',
4510  ['doubleBrTag' => '<br/>'],
4511  ],
4512  'br tag: double break around' => [
4513  '<br/>one<br/>',
4514  LF . LF . 'one' . LF . LF,
4515  ['doubleBrTag' => '<br/>'],
4516  ],
4517  'double br tag: double break around' => [
4518  '<br/><br/>one<br/><br/>',
4519  LF . LF . 'one' . LF . LF,
4520  ['doubleBrTag' => '<br/><br/>'],
4521  ],
4522  ];
4523  }
4524 
4534  public function ‪stdWrap_doubleBrTag(string $expected, string $input, array $config): void
4535  {
4536  self::assertEquals($expected, $this->subject->stdWrap_doubleBrTag($input, $config));
4537  }
4538 
4544  public function ‪stdWrap_editIconsDataProvider(): array
4545  {
4546  $content = ‪StringUtility::getUniqueId('content');
4547  $editIcons = ‪StringUtility::getUniqueId('editIcons');
4548  $editIconsArray = [‪StringUtility::getUniqueId('editIcons.')];
4549  $will = ‪StringUtility::getUniqueId('will');
4550  return [
4551  'standard case calls edit icons' => [
4552  $will,
4553  $content,
4554  ['editIcons' => $editIcons, 'editIcons.' => $editIconsArray],
4555  true,
4556  1,
4557  $editIconsArray,
4558  $will
4559  ],
4560  'null in editIcons. repalaced by []' => [
4561  $will,
4562  $content,
4563  ['editIcons' => $editIcons, 'editIcons.' => null],
4564  true,
4565  1,
4566  [],
4567  $will
4568  ],
4569  'missing editIcons. replaced by []' => [
4570  $will,
4571  $content,
4572  ['editIcons' => $editIcons],
4573  true,
4574  1,
4575  [],
4576  $will
4577  ],
4578  'no user login disables call' => [
4579  $content,
4580  $content,
4581  ['editIcons' => $editIcons, 'editIcons.' => $editIconsArray],
4582  false,
4583  0,
4584  $editIconsArray,
4585  $will
4586  ],
4587  'empty string in editIcons disables call' => [
4588  $content,
4589  $content,
4590  ['editIcons' => '', 'editIcons.' => $editIconsArray],
4591  true,
4592  0,
4593  $editIconsArray,
4594  $will
4595  ],
4596  'zero string in editIcons disables call' => [
4597  $content,
4598  $content,
4599  ['editIcons' => '0', 'editIcons.' => $editIconsArray],
4600  true,
4601  0,
4602  $editIconsArray,
4603  $will
4604  ],
4605  ];
4606  }
4607 
4634  public function ‪stdWrap_editIcons(
4635  string $expect,
4636  string $content,
4637  array $conf,
4638  bool $login,
4639  int $times,
4640  array $param3,
4641  string $will
4642  ): void {
4643  if ($login) {
4644  $backendUser = new BackendUserAuthentication();
4645  $backendUser->user['uid'] = 13;
4646  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect($backendUser));
4647  } else {
4648  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect());
4649  }
4650  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4651  ->setMethods(['editIcons'])->getMock();
4652  ‪$subject
4653  ->expects(self::exactly($times))
4654  ->method('editIcons')
4655  ->with($content, $conf['editIcons'], $param3)
4656  ->willReturn($will);
4657  self::assertSame(
4658  $expect,
4659  ‪$subject->‪stdWrap_editIcons($content, $conf)
4660  );
4661  }
4662 
4675  public function ‪stdWrap_encapsLines(): void
4676  {
4677  $content = ‪StringUtility::getUniqueId('content');
4678  $conf = [
4679  'encapsLines' => [‪StringUtility::getUniqueId('not used')],
4680  'encapsLines.' => [‪StringUtility::getUniqueId('encapsLines.')],
4681  ];
4682  $return = ‪StringUtility::getUniqueId('return');
4683  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4684  ->setMethods(['encaps_lineSplit'])->getMock();
4685  ‪$subject
4686  ->expects(self::once())
4687  ->method('encaps_lineSplit')
4688  ->with($content, $conf['encapsLines.'])
4689  ->willReturn($return);
4690  self::assertSame(
4691  $return,
4692  ‪$subject->‪stdWrap_encapsLines($content, $conf)
4693  );
4694  }
4695 
4706  public function ‪stdWrap_encapsLines_HTML5SelfClosingTags(string $input, string $expected): void
4707  {
4708  $rteParseFunc = $this->‪getLibParseFunc_RTE();
4709 
4710  $conf = [
4711  'encapsLines' => $rteParseFunc['parseFunc.']['nonTypoTagStdWrap.']['encapsLines'] ?? null,
4712  'encapsLines.' => $rteParseFunc['parseFunc.']['nonTypoTagStdWrap.']['encapsLines.'] ?? null,
4713  ];
4714  // don't add an &nbsp; to tag without content
4715  $conf['encapsLines.']['innerStdWrap_all.']['ifBlank'] = '';
4716  $additionalEncapsTags = ['a', 'b', 'span'];
4717 
4718  // We want to allow any tag to be an encapsulating tag
4719  // since this is possible and we don't want an additional tag to be wrapped around.
4720  $conf['encapsLines.']['encapsTagList'] .= ',' . implode(',', $additionalEncapsTags);
4721  $conf['encapsLines.']['encapsTagList'] .= ',' . implode(',', [$input]);
4722 
4723  // Check if we get a self-closing tag for
4724  // empty tags where this is allowed according to HTML5
4725  $content = '<' . $input . ' id="myId" class="bodytext" />';
4726  $result = $this->subject->stdWrap_encapsLines($content, $conf);
4727  self::assertSame($expected, $result);
4728  }
4729 
4733  public function ‪html5SelfClosingTagsDataprovider(): array
4734  {
4735  return [
4736  'areaTag_selfclosing' => [
4737  'input' => 'area',
4738  'expected' => '<area id="myId" class="bodytext" />'
4739  ],
4740  'base_selfclosing' => [
4741  'input' => 'base',
4742  'expected' => '<base id="myId" class="bodytext" />'
4743  ],
4744  'br_selfclosing' => [
4745  'input' => 'br',
4746  'expected' => '<br id="myId" class="bodytext" />'
4747  ],
4748  'col_selfclosing' => [
4749  'input' => 'col',
4750  'expected' => '<col id="myId" class="bodytext" />'
4751  ],
4752  'embed_selfclosing' => [
4753  'input' => 'embed',
4754  'expected' => '<embed id="myId" class="bodytext" />'
4755  ],
4756  'hr_selfclosing' => [
4757  'input' => 'hr',
4758  'expected' => '<hr id="myId" class="bodytext" />'
4759  ],
4760  'img_selfclosing' => [
4761  'input' => 'img',
4762  'expected' => '<img id="myId" class="bodytext" />'
4763  ],
4764  'input_selfclosing' => [
4765  'input' => 'input',
4766  'expected' => '<input id="myId" class="bodytext" />'
4767  ],
4768  'keygen_selfclosing' => [
4769  'input' => 'keygen',
4770  'expected' => '<keygen id="myId" class="bodytext" />'
4771  ],
4772  'link_selfclosing' => [
4773  'input' => 'link',
4774  'expected' => '<link id="myId" class="bodytext" />'
4775  ],
4776  'meta_selfclosing' => [
4777  'input' => 'meta',
4778  'expected' => '<meta id="myId" class="bodytext" />'
4779  ],
4780  'param_selfclosing' => [
4781  'input' => 'param',
4782  'expected' => '<param id="myId" class="bodytext" />'
4783  ],
4784  'source_selfclosing' => [
4785  'input' => 'source',
4786  'expected' => '<source id="myId" class="bodytext" />'
4787  ],
4788  'track_selfclosing' => [
4789  'input' => 'track',
4790  'expected' => '<track id="myId" class="bodytext" />'
4791  ],
4792  'wbr_selfclosing' => [
4793  'input' => 'wbr',
4794  'expected' => '<wbr id="myId" class="bodytext" />'
4795  ],
4796  'p_notselfclosing' => [
4797  'input' => 'p',
4798  'expected' => '<p id="myId" class="bodytext"></p>'
4799  ],
4800  'a_notselfclosing' => [
4801  'input' => 'a',
4802  'expected' => '<a id="myId" class="bodytext"></a>'
4803  ],
4804  'strong_notselfclosing' => [
4805  'input' => 'strong',
4806  'expected' => '<strong id="myId" class="bodytext"></strong>'
4807  ],
4808  'span_notselfclosing' => [
4809  'input' => 'span',
4810  'expected' => '<span id="myId" class="bodytext"></span>'
4811  ],
4812  ];
4813  }
4814 
4820  public function ‪stdWrap_editPanelDataProvider(): array
4821  {
4822  $content = ‪StringUtility::getUniqueId('content');
4823  $will = ‪StringUtility::getUniqueId('will');
4824  return [
4825  'standard case calls edit icons' => [
4826  $will,
4827  $content,
4828  true,
4829  1,
4830  $will
4831  ],
4832  'no user login disables call' => [
4833  $content,
4834  $content,
4835  false,
4836  0,
4837  $will
4838  ],
4839  ];
4840  }
4841 
4863  public function ‪stdWrap_editPanel(
4864  string $expect,
4865  string $content,
4866  bool $login,
4867  int $times,
4868  string $will
4869  ): void {
4870  if ($login) {
4871  $backendUser = new BackendUserAuthentication();
4872  $backendUser->user['uid'] = 13;
4873  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect($backendUser));
4874  } else {
4875  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect());
4876  }
4877  $conf = ['editPanel.' => [‪StringUtility::getUniqueId('editPanel.')]];
4878  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4879  ->setMethods(['editPanel'])->getMock();
4880  ‪$subject
4881  ->expects(self::exactly($times))
4882  ->method('editPanel')
4883  ->with($content, $conf['editPanel.'])
4884  ->willReturn($will);
4885  self::assertSame(
4886  $expect,
4887  ‪$subject->‪stdWrap_editPanel($content, $conf)
4888  );
4889  }
4890 
4896  public function ‪stdWrap_encodeForJavaScriptValueDataProvider(): array
4897  {
4898  return [
4899  'double quote in string' => [
4900  '\'double\u0020quote\u0022\'',
4901  'double quote"'
4902  ],
4903  'backslash in string' => [
4904  '\'backslash\u0020\u005C\'',
4905  'backslash \\'
4906  ],
4907  'exclamation mark' => [
4908  '\'exclamation\u0021\'',
4909  'exclamation!'
4910  ],
4911  'whitespace tab, newline and carriage return' => [
4912  '\'white\u0009space\u000As\u000D\'',
4913  "white\tspace\ns\r"
4914  ],
4915  'single quote in string' => [
4916  '\'single\u0020quote\u0020\u0027\'',
4917  'single quote \''
4918  ],
4919  'tag' => [
4920  '\'\u003Ctag\u003E\'',
4921  '<tag>'
4922  ],
4923  'ampersand in string' => [
4924  '\'amper\u0026sand\'',
4925  'amper&sand'
4926  ]
4927  ];
4928  }
4929 
4938  public function ‪stdWrap_encodeForJavaScriptValue(string $expect, string $content): void
4939  {
4940  self::assertSame(
4941  $expect,
4942  $this->subject->stdWrap_encodeForJavaScriptValue($content)
4943  );
4944  }
4945 
4951  public function ‪stdWrap_expandListDataProvider(): array
4952  {
4953  return [
4954  'numbers' => ['1,2,3', '1,2,3'],
4955  'range' => ['3,4,5', '3-5'],
4956  'numbers and range' => ['1,3,4,5,7', '1,3-5,7']
4957  ];
4958  }
4959 
4973  public function ‪stdWrap_expandList(string $expected, string $content): void
4974  {
4975  self::assertEquals(
4976  $expected,
4977  $this->subject->stdWrap_expandList($content)
4978  );
4979  }
4980 
4991  public function ‪stdWrap_field(): void
4992  {
4993  $expect = ‪StringUtility::getUniqueId('expect');
4994  $conf = ['field' => ‪StringUtility::getUniqueId('field')];
4995  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4996  ->setMethods(['getFieldVal'])->getMock();
4997  ‪$subject
4998  ->expects(self::once())
4999  ->method('getFieldVal')
5000  ->with($conf['field'])
5001  ->willReturn($expect);
5002  self::assertSame(
5003  $expect,
5004  ‪$subject->‪stdWrap_field('discarded', $conf)
5005  );
5006  }
5007 
5013  public function ‪stdWrap_fieldRequiredDataProvider(): array
5014  {
5015  $content = ‪StringUtility::getUniqueId('content');
5016  return [
5017  // resulting in boolean false
5018  'false is false' => [
5019  '',
5020  true,
5021  $content,
5022  ['fieldRequired' => 'false']
5023  ],
5024  'null is false' => [
5025  '',
5026  true,
5027  $content,
5028  ['fieldRequired' => 'null']
5029  ],
5030  'empty string is false' => [
5031  '',
5032  true,
5033  $content,
5034  ['fieldRequired' => 'empty']
5035  ],
5036  'whitespace is false' => [
5037  '',
5038  true,
5039  $content,
5040  ['fieldRequired' => 'whitespace']
5041  ],
5042  'string zero is false' => [
5043  '',
5044  true,
5045  $content,
5046  ['fieldRequired' => 'stringZero']
5047  ],
5048  'string zero with whitespace is false' => [
5049  '',
5050  true,
5051  $content,
5052  ['fieldRequired' => 'stringZeroWithWhiteSpace']
5053  ],
5054  'zero is false' => [
5055  '',
5056  true,
5057  $content,
5058  ['fieldRequired' => 'zero']
5059  ],
5060  // resulting in boolean true
5061  'true is true' => [
5062  $content,
5063  false,
5064  $content,
5065  ['fieldRequired' => 'true']
5066  ],
5067  'string is true' => [
5068  $content,
5069  false,
5070  $content,
5071  ['fieldRequired' => 'string']
5072  ],
5073  'one is true' => [
5074  $content,
5075  false,
5076  $content,
5077  ['fieldRequired' => 'one']
5078  ]
5079  ];
5080  }
5081 
5101  public function ‪stdWrap_fieldRequired(string $expect, bool $stop, string $content, array $conf): void
5102  {
5103  $data = [
5104  'null' => null,
5105  'false' => false,
5106  'empty' => '',
5107  'whitespace' => "\t" . ' ',
5108  'stringZero' => '0',
5109  'stringZeroWithWhiteSpace' => "\t" . ' 0 ' . "\t",
5110  'zero' => 0,
5111  'string' => 'string',
5112  'true' => true,
5113  'one' => 1
5114  ];
5116  ‪$subject->_set('data', $data);
5117  ‪$subject->_set('stdWrapRecursionLevel', 1);
5118  ‪$subject->_set('stopRendering', [1 => false]);
5119  self::assertSame(
5120  $expect,
5121  ‪$subject->‪stdWrap_fieldRequired($content, $conf)
5122  );
5123  self::assertSame($stop, ‪$subject->_get('stopRendering')[1]);
5124  }
5125 
5131  public function ‪hashDataProvider(): array
5132  {
5133  return [
5134  'md5' => [
5135  'bacb98acf97e0b6112b1d1b650b84971',
5136  'joh316',
5137  ['hash' => 'md5']
5138  ],
5139  'sha1' => [
5140  '063b3d108bed9f88fa618c6046de0dccadcf3158',
5141  'joh316',
5142  ['hash' => 'sha1']
5143  ],
5144  'stdWrap capability' => [
5145  'bacb98acf97e0b6112b1d1b650b84971',
5146  'joh316',
5147  [
5148  'hash' => '5',
5149  'hash.' => ['wrap' => 'md|']
5150  ]
5151  ],
5152  'non-existing hashing algorithm' => [
5153  '',
5154  'joh316',
5155  ['hash' => 'non-existing']
5156  ]
5157  ];
5158  }
5159 
5175  public function ‪stdWrap_hash(string $expect, string $content, array $conf): void
5176  {
5177  self::assertSame(
5178  $expect,
5179  $this->subject->stdWrap_hash($content, $conf)
5180  );
5181  }
5182 
5188  public function ‪stdWrap_htmlSpecialCharsDataProvider(): array
5189  {
5190  return [
5191  'void conf' => [
5192  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5193  '<span>1 &lt; 2</span>',
5194  [],
5195  ],
5196  'void preserveEntities' => [
5197  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5198  '<span>1 &lt; 2</span>',
5199  ['htmlSpecialChars.' => []],
5200  ],
5201  'false preserveEntities' => [
5202  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5203  '<span>1 &lt; 2</span>',
5204  ['htmlSpecialChars.' => ['preserveEntities' => 0]],
5205  ],
5206  'true preserveEntities' => [
5207  '&lt;span&gt;1 &lt; 2&lt;/span&gt;',
5208  '<span>1 &lt; 2</span>',
5209  ['htmlSpecialChars.' => ['preserveEntities' => 1]],
5210  ],
5211  ];
5212  }
5213 
5223  public function ‪stdWrap_htmlSpecialChars(string $expected, string $input, array $conf): void
5224  {
5225  self::assertSame(
5226  $expected,
5227  $this->subject->stdWrap_htmlSpecialChars($input, $conf)
5228  );
5229  }
5230 
5236  public function ‪stdWrap_ifDataProvider(): array
5237  {
5238  $content = ‪StringUtility::getUniqueId('content');
5239  $conf = ['if.' => [‪StringUtility::getUniqueId('if.')]];
5240  return [
5241  // evals to true
5242  'empty config' => [
5243  $content,
5244  false,
5245  $content,
5246  [],
5247  0,
5248  null
5249  ],
5250  'if. is empty array' => [
5251  $content,
5252  false,
5253  $content,
5254  ['if.' => []],
5255  0,
5256  null
5257  ],
5258  'if. is null' => [
5259  $content,
5260  false,
5261  $content,
5262  ['if.' => null],
5263  0,
5264  null
5265  ],
5266  'if. is false' => [
5267  $content,
5268  false,
5269  $content,
5270  ['if.' => false],
5271  0,
5272  null
5273  ],
5274  'if. is 0' => [
5275  $content,
5276  false,
5277  $content,
5278  ['if.' => false],
5279  0,
5280  null
5281  ],
5282  'if. is "0"' => [
5283  $content,
5284  false,
5285  $content,
5286  ['if.' => '0'],
5287  0,
5288  null
5289  ],
5290  'checkIf returning true' => [
5291  $content,
5292  false,
5293  $content,
5294  $conf,
5295  1,
5296  true
5297  ],
5298  // evals to false
5299  'checkIf returning false' => [
5300  '',
5301  true,
5302  $content,
5303  $conf,
5304  1,
5305  false
5306  ],
5307  ];
5308  }
5309 
5330  public function ‪stdWrap_if(string $expect, bool $stop, string $content, array $conf, int $times, $will): void
5331  {
5332  ‪$subject = $this->getAccessibleMock(
5333  ContentObjectRenderer::class,
5334  ['checkIf']
5335  );
5336  ‪$subject->_set('stdWrapRecursionLevel', 1);
5337  ‪$subject->_set('stopRendering', [1 => false]);
5338  ‪$subject
5339  ->expects(self::exactly($times))
5340  ->method('checkIf')
5341  ->with($conf['if.'] ?? null)
5342  ->willReturn($will);
5343  self::assertSame($expect, ‪$subject->‪stdWrap_if($content, $conf));
5344  self::assertSame($stop, ‪$subject->_get('stopRendering')[1]);
5345  }
5346 
5352  public function ‪checkIfDataProvider(): array
5353  {
5354  return [
5355  'true bitAnd the same' => [true, ['bitAnd' => '4', 'value' => '4']],
5356  'true bitAnd included' => [true, ['bitAnd' => '6', 'value' => '4']],
5357  'false bitAnd' => [false, ['bitAnd' => '4', 'value' => '3']],
5358  'negate true bitAnd the same' => [false, ['bitAnd' => '4', 'value' => '4', 'negate' => '1']],
5359  'negate true bitAnd included' => [false, ['bitAnd' => '6', 'value' => '4', 'negate' => '1']],
5360  'negate false bitAnd' => [true, ['bitAnd' => '3', 'value' => '4', 'negate' => '1']],
5361  ];
5362  }
5363 
5372  public function ‪checkIf(bool $expect, array $conf)
5373  {
5374  ‪$subject = $this->getAccessibleMock(
5375  ContentObjectRenderer::class,
5376  ['stdWrap']
5377  );
5378  self::assertSame($expect, ‪$subject->‪checkIf($conf));
5379  }
5380 
5386  public function ‪stdWrap_ifBlankDataProvider(): array
5387  {
5388  $alt = ‪StringUtility::getUniqueId('alternative content');
5389  $conf = ['ifBlank' => $alt];
5390  return [
5391  // blank cases
5392  'null is blank' => [$alt, null, $conf],
5393  'false is blank' => [$alt, false, $conf],
5394  'empty string is blank' => [$alt, '', $conf],
5395  'whitespace is blank' => [$alt, "\t" . '', $conf],
5396  // non-blank cases
5397  'string is not blank' => ['string', 'string', $conf],
5398  'zero is not blank' => [0, 0, $conf],
5399  'zero string is not blank' => ['0', '0', $conf],
5400  'zero float is not blank' => [0.0, 0.0, $conf],
5401  'true is not blank' => [true, true, $conf],
5402  ];
5403  }
5404 
5421  public function ‪stdWrap_ifBlank($expect, $content, array $conf): void
5422  {
5423  $result = $this->subject->stdWrap_ifBlank($content, $conf);
5424  self::assertSame($expect, $result);
5425  }
5426 
5432  public function ‪stdWrap_ifEmptyDataProvider(): array
5433  {
5434  $alt = ‪StringUtility::getUniqueId('alternative content');
5435  $conf = ['ifEmpty' => $alt];
5436  return [
5437  // empty cases
5438  'null is empty' => [$alt, null, $conf],
5439  'false is empty' => [$alt, false, $conf],
5440  'zero is empty' => [$alt, 0, $conf],
5441  'float zero is empty' => [$alt, 0.0, $conf],
5442  'whitespace is empty' => [$alt, "\t" . ' ', $conf],
5443  'empty string is empty' => [$alt, '', $conf],
5444  'zero string is empty' => [$alt, '0', $conf],
5445  'zero string is empty with whitespace' => [
5446  $alt,
5447  "\t" . ' 0 ' . "\t",
5448  $conf
5449  ],
5450  // non-empty cases
5451  'string is not empty' => ['string', 'string', $conf],
5452  '1 is not empty' => [1, 1, $conf],
5453  '-1 is not empty' => [-1, -1, $conf],
5454  '0.1 is not empty' => [0.1, 0.1, $conf],
5455  '-0.1 is not empty' => [-0.1, -0.1, $conf],
5456  'true is not empty' => [true, true, $conf],
5457  ];
5458  }
5459 
5475  public function ‪stdWrap_ifEmpty($expect, $content, array $conf): void
5476  {
5477  $result = $this->subject->stdWrap_ifEmpty($content, $conf);
5478  self::assertSame($expect, $result);
5479  }
5480 
5486  public function ‪stdWrap_ifNullDataProvider(): array
5487  {
5488  $alt = ‪StringUtility::getUniqueId('alternative content');
5489  $conf = ['ifNull' => $alt];
5490  return [
5491  'only null is null' => [$alt, null, $conf],
5492  'zero is not null' => [0, 0, $conf],
5493  'float zero is not null' => [0.0, 0.0, $conf],
5494  'false is not null' => [false, false, $conf],
5495  'zero is not null' => [0, 0, $conf],
5496  'zero string is not null' => ['0', '0', $conf],
5497  'empty string is not null' => ['', '', $conf],
5498  'whitespace is not null' => ["\t" . '', "\t" . '', $conf],
5499  ];
5500  }
5501 
5517  public function ‪stdWrap_ifNull($expect, $content, array $conf): void
5518  {
5519  $result = $this->subject->stdWrap_ifNull($content, $conf);
5520  self::assertSame($expect, $result);
5521  }
5522 
5528  public function ‪stdWrap_innerWrapDataProvider(): array
5529  {
5530  return [
5531  'no conf' => [
5532  'XXX',
5533  'XXX',
5534  [],
5535  ],
5536  'simple' => [
5537  '<wrap>XXX</wrap>',
5538  'XXX',
5539  ['innerWrap' => '<wrap>|</wrap>'],
5540  ],
5541  'missing pipe puts wrap before' => [
5542  '<pre>XXX',
5543  'XXX',
5544  ['innerWrap' => '<pre>'],
5545  ],
5546  'trims whitespace' => [
5547  '<wrap>XXX</wrap>',
5548  'XXX',
5549  ['innerWrap' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
5550  ],
5551  'split char change is not possible' => [
5552  '<wrap> # </wrap>XXX',
5553  'XXX',
5554  [
5555  'innerWrap' => '<wrap> # </wrap>',
5556  'innerWrap.' => ['splitChar' => '#'],
5557  ],
5558  ],
5559  ];
5560  }
5561 
5571  public function ‪stdWrap_innerWrap(string $expected, string $input, array $conf): void
5572  {
5573  self::assertSame(
5574  $expected,
5575  $this->subject->stdWrap_innerWrap($input, $conf)
5576  );
5577  }
5578 
5584  public function ‪stdWrap_innerWrap2DataProvider(): array
5585  {
5586  return [
5587  'no conf' => [
5588  'XXX',
5589  'XXX',
5590  [],
5591  ],
5592  'simple' => [
5593  '<wrap>XXX</wrap>',
5594  'XXX',
5595  ['innerWrap2' => '<wrap>|</wrap>'],
5596  ],
5597  'missing pipe puts wrap before' => [
5598  '<pre>XXX',
5599  'XXX',
5600  ['innerWrap2' => '<pre>'],
5601  ],
5602  'trims whitespace' => [
5603  '<wrap>XXX</wrap>',
5604  'XXX',
5605  ['innerWrap2' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
5606  ],
5607  'split char change is not possible' => [
5608  '<wrap> # </wrap>XXX',
5609  'XXX',
5610  [
5611  'innerWrap2' => '<wrap> # </wrap>',
5612  'innerWrap2.' => ['splitChar' => '#'],
5613  ],
5614  ],
5615  ];
5616  }
5617 
5627  public function ‪stdWrap_innerWrap2(string $expected, string $input, array $conf): void
5628  {
5629  self::assertSame(
5630  $expected,
5631  $this->subject->stdWrap_innerWrap2($input, $conf)
5632  );
5633  }
5634 
5646  public function ‪stdWrap_insertData(): void
5647  {
5648  $content = ‪StringUtility::getUniqueId('content');
5649  $conf = [‪StringUtility::getUniqueId('conf not used')];
5650  $return = ‪StringUtility::getUniqueId('return');
5651  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5652  ->setMethods(['insertData'])->getMock();
5653  ‪$subject->expects(self::once())->method('insertData')
5654  ->with($content)->willReturn($return);
5655  self::assertSame(
5656  $return,
5657  ‪$subject->‪stdWrap_insertData($content, $conf)
5658  );
5659  }
5660 
5666  public function ‪stdWrap_insertDataProvider(): array
5667  {
5668  return [
5669  'empty' => ['', ''],
5670  'notFoundData' => ['any=1', 'any{$string}=1'],
5671  'queryParameter' => ['any{#string}=1', 'any{#string}=1'],
5672  ];
5673  }
5674 
5683  public function ‪stdWrap_insertDataAndInputExamples($expect, string $content): void
5684  {
5685  self::assertSame($expect, $this->subject->stdWrap_insertData($content));
5686  }
5687 
5693  public function ‪stdWrap_intvalDataProvider(): array
5694  {
5695  return [
5696  // numbers
5697  'int' => [123, 123],
5698  'float' => [123, 123.45],
5699  'float does not round up' => [123, 123.55],
5700  // negative numbers
5701  'negative int' => [-123, -123],
5702  'negative float' => [-123, -123.45],
5703  'negative float does not round down' => [-123, -123.55],
5704  // strings
5705  'word string' => [0, 'string'],
5706  'empty string' => [0, ''],
5707  'zero string' => [0, '0'],
5708  'int string' => [123, '123'],
5709  'float string' => [123, '123.55'],
5710  'negative float string' => [-123, '-123.55'],
5711  // other types
5712  'null' => [0, null],
5713  'true' => [1, true],
5714  'false' => [0, false]
5715  ];
5716  }
5717 
5737  public function ‪stdWrap_intval(int $expect, $content): void
5738  {
5739  self::assertSame($expect, $this->subject->stdWrap_intval($content));
5740  }
5741 
5747  public function ‪stdWrapKeywordsDataProvider(): array
5748  {
5749  return [
5750  'empty string' => ['', ''],
5751  'blank' => ['', ' '],
5752  'tab' => ['', "\t"],
5753  'single semicolon' => [',', ' ; '],
5754  'single comma' => [',', ' , '],
5755  'single nl' => [',', ' ' . PHP_EOL . ' '],
5756  'double semicolon' => [',,', ' ; ; '],
5757  'double comma' => [',,', ' , , '],
5758  'double nl' => [',,', ' ' . PHP_EOL . ' ' . PHP_EOL . ' '],
5759  'simple word' => ['one', ' one '],
5760  'simple word trimmed' => ['one', 'one'],
5761  ', separated' => ['one,two', ' one , two '],
5762  '; separated' => ['one,two', ' one ; two '],
5763  'nl separated' => ['one,two', ' one ' . PHP_EOL . ' two '],
5764  ', typical' => ['one,two,three', 'one, two, three'],
5765  '; typical' => ['one,two,three', ' one; two; three'],
5766  'nl typical' => [
5767  'one,two,three',
5768  'one' . PHP_EOL . 'two' . PHP_EOL . 'three'
5769  ],
5770  ', sourounded' => [',one,two,', ' , one , two , '],
5771  '; sourounded' => [',one,two,', ' ; one ; two ; '],
5772  'nl sourounded' => [
5773  ',one,two,',
5774  ' ' . PHP_EOL . ' one ' . PHP_EOL . ' two ' . PHP_EOL . ' '
5775  ],
5776  'mixed' => [
5777  'one,two,three,four',
5778  ' one, two; three' . PHP_EOL . 'four'
5779  ],
5780  'keywods with blanks in words' => [
5781  'one plus,two minus',
5782  ' one plus , two minus ',
5783  ]
5784  ];
5785  }
5786 
5795  public function ‪stdWrap_keywords(string $expected, string $input): void
5796  {
5797  self::assertSame($expected, $this->subject->stdWrap_keywords($input));
5798  }
5799 
5805  public function ‪stdWrap_langDataProvider(): array
5806  {
5807  return [
5808  'empty conf' => [
5809  'original',
5810  'original',
5811  [],
5812  'de',
5813  ],
5814  'translation de' => [
5815  'Ãœbersetzung',
5816  'original',
5817  [
5818  'lang.' => [
5819  'de' => 'Ãœbersetzung',
5820  'it' => 'traduzione',
5821  ]
5822  ],
5823  'de',
5824  ],
5825  'translation it' => [
5826  'traduzione',
5827  'original',
5828  [
5829  'lang.' => [
5830  'de' => 'Ãœbersetzung',
5831  'it' => 'traduzione',
5832  ]
5833  ],
5834  'it',
5835  ],
5836  'no translation' => [
5837  'original',
5838  'original',
5839  [
5840  'lang.' => [
5841  'de' => 'Ãœbersetzung',
5842  'it' => 'traduzione',
5843  ]
5844  ],
5845  '',
5846  ],
5847  'missing label' => [
5848  'original',
5849  'original',
5850  [
5851  'lang.' => [
5852  'de' => 'Ãœbersetzung',
5853  'it' => 'traduzione',
5854  ]
5855  ],
5856  'fr',
5857  ],
5858  ];
5859  }
5860 
5871  public function ‪stdWrap_langViaSiteLanguage(string $expected, string $input, array $conf, string $language): void
5872  {
5873  $site = $this->‪createSiteWithLanguage([
5874  'base' => '/',
5875  'languageId' => 2,
5876  'locale' => 'en_UK',
5877  'typo3Language' => $language,
5878  ]);
5879  $this->frontendControllerMock->_set('language', $site->getLanguageById(2));
5880  self::assertSame(
5881  $expected,
5882  $this->subject->stdWrap_lang($input, $conf)
5883  );
5884  }
5885 
5899  public function ‪stdWrap_listNum(): void
5900  {
5901  $content = ‪StringUtility::getUniqueId('content');
5902  $conf = [
5903  'listNum' => ‪StringUtility::getUniqueId('listNum'),
5904  'listNum.' => [
5905  'splitChar' => ‪StringUtility::getUniqueId('splitChar')
5906  ],
5907  ];
5908  $return = ‪StringUtility::getUniqueId('return');
5909  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5910  ->setMethods(['listNum'])->getMock();
5911  ‪$subject
5912  ->expects(self::once())
5913  ->method('listNum')
5914  ->with(
5915  $content,
5916  $conf['listNum'],
5917  $conf['listNum.']['splitChar']
5918  )
5919  ->willReturn($return);
5920  self::assertSame(
5921  $return,
5922  ‪$subject->‪stdWrap_listNum($content, $conf)
5923  );
5924  }
5925 
5931  public function ‪stdWrap_noTrimWrapDataProvider(): array
5932  {
5933  return [
5934  'Standard case' => [
5935  ' left middle right ',
5936  'middle',
5937  [
5938  'noTrimWrap' => '| left | right |',
5939  ],
5940  ],
5941  'Tabs as whitespace' => [
5942  "\t" . 'left' . "\t" . 'middle' . "\t" . 'right' . "\t",
5943  'middle',
5944  [
5945  'noTrimWrap' =>
5946  '|' . "\t" . 'left' . "\t" . '|' . "\t" . 'right' . "\t" . '|',
5947  ],
5948  ],
5949  'Split char is 0' => [
5950  ' left middle right ',
5951  'middle',
5952  [
5953  'noTrimWrap' => '0 left 0 right 0',
5954  'noTrimWrap.' => ['splitChar' => '0'],
5955  ],
5956  ],
5957  'Split char is pipe (default)' => [
5958  ' left middle right ',
5959  'middle',
5960  [
5961  'noTrimWrap' => '| left | right |',
5962  'noTrimWrap.' => ['splitChar' => '|'],
5963  ],
5964  ],
5965  'Split char is a' => [
5966  ' left middle right ',
5967  'middle',
5968  [
5969  'noTrimWrap' => 'a left a right a',
5970  'noTrimWrap.' => ['splitChar' => 'a'],
5971  ],
5972  ],
5973  'Split char is a word (ab)' => [
5974  ' left middle right ',
5975  'middle',
5976  [
5977  'noTrimWrap' => 'ab left ab right ab',
5978  'noTrimWrap.' => ['splitChar' => 'ab'],
5979  ],
5980  ],
5981  'Split char accepts stdWrap' => [
5982  ' left middle right ',
5983  'middle',
5984  [
5985  'noTrimWrap' => 'abc left abc right abc',
5986  'noTrimWrap.' => [
5987  'splitChar' => 'b',
5988  'splitChar.' => ['wrap' => 'a|c'],
5989  ],
5990  ],
5991  ],
5992  ];
5993  }
5994 
6004  public function ‪stdWrap_noTrimWrap(string $expect, string $content, array $conf): void
6005  {
6006  self::assertSame(
6007  $expect,
6008  $this->subject->stdWrap_noTrimWrap($content, $conf)
6009  );
6010  }
6011 
6023  public function ‪stdWrap_numRows(): void
6024  {
6025  $conf = [
6026  'numRows' => ‪StringUtility::getUniqueId('numRows'),
6027  'numRows.' => [‪StringUtility::getUniqueId('numRows')],
6028  ];
6029  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6030  ->setMethods(['numRows'])->getMock();
6031  ‪$subject->expects(self::once())->method('numRows')
6032  ->with($conf['numRows.'])->willReturn('return');
6033  self::assertSame(
6034  'return',
6035  ‪$subject->‪stdWrap_numRows('discard', $conf)
6036  );
6037  }
6038 
6051  public function ‪stdWrap_numberFormat(): void
6052  {
6053  $content = ‪StringUtility::getUniqueId('content');
6054  $conf = [
6055  'numberFormat' => ‪StringUtility::getUniqueId('not used'),
6056  'numberFormat.' => [‪StringUtility::getUniqueId('numberFormat.')],
6057  ];
6058  $return = ‪StringUtility::getUniqueId('return');
6059  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6060  ->setMethods(['numberFormat'])->getMock();
6061  ‪$subject
6062  ->expects(self::once())
6063  ->method('numberFormat')
6064  ->with((float)$content, $conf['numberFormat.'])
6065  ->willReturn($return);
6066  self::assertSame(
6067  $return,
6068  ‪$subject->‪stdWrap_numberFormat($content, $conf)
6069  );
6070  }
6071 
6077  public function ‪stdWrap_outerWrapDataProvider(): array
6078  {
6079  return [
6080  'no conf' => [
6081  'XXX',
6082  'XXX',
6083  [],
6084  ],
6085  'simple' => [
6086  '<wrap>XXX</wrap>',
6087  'XXX',
6088  ['outerWrap' => '<wrap>|</wrap>'],
6089  ],
6090  'missing pipe puts wrap before' => [
6091  '<pre>XXX',
6092  'XXX',
6093  ['outerWrap' => '<pre>'],
6094  ],
6095  'trims whitespace' => [
6096  '<wrap>XXX</wrap>',
6097  'XXX',
6098  ['outerWrap' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
6099  ],
6100  'split char change is not possible' => [
6101  '<wrap> # </wrap>XXX',
6102  'XXX',
6103  [
6104  'outerWrap' => '<wrap> # </wrap>',
6105  'outerWrap.' => ['splitChar' => '#'],
6106  ],
6107  ],
6108  ];
6109  }
6110 
6120  public function ‪stdWrap_outerWrap(string $expected, string $input, array $conf): void
6121  {
6122  self::assertSame(
6123  $expected,
6124  $this->subject->stdWrap_outerWrap($input, $conf)
6125  );
6126  }
6127 
6133  public function ‪stdWrap_overrideDataProvider(): array
6134  {
6135  return [
6136  'standard case' => [
6137  'override',
6138  'content',
6139  ['override' => 'override']
6140  ],
6141  'empty conf does not override' => [
6142  'content',
6143  'content',
6144  []
6145  ],
6146  'empty string does not override' => [
6147  'content',
6148  'content',
6149  ['override' => '']
6150  ],
6151  'whitespace does not override' => [
6152  'content',
6153  'content',
6154  ['override' => ' ' . "\t"]
6155  ],
6156  'zero does not override' => [
6157  'content',
6158  'content',
6159  ['override' => 0]
6160  ],
6161  'false does not override' => [
6162  'content',
6163  'content',
6164  ['override' => false]
6165  ],
6166  'null does not override' => [
6167  'content',
6168  'content',
6169  ['override' => null]
6170  ],
6171  'one does override' => [
6172  1,
6173  'content',
6174  ['override' => 1]
6175  ],
6176  'minus one does override' => [
6177  -1,
6178  'content',
6179  ['override' => -1]
6180  ],
6181  'float does override' => [
6182  -0.1,
6183  'content',
6184  ['override' => -0.1]
6185  ],
6186  'true does override' => [
6187  true,
6188  'content',
6189  ['override' => true]
6190  ],
6191  'the value is not trimmed' => [
6192  "\t" . 'override',
6193  'content',
6194  ['override' => "\t" . 'override']
6195  ],
6196  ];
6197  }
6198 
6208  public function ‪stdWrap_override($expect, string $content, array $conf): void
6209  {
6210  self::assertSame(
6211  $expect,
6212  $this->subject->stdWrap_override($content, $conf)
6213  );
6214  }
6215 
6229  public function ‪stdWrap_parseFunc(): void
6230  {
6231  $content = ‪StringUtility::getUniqueId('content');
6232  $conf = [
6233  'parseFunc' => ‪StringUtility::getUniqueId('parseFunc'),
6234  'parseFunc.' => [‪StringUtility::getUniqueId('parseFunc.')],
6235  ];
6236  $return = ‪StringUtility::getUniqueId('return');
6237  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6238  ->setMethods(['parseFunc'])->getMock();
6239  ‪$subject
6240  ->expects(self::once())
6241  ->method('parseFunc')
6242  ->with($content, $conf['parseFunc.'], $conf['parseFunc'])
6243  ->willReturn($return);
6244  self::assertSame(
6245  $return,
6246  ‪$subject->‪stdWrap_parseFunc($content, $conf)
6247  );
6248  }
6249 
6263  public function ‪stdWrap_postCObject(): void
6264  {
6265  $debugKey = '/stdWrap/.postCObject';
6266  $content = ‪StringUtility::getUniqueId('content');
6267  $conf = [
6268  'postCObject' => ‪StringUtility::getUniqueId('postCObject'),
6269  'postCObject.' => [‪StringUtility::getUniqueId('postCObject.')],
6270  ];
6271  $return = ‪StringUtility::getUniqueId('return');
6272  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6273  ->setMethods(['cObjGetSingle'])->getMock();
6274  ‪$subject
6275  ->expects(self::once())
6276  ->method('cObjGetSingle')
6277  ->with($conf['postCObject'], $conf['postCObject.'], $debugKey)
6278  ->willReturn($return);
6279  self::assertSame(
6280  $content . $return,
6281  ‪$subject->‪stdWrap_postCObject($content, $conf)
6282  );
6283  }
6284 
6296  public function ‪stdWrap_postUserFunc(): void
6297  {
6298  $content = ‪StringUtility::getUniqueId('content');
6299  $conf = [
6300  'postUserFunc' => ‪StringUtility::getUniqueId('postUserFunc'),
6301  'postUserFunc.' => [‪StringUtility::getUniqueId('postUserFunc.')],
6302  ];
6303  $return = ‪StringUtility::getUniqueId('return');
6304  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6305  ->setMethods(['callUserFunction'])->getMock();
6306  ‪$subject
6307  ->expects(self::once())
6308  ->method('callUserFunction')
6309  ->with($conf['postUserFunc'], $conf['postUserFunc.'])
6310  ->willReturn($return);
6311  self::assertSame(
6312  $return,
6313  ‪$subject->‪stdWrap_postUserFunc($content, $conf)
6314  );
6315  }
6316 
6335  public function ‪stdWrap_postUserFuncInt(): void
6336  {
6337  $uniqueHash = ‪StringUtility::getUniqueId('uniqueHash');
6338  $substKey = 'INT_SCRIPT.' . $uniqueHash;
6339  $content = ‪StringUtility::getUniqueId('content');
6340  $conf = [
6341  'postUserFuncInt' => ‪StringUtility::getUniqueId('function'),
6342  'postUserFuncInt.' => [‪StringUtility::getUniqueId('function array')],
6343  ];
6344  $expect = '<!--' . $substKey . '-->';
6345  $frontend = $this->getMockBuilder(TypoScriptFrontendController::class)
6346  ->disableOriginalConstructor()->setMethods(['uniqueHash'])
6347  ->getMock();
6348  $frontend->expects(self::once())->method('uniqueHash')
6349  ->with()->willReturn($uniqueHash);
6350  $frontend->config = [];
6351  ‪$subject = $this->getAccessibleMock(
6352  ContentObjectRenderer::class,
6353  null,
6354  [$frontend]
6355  );
6356  self::assertSame(
6357  $expect,
6358  ‪$subject->‪stdWrap_postUserFuncInt($content, $conf)
6359  );
6360  $array = [
6361  'content' => $content,
6362  'postUserFunc' => $conf['postUserFuncInt'],
6363  'conf' => $conf['postUserFuncInt.'],
6364  'type' => 'POSTUSERFUNC',
6365  'cObj' => serialize(‪$subject)
6366  ];
6367  self::assertSame(
6368  $array,
6369  $frontend->config['INTincScript'][$substKey]
6370  );
6371  }
6372 
6386  public function ‪stdWrap_preCObject(): void
6387  {
6388  $debugKey = '/stdWrap/.preCObject';
6389  $content = ‪StringUtility::getUniqueId('content');
6390  $conf = [
6391  'preCObject' => ‪StringUtility::getUniqueId('preCObject'),
6392  'preCObject.' => [‪StringUtility::getUniqueId('preCObject.')],
6393  ];
6394  $return = ‪StringUtility::getUniqueId('return');
6395  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6396  ->setMethods(['cObjGetSingle'])->getMock();
6397  ‪$subject
6398  ->expects(self::once())
6399  ->method('cObjGetSingle')
6400  ->with($conf['preCObject'], $conf['preCObject.'], $debugKey)
6401  ->willReturn($return);
6402  self::assertSame(
6403  $return . $content,
6404  ‪$subject->‪stdWrap_preCObject($content, $conf)
6405  );
6406  }
6407 
6421  public function ‪stdWrap_preIfEmptyListNum(): void
6422  {
6423  $content = ‪StringUtility::getUniqueId('content');
6424  $conf = [
6425  'preIfEmptyListNum' => ‪StringUtility::getUniqueId('preIfEmptyListNum'),
6426  'preIfEmptyListNum.' => [
6427  'splitChar' => ‪StringUtility::getUniqueId('splitChar')
6428  ],
6429  ];
6430  $return = ‪StringUtility::getUniqueId('return');
6431  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6432  ->setMethods(['listNum'])->getMock();
6433  ‪$subject
6434  ->expects(self::once())
6435  ->method('listNum')
6436  ->with(
6437  $content,
6438  $conf['preIfEmptyListNum'],
6439  $conf['preIfEmptyListNum.']['splitChar']
6440  )
6441  ->willReturn($return);
6442  self::assertSame(
6443  $return,
6444  ‪$subject->‪stdWrap_preIfEmptyListNum($content, $conf)
6445  );
6446  }
6447 
6453  public function ‪stdWrap_prefixCommentDataProvider(): array
6454  {
6455  $content = ‪StringUtility::getUniqueId('content');
6456  $will = ‪StringUtility::getUniqueId('will');
6457  $conf = [];
6458  $conf['prefixComment'] = ‪StringUtility::getUniqueId('prefixComment');
6459  $emptyConf1 = [];
6460  $emptyConf2 = [];
6461  $emptyConf2['prefixComment'] = '';
6462  return [
6463  'standard case' => [$will, $content, $conf, false, 1, $will],
6464  'emptyConf1' => [$content, $content, $emptyConf1, false, 0, $will],
6465  'emptyConf2' => [$content, $content, $emptyConf2, false, 0, $will],
6466  'disabled by bool' => [$content, $content, $conf, true, 0, $will],
6467  'disabled by int' => [$content, $content, $conf, 1, 0, $will],
6468  ];
6469  }
6470 
6494  public function ‪stdWrap_prefixComment(
6495  string $expect,
6496  string $content,
6497  array $conf,
6498  $disable,
6499  int $times,
6500  string $will
6501  ): void {
6502  $this->frontendControllerMock
6503  ->config['config']['disablePrefixComment'] = $disable;
6504  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6505  ->setMethods(['prefixComment'])->getMock();
6506  ‪$subject
6507  ->expects(self::exactly($times))
6508  ->method('prefixComment')
6509  ->with($conf['prefixComment'] ?? null, [], $content)
6510  ->willReturn($will);
6511  self::assertSame(
6512  $expect,
6513  ‪$subject->‪stdWrap_prefixComment($content, $conf)
6514  );
6515  }
6516 
6530  public function ‪stdWrap_prepend(): void
6531  {
6532  $debugKey = '/stdWrap/.prepend';
6533  $content = ‪StringUtility::getUniqueId('content');
6534  $conf = [
6535  'prepend' => ‪StringUtility::getUniqueId('prepend'),
6536  'prepend.' => [‪StringUtility::getUniqueId('prepend.')],
6537  ];
6538  $return = ‪StringUtility::getUniqueId('return');
6539  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6540  ->setMethods(['cObjGetSingle'])->getMock();
6541  ‪$subject
6542  ->expects(self::once())
6543  ->method('cObjGetSingle')
6544  ->with($conf['prepend'], $conf['prepend.'], $debugKey)
6545  ->willReturn($return);
6546  self::assertSame(
6547  $return . $content,
6548  ‪$subject->‪stdWrap_prepend($content, $conf)
6549  );
6550  }
6551 
6557  public function ‪stdWrap_prioriCalcDataProvider(): array
6558  {
6559  return [
6560  'priority of *' => ['7', '1 + 2 * 3', []],
6561  'priority of parentheses' => ['9', '(1 + 2) * 3', []],
6562  'float' => ['1.5', '3/2', []],
6563  'intval casts to int' => [1, '3/2', ['prioriCalc' => 'intval']],
6564  'intval does not round' => [2, '2.7', ['prioriCalc' => 'intval']],
6565  ];
6566  }
6567 
6588  public function ‪stdWrap_prioriCalc($expect, string $content, array $conf): void
6589  {
6590  $result = $this->subject->stdWrap_prioriCalc($content, $conf);
6591  self::assertSame($expect, $result);
6592  }
6593 
6607  public function ‪stdWrap_preUserFunc(): void
6608  {
6609  $content = ‪StringUtility::getUniqueId('content');
6610  $conf = [
6611  'preUserFunc' => ‪StringUtility::getUniqueId('preUserFunc'),
6612  'preUserFunc.' => [‪StringUtility::getUniqueId('preUserFunc.')],
6613  ];
6614  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6615  ->setMethods(['callUserFunction'])->getMock();
6616  ‪$subject->expects(self::once())->method('callUserFunction')
6617  ->with($conf['preUserFunc'], $conf['preUserFunc.'], $content)
6618  ->willReturn('return');
6619  self::assertSame(
6620  'return',
6621  ‪$subject->‪stdWrap_preUserFunc($content, $conf)
6622  );
6623  }
6624 
6630  public function ‪stdWrap_rawUrlEncodeDataProvider(): array
6631  {
6632  return [
6633  'https://typo3.org?id=10' => [
6634  'https%3A%2F%2Ftypo3.org%3Fid%3D10',
6635  'https://typo3.org?id=10',
6636  ],
6637  'https://typo3.org?id=10&foo=bar' => [
6638  'https%3A%2F%2Ftypo3.org%3Fid%3D10%26foo%3Dbar',
6639  'https://typo3.org?id=10&foo=bar',
6640  ],
6641  ];
6642  }
6643 
6652  public function ‪stdWrap_rawUrlEncode(string $expect, string $content): void
6653  {
6654  self::assertSame(
6655  $expect,
6656  $this->subject->stdWrap_rawUrlEncode($content)
6657  );
6658  }
6659 
6672  public function ‪stdWrap_replacement(): void
6673  {
6674  $content = ‪StringUtility::getUniqueId('content');
6675  $conf = [
6676  'replacement' => ‪StringUtility::getUniqueId('not used'),
6677  'replacement.' => [‪StringUtility::getUniqueId('replacement.')],
6678  ];
6679  $return = ‪StringUtility::getUniqueId('return');
6680  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6681  ->setMethods(['replacement'])->getMock();
6682  ‪$subject
6683  ->expects(self::once())
6684  ->method('replacement')
6685  ->with($content, $conf['replacement.'])
6686  ->willReturn($return);
6687  self::assertSame(
6688  $return,
6689  ‪$subject->‪stdWrap_replacement($content, $conf)
6690  );
6691  }
6692 
6698  public function ‪stdWrap_requiredDataProvider(): array
6699  {
6700  return [
6701  // empty content
6702  'empty string is empty' => ['', true, ''],
6703  'null is empty' => ['', true, null],
6704  'false is empty' => ['', true, false],
6705 
6706  // non-empty content
6707  'blank is not empty' => [' ', false, ' '],
6708  'tab is not empty' => ["\t", false, "\t"],
6709  'linebreak is not empty' => [PHP_EOL, false, PHP_EOL],
6710  '"0" is not empty' => ['0', false, '0'],
6711  '0 is not empty' => [0, false, 0],
6712  '1 is not empty' => [1, false, 1],
6713  'true is not empty' => [true, false, true],
6714  ];
6715  }
6716 
6732  public function ‪stdWrap_required($expect, bool $stop, $content): void
6733  {
6735  ‪$subject->_set('stdWrapRecursionLevel', 1);
6736  ‪$subject->_set('stopRendering', [1 => false]);
6737  self::assertSame($expect, ‪$subject->‪stdWrap_required($content));
6738  self::assertSame($stop, ‪$subject->_get('stopRendering')[1]);
6739  }
6740 
6753  public function ‪stdWrap_round(): void
6754  {
6755  $content = ‪StringUtility::getUniqueId('content');
6756  $conf = [
6757  'round' => ‪StringUtility::getUniqueId('not used'),
6758  'round.' => [‪StringUtility::getUniqueId('round.')],
6759  ];
6760  $return = ‪StringUtility::getUniqueId('return');
6761  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6762  ->setMethods(['round'])->getMock();
6763  ‪$subject
6764  ->expects(self::once())
6765  ->method('round')
6766  ->with($content, $conf['round.'])
6767  ->willReturn($return);
6768  self::assertSame($return, ‪$subject->‪stdWrap_round($content, $conf));
6769  }
6770 
6776  public function ‪stdWrap_setContentToCurrent(): void
6777  {
6778  $content = ‪StringUtility::getUniqueId('content');
6779  self::assertNotSame($content, $this->subject->getData('current'));
6780  self::assertSame(
6781  $content,
6782  $this->subject->stdWrap_setContentToCurrent($content)
6783  );
6784  self::assertSame($content, $this->subject->getData('current'));
6785  }
6786 
6792  public function ‪stdWrap_setCurrentDataProvider(): array
6793  {
6794  return [
6795  'no conf' => [
6796  'content',
6797  [],
6798  ],
6799  'empty string' => [
6800  'content',
6801  ['setCurrent' => ''],
6802  ],
6803  'non-empty string' => [
6804  'content',
6805  ['setCurrent' => 'xxx'],
6806  ],
6807  'integer null' => [
6808  'content',
6809  ['setCurrent' => 0],
6810  ],
6811  'integer not null' => [
6812  'content',
6813  ['setCurrent' => 1],
6814  ],
6815  'boolean true' => [
6816  'content',
6817  ['setCurrent' => true],
6818  ],
6819  'boolean false' => [
6820  'content',
6821  ['setCurrent' => false],
6822  ],
6823  ];
6824  }
6825 
6834  public function ‪stdWrap_setCurrent(string $input, array $conf): void
6835  {
6836  if (isset($conf['setCurrent'])) {
6837  self::assertNotSame($conf['setCurrent'], $this->subject->getData('current'));
6838  }
6839  self::assertSame($input, $this->subject->stdWrap_setCurrent($input, $conf));
6840  if (isset($conf['setCurrent'])) {
6841  self::assertSame($conf['setCurrent'], $this->subject->getData('current'));
6842  }
6843  }
6844 
6857  public function ‪stdWrap_split(): void
6858  {
6859  $content = ‪StringUtility::getUniqueId('content');
6860  $conf = [
6861  'split' => ‪StringUtility::getUniqueId('not used'),
6862  'split.' => [‪StringUtility::getUniqueId('split.')],
6863  ];
6864  $return = ‪StringUtility::getUniqueId('return');
6865  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6866  ->setMethods(['splitObj'])->getMock();
6867  ‪$subject
6868  ->expects(self::once())
6869  ->method('splitObj')
6870  ->with($content, $conf['split.'])
6871  ->willReturn($return);
6872  self::assertSame(
6873  $return,
6874  ‪$subject->‪stdWrap_split($content, $conf)
6875  );
6876  }
6877 
6889  public function ‪stdWrap_stdWrap(): void
6890  {
6891  $content = ‪StringUtility::getUniqueId('content');
6892  $conf = [
6893  'stdWrap' => ‪StringUtility::getUniqueId('not used'),
6894  'stdWrap.' => [‪StringUtility::getUniqueId('stdWrap.')],
6895  ];
6896  $return = ‪StringUtility::getUniqueId('return');
6897  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6898  ->setMethods(['stdWrap'])->getMock();
6899  ‪$subject
6900  ->expects(self::once())
6901  ->method('stdWrap')
6902  ->with($content, $conf['stdWrap.'])
6903  ->willReturn($return);
6904  self::assertSame($return, ‪$subject->‪stdWrap_stdWrap($content, $conf));
6905  }
6906 
6912  public function ‪stdWrap_stdWrapValueDataProvider(): array
6913  {
6914  return [
6915  'only key returns value' => [
6916  'ifNull',
6917  [
6918  'ifNull' => '1',
6919  ],
6920  '',
6921  '1',
6922  ],
6923  'array without key returns empty string' => [
6924  'ifNull',
6925  [
6926  'ifNull.' => '1',
6927  ],
6928  '',
6929  '',
6930  ],
6931  'array without key returns default' => [
6932  'ifNull',
6933  [
6934  'ifNull.' => '1',
6935  ],
6936  'default',
6937  'default',
6938  ],
6939  'non existing key returns default' => [
6940  'ifNull',
6941  [
6942  'noTrimWrap' => 'test',
6943  'noTrimWrap.' => '1',
6944  ],
6945  'default',
6946  'default',
6947  ],
6948  'existing key and array returns stdWrap' => [
6949  'test',
6950  [
6951  'test' => 'value',
6952  'test.' => ['case' => 'upper'],
6953  ],
6954  'default',
6955  'VALUE'
6956  ],
6957  ];
6958  }
6959 
6968  public function ‪stdWrap_stdWrapValue(
6969  string $key,
6970  array $configuration,
6971  string $defaultValue,
6972  string $expected
6973  ): void {
6974  $result = $this->subject->stdWrapValue($key, $configuration, $defaultValue);
6975  self::assertEquals($expected, $result);
6976  }
6977 
6983  public function ‪stdWrap_strPadDataProvider(): array
6984  {
6985  return [
6986  'pad string with default settings and length 10' => [
6987  'Alien ',
6988  'Alien',
6989  [
6990  'length' => '10',
6991  ],
6992  ],
6993  'pad string with default settings and length 10 and multibyte character' => [
6994  'Älien ',
6995  'Älien',
6996  [
6997  'length' => '10',
6998  ],
6999  ],
7000  'pad string with padWith -= and type left and length 10' => [
7001  '-=-=-Alien',
7002  'Alien',
7003  [
7004  'length' => '10',
7005  'padWith' => '-=',
7006  'type' => 'left',
7007  ],
7008  ],
7009  'pad string with padWith äö and type left and length 10 and multibyte characters' => [
7010  'äöäöäÄlien',
7011  'Älien',
7012  [
7013  'length' => '10',
7014  'padWith' => 'äö',
7015  'type' => 'left',
7016  ],
7017  ],
7018  'pad string with padWith _ and type both and length 10' => [
7019  '__Alien___',
7020  'Alien',
7021  [
7022  'length' => '10',
7023  'padWith' => '_',
7024  'type' => 'both',
7025  ],
7026  ],
7027  'pad string with padWith 0 and type both and length 10' => [
7028  '00Alien000',
7029  'Alien',
7030  [
7031  'length' => '10',
7032  'padWith' => '0',
7033  'type' => 'both',
7034  ],
7035  ],
7036  'pad string with padWith ___ and type both and length 6' => [
7037  'Alien_',
7038  'Alien',
7039  [
7040  'length' => '6',
7041  'padWith' => '___',
7042  'type' => 'both',
7043  ],
7044  ],
7045  'pad string with padWith _ and type both and length 12, using stdWrap for length' => [
7046  '___Alien____',
7047  'Alien',
7048  [
7049  'length' => '1',
7050  'length.' => [
7051  'wrap' => '|2',
7052  ],
7053  'padWith' => '_',
7054  'type' => 'both',
7055  ],
7056  ],
7057  'pad string with padWith _ and type both and length 12, using stdWrap for padWidth' => [
7058  '-_=Alien-_=-',
7059  'Alien',
7060  [
7061  'length' => '12',
7062  'padWith' => '_',
7063  'padWith.' => [
7064  'wrap' => '-|=',
7065  ],
7066  'type' => 'both',
7067  ],
7068  ],
7069  'pad string with padWith _ and type both and length 12, using stdWrap for type' => [
7070  '_______Alien',
7071  'Alien',
7072  [
7073  'length' => '12',
7074  'padWith' => '_',
7075  'type' => 'both',
7076  // make type become "left"
7077  'type.' => [
7078  'substring' => '2,1',
7079  'wrap' => 'lef|',
7080  ],
7081  ],
7082  ],
7083  ];
7084  }
7085 
7095  public function ‪stdWrap_strPad(string $expect, string $content, array $conf): void
7096  {
7097  $conf = ['strPad.' => $conf];
7098  $result = $this->subject->stdWrap_strPad($content, $conf);
7099  self::assertSame($expect, $result);
7100  }
7101 
7107  public function ‪stdWrap_strftimeDataProvider(): array
7108  {
7109  // Fictive execution time is 2012-09-01 12:00 in UTC/GMT.
7110  $now = 1346500800;
7111  return [
7112  'given timestamp' => [
7113  '01-09-2012',
7114  $now,
7115  ['strftime' => '%d-%m-%Y'],
7116  $now
7117  ],
7118  'empty string' => [
7119  '01-09-2012',
7120  '',
7121  ['strftime' => '%d-%m-%Y'],
7122  $now
7123  ],
7124  'testing null' => [
7125  '01-09-2012',
7126  null,
7127  ['strftime' => '%d-%m-%Y'],
7128  $now
7129  ]
7130  ];
7131  }
7132 
7143  public function ‪stdWrap_strftime(string $expect, $content, array $conf, int $now): void
7144  {
7145  // Save current timezone and set to UTC to make the system under test
7146  // behave the same in all server timezone settings
7147  $timezoneBackup = date_default_timezone_get();
7148  date_default_timezone_set('UTC');
7149 
7150  ‪$GLOBALS['EXEC_TIME'] = $now;
7151  $result = $this->subject->stdWrap_strftime($content, $conf);
7152 
7153  // Reset timezone
7154  date_default_timezone_set($timezoneBackup);
7155 
7156  self::assertSame($expect, $result);
7157  }
7158 
7164  public function ‪stdWrap_stripHtml(): void
7165  {
7166  $content = '<html><p>Hello <span class="inline">inline tag<span>!</p><p>Hello!</p></html>';
7167  $expected = 'Hello inline tag!Hello!';
7168  self::assertSame($expected, $this->subject->stdWrap_stripHtml($content));
7169  }
7170 
7176  public function ‪stdWrap_strtotimeDataProvider(): array
7177  {
7178  return [
7179  'date from content' => [
7180  1417651200,
7181  '2014-12-04',
7182  ['strtotime' => '1']
7183  ],
7184  'manipulation of date from content' => [
7185  1417996800,
7186  '2014-12-04',
7187  ['strtotime' => '+ 2 weekdays']
7188  ],
7189  'date from configuration' => [
7190  1417651200,
7191  '',
7192  ['strtotime' => '2014-12-04']
7193  ],
7194  'manipulation of date from configuration' => [
7195  1417996800,
7196  '',
7197  ['strtotime' => '2014-12-04 + 2 weekdays']
7198  ],
7199  'empty input' => [
7200  false,
7201  '',
7202  ['strtotime' => '1']
7203  ],
7204  'date from content and configuration' => [
7205  false,
7206  '2014-12-04',
7207  ['strtotime' => '2014-12-05']
7208  ]
7209  ];
7210  }
7211 
7221  public function ‪stdWrap_strtotime($expect, string $content, array $conf): void
7222  {
7223  // Set exec_time to a hard timestamp
7224  ‪$GLOBALS['EXEC_TIME'] = 1417392000;
7225  // Save current timezone and set to UTC to make the system under test
7226  // behave the same in all server timezone settings
7227  $timezoneBackup = date_default_timezone_get();
7228  date_default_timezone_set('UTC');
7229 
7230  $result = $this->subject->stdWrap_strtotime($content, $conf);
7231 
7232  // Reset timezone
7233  date_default_timezone_set($timezoneBackup);
7234 
7235  self::assertEquals($expect, $result);
7236  }
7237 
7250  public function ‪stdWrap_substring(): void
7251  {
7252  $content = ‪StringUtility::getUniqueId('content');
7253  $conf = [
7254  'substring' => ‪StringUtility::getUniqueId('substring'),
7255  'substring.' => ‪StringUtility::getUniqueId('not used'),
7256  ];
7257  $return = ‪StringUtility::getUniqueId('return');
7258  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7259  ->setMethods(['substring'])->getMock();
7260  ‪$subject
7261  ->expects(self::once())
7262  ->method('substring')
7263  ->with($content, $conf['substring'])
7264  ->willReturn($return);
7265  self::assertSame(
7266  $return,
7267  ‪$subject->‪stdWrap_substring($content, $conf)
7268  );
7269  }
7270 
7276  public function ‪stdWrap_trimDataProvider(): array
7277  {
7278  return [
7279  // string not trimmed
7280  'empty string' => ['', ''],
7281  'string without whitespace' => ['xxx', 'xxx'],
7282  'string with whitespace inside' => [
7283  'xx ' . "\t" . ' xx',
7284  'xx ' . "\t" . ' xx',
7285  ],
7286  'string with newlines inside' => [
7287  'xx ' . PHP_EOL . ' xx',
7288  'xx ' . PHP_EOL . ' xx',
7289  ],
7290  // string trimmed
7291  'blanks around' => ['xxx', ' xxx '],
7292  'tabs around' => ['xxx', "\t" . 'xxx' . "\t"],
7293  'newlines around' => ['xxx', PHP_EOL . 'xxx' . PHP_EOL],
7294  'mixed case' => ['xxx', "\t" . ' xxx ' . PHP_EOL],
7295  // non strings
7296  'null' => ['', null],
7297  'false' => ['', false],
7298  'true' => ['1', true],
7299  'zero' => ['0', 0],
7300  'one' => ['1', 1],
7301  '-1' => ['-1', -1],
7302  '0.0' => ['0', 0.0],
7303  '1.0' => ['1', 1.0],
7304  '-1.0' => ['-1', -1.0],
7305  '1.1' => ['1.1', 1.1],
7306  ];
7307  }
7308 
7329  public function ‪stdWrap_trim(string $expect, $content): void
7330  {
7331  $result = $this->subject->stdWrap_trim($content);
7332  self::assertSame($expect, $result);
7333  }
7334 
7346  public function ‪stdWrap_typolink(): void
7347  {
7348  $content = ‪StringUtility::getUniqueId('content');
7349  $conf = [
7350  'typolink' => ‪StringUtility::getUniqueId('not used'),
7351  'typolink.' => [‪StringUtility::getUniqueId('typolink.')],
7352  ];
7353  $return = ‪StringUtility::getUniqueId('return');
7354  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7355  ->setMethods(['typolink'])->getMock();
7356  ‪$subject
7357  ->expects(self::once())
7358  ->method('typolink')
7359  ->with($content, $conf['typolink.'])
7360  ->willReturn($return);
7361  self::assertSame($return, ‪$subject->‪stdWrap_typolink($content, $conf));
7362  }
7363 
7369  public function ‪stdWrap_wrapDataProvider(): array
7370  {
7371  return [
7372  'no conf' => [
7373  'XXX',
7374  'XXX',
7375  [],
7376  ],
7377  'simple' => [
7378  '<wrapper>XXX</wrapper>',
7379  'XXX',
7380  ['wrap' => '<wrapper>|</wrapper>'],
7381  ],
7382  'trims whitespace' => [
7383  '<wrapper>XXX</wrapper>',
7384  'XXX',
7385  ['wrap' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7386  ],
7387  'missing pipe puts wrap before' => [
7388  '<pre>XXX',
7389  'XXX',
7390  [
7391  'wrap' => '<pre>',
7392  ],
7393  ],
7394  'split char change' => [
7395  '<wrapper>XXX</wrapper>',
7396  'XXX',
7397  [
7398  'wrap' => '<wrapper> # </wrapper>',
7399  'wrap.' => ['splitChar' => '#'],
7400  ],
7401  ],
7402  'split by pattern' => [
7403  '<wrapper>XXX</wrapper>',
7404  'XXX',
7405  [
7406  'wrap' => '<wrapper> ###splitter### </wrapper>',
7407  'wrap.' => ['splitChar' => '###splitter###'],
7408  ],
7409  ],
7410  ];
7411  }
7412 
7422  public function ‪stdWrap_wrap(string $expected, string $input, array $conf): void
7423  {
7424  self::assertSame(
7425  $expected,
7426  $this->subject->stdWrap_wrap($input, $conf)
7427  );
7428  }
7429 
7435  public function ‪stdWrap_wrap2DataProvider(): array
7436  {
7437  return [
7438  'no conf' => [
7439  'XXX',
7440  'XXX',
7441  [],
7442  ],
7443  'simple' => [
7444  '<wrapper>XXX</wrapper>',
7445  'XXX',
7446  ['wrap2' => '<wrapper>|</wrapper>'],
7447  ],
7448  'trims whitespace' => [
7449  '<wrapper>XXX</wrapper>',
7450  'XXX',
7451  ['wrap2' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7452  ],
7453  'missing pipe puts wrap2 before' => [
7454  '<pre>XXX',
7455  'XXX',
7456  [
7457  'wrap2' => '<pre>',
7458  ],
7459  ],
7460  'split char change' => [
7461  '<wrapper>XXX</wrapper>',
7462  'XXX',
7463  [
7464  'wrap2' => '<wrapper> # </wrapper>',
7465  'wrap2.' => ['splitChar' => '#'],
7466  ],
7467  ],
7468  'split by pattern' => [
7469  '<wrapper>XXX</wrapper>',
7470  'XXX',
7471  [
7472  'wrap2' => '<wrapper> ###splitter### </wrapper>',
7473  'wrap2.' => ['splitChar' => '###splitter###'],
7474  ],
7475  ],
7476  ];
7477  }
7478 
7488  public function ‪stdWrap_wrap2(string $expected, string $input, array $conf): void
7489  {
7490  self::assertSame($expected, $this->subject->stdWrap_wrap2($input, $conf));
7491  }
7492 
7498  public function ‪stdWrap_wrap3DataProvider(): array
7499  {
7500  return [
7501  'no conf' => [
7502  'XXX',
7503  'XXX',
7504  [],
7505  ],
7506  'simple' => [
7507  '<wrapper>XXX</wrapper>',
7508  'XXX',
7509  ['wrap3' => '<wrapper>|</wrapper>'],
7510  ],
7511  'trims whitespace' => [
7512  '<wrapper>XXX</wrapper>',
7513  'XXX',
7514  ['wrap3' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7515  ],
7516  'missing pipe puts wrap3 before' => [
7517  '<pre>XXX',
7518  'XXX',
7519  [
7520  'wrap3' => '<pre>',
7521  ],
7522  ],
7523  'split char change' => [
7524  '<wrapper>XXX</wrapper>',
7525  'XXX',
7526  [
7527  'wrap3' => '<wrapper> # </wrapper>',
7528  'wrap3.' => ['splitChar' => '#'],
7529  ],
7530  ],
7531  'split by pattern' => [
7532  '<wrapper>XXX</wrapper>',
7533  'XXX',
7534  [
7535  'wrap3' => '<wrapper> ###splitter### </wrapper>',
7536  'wrap3.' => ['splitChar' => '###splitter###'],
7537  ],
7538  ],
7539  ];
7540  }
7541 
7551  public function ‪stdWrap_wrap3(string $expected, string $input, array $conf): void
7552  {
7553  self::assertSame($expected, $this->subject->stdWrap_wrap3($input, $conf));
7554  }
7555 
7561  public function ‪stdWrap_wrapAlignDataProvider(): array
7562  {
7563  $format = '<div style="text-align:%s;">%s</div>';
7564  $content = ‪StringUtility::getUniqueId('content');
7565  $wrapAlign = ‪StringUtility::getUniqueId('wrapAlign');
7566  $expect = sprintf($format, $wrapAlign, $content);
7567  return [
7568  'standard case' => [$expect, $content, $wrapAlign],
7569  'empty conf' => [$content, $content, null],
7570  'empty string' => [$content, $content, ''],
7571  'whitespaced zero string' => [$content, $content, ' 0 '],
7572  ];
7573  }
7574 
7591  public function ‪stdWrap_wrapAlign(string $expect, string $content, $wrapAlignConf): void
7592  {
7593  $conf = [];
7594  if ($wrapAlignConf !== null) {
7595  $conf['wrapAlign'] = $wrapAlignConf;
7596  }
7597  self::assertSame(
7598  $expect,
7599  $this->subject->stdWrap_wrapAlign($content, $conf)
7600  );
7601  }
7602 
7603  /***************************************************************************
7604  * End of tests of stdWrap in alphabetical order
7605  ***************************************************************************/
7606 
7607  /***************************************************************************
7608  * Begin: Mixed tests
7609  *
7610  * - Add new tests here that still don't have a better place in this class.
7611  * - Place tests in alphabetical order.
7612  * - Place data provider above test method.
7613  ***************************************************************************/
7614 
7620  public function ‪getCurrentTable(): void
7621  {
7622  self::assertEquals('tt_content', $this->subject->getCurrentTable());
7623  }
7624 
7630  public function ‪prefixCommentDataProvider(): array
7631  {
7632  $comment = ‪StringUtility::getUniqueId();
7633  $content = ‪StringUtility::getUniqueId();
7634  $format = '%s';
7635  $format .= '%%s<!-- %%s [begin] -->%s';
7636  $format .= '%%s%s%%s%s';
7637  $format .= '%%s<!-- %%s [end] -->%s';
7638  $format .= '%%s%s';
7639  $format = sprintf($format, LF, LF, "\t", LF, LF, "\t");
7640  $indent1 = "\t";
7641  $indent2 = "\t" . "\t";
7642  return [
7643  'indent one tab' => [
7644  sprintf(
7645  $format,
7646  $indent1,
7647  $comment,
7648  $indent1,
7649  $content,
7650  $indent1,
7651  $comment,
7652  $indent1
7653  ),
7654  '1|' . $comment,
7655  $content
7656  ],
7657  'indent two tabs' => [
7658  sprintf(
7659  $format,
7660  $indent2,
7661  $comment,
7662  $indent2,
7663  $content,
7664  $indent2,
7665  $comment,
7666  $indent2
7667  ),
7668  '2|' . $comment,
7669  $content
7670  ],
7671  'htmlspecialchars applies for comment only' => [
7672  sprintf(
7673  $format,
7674  $indent1,
7675  '&lt;' . $comment . '&gt;',
7676  $indent1,
7677  '<' . $content . '>',
7678  $indent1,
7679  '&lt;' . $comment . '&gt;',
7680  $indent1
7681  ),
7682  '1|<' . $comment . '>',
7683  '<' . $content . '>'
7684  ],
7685  ];
7686  }
7687 
7697  public function ‪prefixComment(string $expect, string $comment, string $content): void
7698  {
7699  // The parameter $conf is never used. Just provide null.
7700  // Consider to improve the signature and deprecate the old one.
7701  $result = $this->subject->prefixComment($comment, null, $content);
7702  self::assertEquals($expect, $result);
7703  }
7704 
7710  public function ‪setCurrentFile_getCurrentFile(): void
7711  {
7712  $storageMock = $this->createMock(ResourceStorage::class);
7713  $file = new ‪File(['testfile'], $storageMock);
7714  $this->subject->setCurrentFile($file);
7715  self::assertSame($file, $this->subject->getCurrentFile());
7716  }
7717 
7727  public function ‪setCurrentVal_getCurrentVal(): void
7728  {
7730  $value = ‪StringUtility::getUniqueId();
7731  $this->subject->currentValKey = $key;
7732  $this->subject->setCurrentVal($value);
7733  self::assertEquals($value, $this->subject->getCurrentVal());
7734  self::assertEquals($value, $this->subject->data[$key]);
7735  }
7736 
7742  public function ‪setUserObjectType_getUserObjectType(): void
7743  {
7744  $value = ‪StringUtility::getUniqueId();
7745  $this->subject->setUserObjectType($value);
7746  self::assertEquals($value, $this->subject->getUserObjectType());
7747  }
7748 
7754  public function ‪emailSpamProtectionWithTypeAsciiDataProvider(): array
7755  {
7756  return [
7757  'Simple email address' => [
7758  'test@email.tld',
7759  '&#116;&#101;&#115;&#116;&#64;&#101;&#109;&#97;&#105;&#108;&#46;&#116;&#108;&#100;'
7760  ],
7761  'Simple email address with unicode characters' => [
7762  'matthäus@email.tld',
7763  '&#109;&#97;&#116;&#116;&#104;&#228;&#117;&#115;&#64;&#101;&#109;&#97;&#105;&#108;&#46;&#116;&#108;&#100;'
7764  ],
7765  'Susceptible email address' => [
7766  '"><script>alert(\'emailSpamProtection\')</script>',
7767  '&#34;&#62;&#60;&#115;&#99;&#114;&#105;&#112;&#116;&#62;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#101;&#109;&#97;&#105;&#108;&#83;&#112;&#97;&#109;&#80;&#114;&#111;&#116;&#101;&#99;&#116;&#105;&#111;&#110;&#39;&#41;&#60;&#47;&#115;&#99;&#114;&#105;&#112;&#116;&#62;'
7768 
7769  ],
7770  'Susceptible email address with unicode characters' => [
7771  '"><script>alert(\'È…mÇ¡ilSpamProtÈ…ction\')</script>',
7772  '&#34;&#62;&#60;&#115;&#99;&#114;&#105;&#112;&#116;&#62;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#517;&#109;&#481;&#105;&#108;&#83;&#112;&#97;&#109;&#80;&#114;&#111;&#116;&#517;&#99;&#116;&#105;&#111;&#110;&#39;&#41;&#60;&#47;&#115;&#99;&#114;&#105;&#112;&#116;&#62;'
7773  ],
7774  ];
7775  }
7776 
7785  public function ‪mailSpamProtectionWithTypeAscii(string $content, string $expected): void
7786  {
7787  self::assertSame(
7788  $expected,
7789  $this->subject->_call('encryptEmail', $content, 'ascii')
7790  );
7791  }
7792 
7793  /***************************************************************************
7794  * End: Mixed tests
7795  ***************************************************************************/
7796 }
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canRegisterAContentObjectClassForATypoScriptName
‪canRegisterAContentObjectClassForATypoScriptName()
Definition: ContentObjectRendererTest.php:282
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prepend
‪stdWrap_prepend()
Definition: ContentObjectRendererTest.php:6523
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\mailSpamProtectionWithTypeAscii
‪mailSpamProtectionWithTypeAscii(string $content, string $expected)
Definition: ContentObjectRendererTest.php:7778
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait\createSiteWithLanguage
‪Site createSiteWithLanguage(array $languageConfiguration)
Definition: ContentObjectRendererTestTrait.php:189
‪TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject
Definition: RestoreRegisterContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setContentToCurrent
‪stdWrap_setContentToCurrent()
Definition: ContentObjectRendererTest.php:6769
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_rawUrlEncodeDataProvider
‪array stdWrap_rawUrlEncodeDataProvider()
Definition: ContentObjectRendererTest.php:6623
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_case
‪string stdWrap_case($content='', $conf=[])
Definition: ContentObjectRenderer.php:2393
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectStdWrapHookInterface
Definition: ContentObjectStdWrapHookInterface.php:22
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_editIcons
‪string stdWrap_editIcons($content='', $conf=[])
Definition: ContentObjectRenderer.php:2884
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\round
‪round(float $expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:1002
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesSingleParameter
‪getQueryArgumentsOverrulesSingleParameter()
Definition: ContentObjectRendererTest.php:439
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encapsLines
‪stdWrap_encapsLines()
Definition: ContentObjectRendererTest.php:4668
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preIfEmptyListNum
‪stdWrap_preIfEmptyListNum()
Definition: ContentObjectRendererTest.php:6414
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cacheRead
‪string stdWrap_cacheRead($content='', $conf=[])
Definition: ContentObjectRenderer.php:1725
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\roundDataProvider
‪array roundDataProvider()
Definition: ContentObjectRendererTest.php:937
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strftime
‪stdWrap_strftime(string $expect, $content, array $conf, int $now)
Definition: ContentObjectRendererTest.php:7136
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap2DataProvider
‪array stdWrap_innerWrap2DataProvider()
Definition: ContentObjectRendererTest.php:5577
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSiteLanguage
‪getDataWithTypeSiteLanguage()
Definition: ContentObjectRendererTest.php:1786
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strtotime
‪stdWrap_strtotime($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:7214
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapBrDataProvider
‪string[][] stdWrapBrDataProvider()
Definition: ContentObjectRendererTest.php:3494
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:31
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_editPanel
‪string stdWrap_editPanel($content='', $conf=[])
Definition: ContentObjectRenderer.php:2903
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_round
‪stdWrap_round()
Definition: ContentObjectRendererTest.php:6746
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_insertData
‪string stdWrap_insertData($content='')
Definition: ContentObjectRenderer.php:2816
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$contentObjectMap
‪array $contentObjectMap
Definition: ContentObjectRendererTest.php:101
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsExcludesParameters
‪getQueryArgumentsExcludesParameters()
Definition: ContentObjectRendererTest.php:392
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:180
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeTsfe
‪getDataWithTypeTsfe()
Definition: ContentObjectRendererTest.php:1371
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGlobal
‪getDataWithTypeGlobal()
Definition: ContentObjectRendererTest.php:1530
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\createContentObjectThrowingExceptionFixture
‪PHPUnit Framework MockObject MockObject AbstractContentObject createContentObjectThrowingExceptionFixture()
Definition: ContentObjectRendererTest.php:2074
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\emailSpamProtectionWithTypeAsciiDataProvider
‪array emailSpamProtectionWithTypeAsciiDataProvider()
Definition: ContentObjectRendererTest.php:7747
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_orderedStdWrap
‪string stdWrap_orderedStdWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2787
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_HTMLparserDataProvider
‪array stdWrap_HTMLparserDataProvider()
Definition: ContentObjectRendererTest.php:3310
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_split
‪stdWrap_split()
Definition: ContentObjectRendererTest.php:6850
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait\getLibParseFunc_RTE
‪array getLibParseFunc_RTE()
Definition: ContentObjectRendererTestTrait.php:30
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksFilesDataProvider
‪array typolinkReturnsCorrectLinksFilesDataProvider()
Definition: ContentObjectRendererTest.php:2408
‪TYPO3\CMS\Core\Core\ApplicationContext
Definition: ApplicationContext.php:37
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFromCache
‪getFromCache($expect, $conf, $cacheKey, $times, $cached)
Definition: ContentObjectRendererTest.php:2909
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canNotAccessInternalContentObjectMapByReference
‪canNotAccessInternalContentObjectMapByReference()
Definition: ContentObjectRendererTest.php:319
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheStore
‪stdWrap_cacheStore( $confCache, int $timesCCK, $key, int $times)
Definition: ContentObjectRendererTest.php:3912
‪TYPO3\CMS\Frontend\ContentObject\ImageContentObject
Definition: ImageContentObject.php:29
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkEncodesMailAddressForSpamProtection
‪typoLinkEncodesMailAddressForSpamProtection(array $settings, $linkText, $mailAddress, $expected)
Definition: ContentObjectRendererTest.php:2283
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap3DataProvider
‪array stdWrap_wrap3DataProvider()
Definition: ContentObjectRendererTest.php:7491
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugRootline
‪getDataWithTypeDebugRootline()
Definition: ContentObjectRendererTest.php:1817
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForFilesWithAbsRefPrefix
‪typolinkReturnsCorrectLinksForFilesWithAbsRefPrefix( $linkText, $configuration, $absRefPrefix, $expectedResult)
Definition: ContentObjectRendererTest.php:2676
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_replacement
‪stdWrap_replacement()
Definition: ContentObjectRendererTest.php:6665
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDate
‪getDataWithTypeDate()
Definition: ContentObjectRendererTest.php:1636
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cObject
‪stdWrap_cObject()
Definition: ContentObjectRendererTest.php:3675
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_listNum
‪string stdWrap_listNum($content='', $conf=[])
Definition: ContentObjectRenderer.php:1998
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheReadDataProvider
‪array stdWrap_cacheReadDataProvider()
Definition: ContentObjectRendererTest.php:3781
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGp
‪getDataWithTypeGp(string $key, string $expectedValue)
Definition: ContentObjectRendererTest.php:1353
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_prefixComment
‪string stdWrap_prefixComment($content='', $conf=[])
Definition: ContentObjectRenderer.php:2865
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapReturnsExpectationDataProvider
‪array stdWrapReturnsExpectationDataProvider()
Definition: ContentObjectRendererTest.php:1264
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\localConfigurationOverridesGlobalConfiguration
‪localConfigurationOverridesGlobalConfiguration()
Definition: ContentObjectRendererTest.php:2035
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_replacement
‪string stdWrap_replacement($content='', $conf=[])
Definition: ContentObjectRenderer.php:2208
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait
Definition: ContentObjectRendererTestTrait.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_addPageCacheTagsAddsPageTagsDataProvider
‪array stdWrap_addPageCacheTagsAddsPageTagsDataProvider()
Definition: ContentObjectRendererTest.php:3391
‪TYPO3\CMS\Frontend\ContentObject\HierarchicalMenuContentObject
Definition: HierarchicalMenuContentObject.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: ContentObjectRendererTest.php:83
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeCurrent
‪getDataWithTypeCurrent()
Definition: ContentObjectRendererTest.php:1662
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$templateServiceMock
‪PHPUnit Framework MockObject MockObject TemplateService $templateServiceMock
Definition: ContentObjectRendererTest.php:95
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_required
‪stdWrap_required($expect, bool $stop, $content)
Definition: ContentObjectRendererTest.php:6725
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheStoreDataProvider
‪array stdWrap_cacheStoreDataProvider()
Definition: ContentObjectRendererTest.php:3865
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\hashDataProvider
‪array hashDataProvider()
Definition: ContentObjectRendererTest.php:5124
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap2
‪stdWrap_innerWrap2(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5620
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap2DataProvider
‪array stdWrap_wrap2DataProvider()
Definition: ContentObjectRendererTest.php:7428
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrapValueDataProvider
‪array stdWrap_stdWrapValueDataProvider()
Definition: ContentObjectRendererTest.php:6905
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeRegister
‪getDataWithTypeRegister()
Definition: ContentObjectRendererTest.php:1479
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canSetTheContentObjectClassMapAndGetARegisteredContentObject
‪canSetTheContentObjectClassMapAndGetARegisteredContentObject()
Definition: ContentObjectRendererTest.php:301
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dataWrap
‪stdWrap_dataWrap()
Definition: ContentObjectRendererTest.php:4260
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeParentRecordNumber
‪getDataWithTypeParentRecordNumber()
Definition: ContentObjectRendererTest.php:1805
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_prepend
‪string stdWrap_prepend($content='', $conf=[])
Definition: ContentObjectRenderer.php:2743
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_brTag
‪stdWrap_brTag(string $input, string $expected, array $config)
Definition: ContentObjectRendererTest.php:3580
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderedErrorMessageCanBeCustomized
‪renderedErrorMessageCanBeCustomized()
Definition: ContentObjectRendererTest.php:2018
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertData
‪stdWrap_insertData()
Definition: ContentObjectRendererTest.php:5639
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_stdWrap
‪string stdWrap_stdWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2060
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\html5SelfClosingTagsDataprovider
‪array html5SelfClosingTagsDataprovider()
Definition: ContentObjectRendererTest.php:4726
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\checkIf
‪checkIf(bool $expect, array $conf)
Definition: ContentObjectRendererTest.php:5365
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGetindpenv
‪getDataWithTypeGetindpenv()
Definition: ContentObjectRendererTest.php:1394
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_trim
‪stdWrap_trim(string $expect, $content)
Definition: ContentObjectRendererTest.php:7322
‪TYPO3\CMS\Core\Core\Environment\isWindows
‪static bool isWindows()
Definition: Environment.php:292
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\willReturnNullForUnregisteredObject
‪willReturnNullForUnregisteredObject()
Definition: ContentObjectRendererTest.php:334
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\replacementDataProvider
‪array replacementDataProvider()
Definition: ContentObjectRendererTest.php:1122
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_if
‪stdWrap_if(string $expect, bool $stop, string $content, array $conf, int $times, $will)
Definition: ContentObjectRendererTest.php:5323
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsHandlesRemovedMethodsDataProvider
‪array getQueryArgumentsHandlesRemovedMethodsDataProvider()
Definition: ContentObjectRendererTest.php:548
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\HTMLcaseshift
‪string HTMLcaseshift($theValue, $case)
Definition: ContentObjectRenderer.php:5774
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapDoubleBrTagDataProvider
‪array stdWrapDoubleBrTagDataProvider()
Definition: ContentObjectRendererTest.php:4462
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugData
‪stdWrap_debugData()
Definition: ContentObjectRendererTest.php:4379
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\rawUrlEncodeSquareBracketsInUrl
‪string rawUrlEncodeSquareBracketsInUrl(string $string)
Definition: ContentObjectRendererTest.php:592
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_langViaSiteLanguage
‪stdWrap_langViaSiteLanguage(string $expected, string $input, array $conf, string $language)
Definition: ContentObjectRendererTest.php:5864
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectGetImageResourceHookInterface
Definition: ContentObjectGetImageResourceHookInterface.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFrontendController
‪TypoScriptFrontendController getFrontendController()
Definition: ContentObjectRendererTest.php:193
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_parseFunc
‪stdWrap_parseFunc()
Definition: ContentObjectRendererTest.php:6222
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\registersAllDefaultContentObjects
‪registersAllDefaultContentObjects(string $objectName, string $className)
Definition: ContentObjectRendererTest.php:375
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_htmlSpecialCharsDataProvider
‪array stdWrap_htmlSpecialCharsDataProvider()
Definition: ContentObjectRendererTest.php:5181
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_HTMLparser
‪stdWrap_HTMLparser(string $expect, string $content, array $conf, int $times, string $will)
Definition: ContentObjectRendererTest.php:3368
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_expandList
‪stdWrap_expandList(string $expected, string $content)
Definition: ContentObjectRendererTest.php:4966
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encapsLines_HTML5SelfClosingTags
‪stdWrap_encapsLines_HTML5SelfClosingTags(string $input, string $expected)
Definition: ContentObjectRendererTest.php:4699
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_round
‪string stdWrap_round($content='', $conf=[])
Definition: ContentObjectRenderer.php:2285
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFileReturnsUidOfFileObject
‪getDataWithTypeFileReturnsUidOfFileObject(string $typoScriptPath)
Definition: ContentObjectRendererTest.php:1451
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropHTMLDataProvider
‪array cropHTMLDataProvider()
Definition: ContentObjectRendererTest.php:621
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_hash
‪stdWrap_hash(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:5168
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevelfield
‪getDataWithTypeLevelfield()
Definition: ContentObjectRendererTest.php:1597
‪TYPO3\CMS\Core\Cache\Frontend\NullFrontend
Definition: NullFrontend.php:29
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSession
‪getDataWithTypeSession()
Definition: ContentObjectRendererTest.php:1493
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_trimDataProvider
‪array stdWrap_trimDataProvider()
Definition: ContentObjectRendererTest.php:7269
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\handleCharset
‪handleCharset(string &$subject, string &$expected)
Definition: ContentObjectRendererTest.php:204
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_substring
‪stdWrap_substring()
Definition: ContentObjectRendererTest.php:7243
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_intvalDataProvider
‪array stdWrap_intvalDataProvider()
Definition: ContentObjectRendererTest.php:5686
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_HTMLparser
‪string stdWrap_HTMLparser($content='', $conf=[])
Definition: ContentObjectRenderer.php:2178
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_keywords
‪stdWrap_keywords(string $expected, string $input)
Definition: ContentObjectRendererTest.php:5788
‪TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException
Definition: ContentRenderingException.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeField
‪getDataWithTypeField()
Definition: ContentObjectRendererTest.php:1406
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapAlignDataProvider
‪array stdWrap_wrapAlignDataProvider()
Definition: ContentObjectRendererTest.php:7554
‪$fields
‪$fields
Definition: pages.php:5
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_split
‪string stdWrap_split($content='', $conf=[])
Definition: ContentObjectRenderer.php:2195
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getLibParseFunc
‪array getLibParseFunc()
Definition: ContentObjectRendererTest.php:2090
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encodeForJavaScriptValue
‪stdWrap_encodeForJavaScriptValue(string $expect, string $content)
Definition: ContentObjectRendererTest.php:4931
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_rawUrlEncode
‪stdWrap_rawUrlEncode(string $expect, string $content)
Definition: ContentObjectRendererTest.php:6645
‪TYPO3\CMS\Core\Configuration\SiteConfiguration
Definition: SiteConfiguration.php:41
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropIsMultibyteSafe
‪cropIsMultibyteSafe()
Definition: ContentObjectRendererTest.php:603
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_field
‪stdWrap_field()
Definition: ContentObjectRendererTest.php:4984
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkEncodesMailAddressForSpamProtectionDataProvider
‪array typoLinkEncodesMailAddressForSpamProtectionDataProvider()
Definition: ContentObjectRendererTest.php:2299
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_numRows
‪string stdWrap_numRows($content='', $conf=[])
Definition: ContentObjectRenderer.php:1875
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFieldValDataProvider
‪array getFieldValDataProvider()
Definition: ContentObjectRendererTest.php:2942
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cacheStore
‪string stdWrap_cacheStore($content='', $conf=[])
Definition: ContentObjectRenderer.php:2934
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredGlobally
‪renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredGlobally()
Definition: ContentObjectRendererTest.php:1992
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_doubleBrTag
‪stdWrap_doubleBrTag(string $expected, string $input, array $config)
Definition: ContentObjectRendererTest.php:4527
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\allStdWrapProcessorsAreCallable
‪allStdWrapProcessorsAreCallable()
Definition: ContentObjectRendererTest.php:3159
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\HTMLcaseshiftDataProvider
‪array HTMLcaseshiftDataProvider()
Definition: ContentObjectRendererTest.php:3068
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypePage
‪getDataWithTypePage()
Definition: ContentObjectRendererTest.php:1650
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_if
‪string stdWrap_if($content='', $conf=[])
Definition: ContentObjectRenderer.php:2109
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_outerWrapDataProvider
‪array stdWrap_outerWrapDataProvider()
Definition: ContentObjectRendererTest.php:6070
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapKeywordsDataProvider
‪string[][] stdWrapKeywordsDataProvider()
Definition: ContentObjectRendererTest.php:5740
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prefixComment
‪stdWrap_prefixComment(string $expect, string $content, array $conf, $disable, int $times, string $will)
Definition: ContentObjectRendererTest.php:6487
‪TYPO3\CMS\Frontend\ContentObject\UserInternalContentObject
Definition: UserInternalContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_override
‪stdWrap_override($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:6201
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setUp
‪setUp()
Definition: ContentObjectRendererTest.php:133
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preCObject
‪stdWrap_preCObject()
Definition: ContentObjectRendererTest.php:6379
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:40
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postCObject
‪stdWrap_postCObject()
Definition: ContentObjectRendererTest.php:6256
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLeveltitle
‪getDataWithTypeLeveltitle()
Definition: ContentObjectRendererTest.php:1540
‪TYPO3\CMS\Frontend\ContentObject\TemplateContentObject
Definition: TemplateContentObject.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFileReturnsUidOfFileObjectDataProvider
‪getDataWithTypeFileReturnsUidOfFileObjectDataProvider()
Definition: ContentObjectRendererTest.php:1430
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkLogsErrorIfNoLinkResolvingIsPossible
‪typoLinkLogsErrorIfNoLinkResolvingIsPossible()
Definition: ContentObjectRendererTest.php:2761
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_fieldRequiredDataProvider
‪array stdWrap_fieldRequiredDataProvider()
Definition: ContentObjectRendererTest.php:5006
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\substring
‪substring(string $expect, string $content, string $conf)
Definition: ContentObjectRendererTest.php:1324
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_noTrimWrap
‪stdWrap_noTrimWrap(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:5997
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\prefixCommentDataProvider
‪array prefixCommentDataProvider()
Definition: ContentObjectRendererTest.php:7623
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropHTML
‪cropHTML(string $expect, string $content, string $conf)
Definition: ContentObjectRendererTest.php:923
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\numberFormat
‪numberFormat(string $expects, $content, array $conf)
Definition: ContentObjectRendererTest.php:1109
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSiteWithBaseVariants
‪getDataWithTypeSiteWithBaseVariants()
Definition: ContentObjectRendererTest.php:1754
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preIfEmptyListNum
‪string stdWrap_preIfEmptyListNum($content='', $conf=[])
Definition: ContentObjectRenderer.php:1936
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strtotimeDataProvider
‪array stdWrap_strtotimeDataProvider()
Definition: ContentObjectRendererTest.php:7169
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeContext
‪getDataWithTypeContext()
Definition: ContentObjectRendererTest.php:1716
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLeveluid
‪getDataWithTypeLeveluid()
Definition: ContentObjectRendererTest.php:1578
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\numberFormatDataProvider
‪array numberFormatDataProvider()
Definition: ContentObjectRendererTest.php:1062
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setCurrentDataProvider
‪array stdWrap_setCurrentDataProvider()
Definition: ContentObjectRendererTest.php:6785
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\caseshiftDataProvider
‪array caseshiftDataProvider()
Definition: ContentObjectRendererTest.php:3033
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\specificExceptionsCanBeIgnoredByExceptionHandler
‪specificExceptionsCanBeIgnoredByExceptionHandler()
Definition: ContentObjectRendererTest.php:2056
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preCObject
‪string stdWrap_preCObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:2606
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_required
‪string stdWrap_required($content='')
Definition: ContentObjectRenderer.php:2091
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDb
‪getDataWithTypeDb()
Definition: ContentObjectRendererTest.php:1676
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strPadDataProvider
‪array stdWrap_strPadDataProvider()
Definition: ContentObjectRendererTest.php:6976
‪TYPO3\CMS\Core\Core\Environment\getProjectPath
‪static string getProjectPath()
Definition: Environment.php:169
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_bytes
‪stdWrap_bytes(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:3647
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_numRows
‪stdWrap_numRows()
Definition: ContentObjectRendererTest.php:6016
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\registersAllDefaultContentObjectsDataProvider
‪string[][] registersAllDefaultContentObjectsDataProvider()
Definition: ContentObjectRendererTest.php:357
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calculateCacheKey
‪calculateCacheKey(string $expect, array $conf, int $times, $with, $withWrap, $will)
Definition: ContentObjectRendererTest.php:2855
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setCurrent
‪stdWrap_setCurrent(string $input, array $conf)
Definition: ContentObjectRendererTest.php:6827
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugPage
‪getDataWithTypeDebugPage()
Definition: ContentObjectRendererTest.php:1901
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGpDataProvider
‪array getDataWithTypeGpDataProvider()
Definition: ContentObjectRendererTest.php:1336
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLll
‪getDataWithTypeLll()
Definition: ContentObjectRendererTest.php:1692
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calculateCacheKeyDataProvider
‪array calculateCacheKeyDataProvider()
Definition: ContentObjectRendererTest.php:2795
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifNull
‪stdWrap_ifNull($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5510
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stripHtml
‪stdWrap_stripHtml()
Definition: ContentObjectRendererTest.php:7157
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_numberFormat
‪string stdWrap_numberFormat($content='', $conf=[])
Definition: ContentObjectRenderer.php:2298
‪TYPO3\CMS\Frontend\Exception
Definition: Exception.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGetenv
‪getDataWithTypeGetenv()
Definition: ContentObjectRendererTest.php:1381
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksFiles
‪typolinkReturnsCorrectLinksFiles($linkText, $configuration, $expectedResult)
Definition: ContentObjectRendererTest.php:2512
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifEmpty
‪stdWrap_ifEmpty($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5468
‪TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject
Definition: ScalableVectorGraphicsContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_requiredDataProvider
‪array stdWrap_requiredDataProvider()
Definition: ContentObjectRendererTest.php:6691
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editPanelDataProvider
‪array stdWrap_editPanelDataProvider()
Definition: ContentObjectRendererTest.php:4813
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifBlank
‪stdWrap_ifBlank($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5414
‪TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject
Definition: LoadRegisterContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap
‪stdWrap_innerWrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5564
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_langDataProvider
‪array stdWrap_langDataProvider()
Definition: ContentObjectRendererTest.php:5798
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugFullRootline
‪getDataWithTypeDebugFullRootline()
Definition: ContentObjectRendererTest.php:1839
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preUserFunc
‪stdWrap_preUserFunc()
Definition: ContentObjectRendererTest.php:6600
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_parseFunc
‪string stdWrap_parseFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:2164
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForEmailsAndUrlsDataProvider
‪array typolinkReturnsCorrectLinksForEmailsAndUrlsDataProvider()
Definition: ContentObjectRendererTest.php:2135
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject
Definition: CaseContentObjectTest.php:18
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrapDataProvider
‪array stdWrap_innerWrapDataProvider()
Definition: ContentObjectRendererTest.php:5521
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypePath
‪getDataWithTypePath()
Definition: ContentObjectRendererTest.php:1705
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editIcons
‪stdWrap_editIcons(string $expect, string $content, array $conf, bool $login, int $times, array $param3, string $will)
Definition: ContentObjectRendererTest.php:4627
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postUserFuncInt
‪stdWrap_postUserFuncInt()
Definition: ContentObjectRendererTest.php:6328
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postUserFunc
‪stdWrap_postUserFunc()
Definition: ContentObjectRendererTest.php:6289
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\substringDataProvider
‪array substringDataProvider()
Definition: ContentObjectRendererTest.php:1296
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSite
‪getDataWithTypeSite()
Definition: ContentObjectRendererTest.php:1734
‪TYPO3\CMS\Frontend\ContentObject\UserContentObject
Definition: UserContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\notAllStdWrapProcessorsAreCallableWithEmptyConfiguration
‪notAllStdWrapProcessorsAreCallableWithEmptyConfiguration()
Definition: ContentObjectRendererTest.php:3198
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_intval
‪stdWrap_intval(int $expect, $content)
Definition: ContentObjectRendererTest.php:5730
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prefixCommentDataProvider
‪array stdWrap_prefixCommentDataProvider()
Definition: ContentObjectRendererTest.php:6446
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$backupEnvironment
‪$backupEnvironment
Definition: ContentObjectRendererTest.php:128
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:35
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:32
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredLocally
‪renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredLocally()
Definition: ContentObjectRendererTest.php:1979
‪TYPO3\CMS\Core\Core\Environment\initialize
‪static initialize(ApplicationContext $context, bool $cli, bool $composerMode, string $projectPath, string $publicPath, string $varPath, string $configPath, string $currentScript, string $os)
Definition: Environment.php:104
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevel
‪getDataWithTypeLevel()
Definition: ContentObjectRendererTest.php:1513
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postCObject
‪string stdWrap_postCObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:2619
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editPanel
‪stdWrap_editPanel(string $expect, string $content, bool $login, int $times, string $will)
Definition: ContentObjectRendererTest.php:4856
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifEmptyDataProvider
‪array stdWrap_ifEmptyDataProvider()
Definition: ContentObjectRendererTest.php:5425
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strftimeDataProvider
‪array stdWrap_strftimeDataProvider()
Definition: ContentObjectRendererTest.php:7100
‪TYPO3\CMS\Core\Core\Environment\getBackendPath
‪static string getBackendPath()
Definition: Environment.php:250
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_noTrimWrapDataProvider
‪array stdWrap_noTrimWrapDataProvider()
Definition: ContentObjectRendererTest.php:5924
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_crop
‪stdWrap_crop()
Definition: ContentObjectRendererTest.php:4046
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\globalExceptionHandlerConfigurationCanBeOverriddenByLocalConfiguration
‪globalExceptionHandlerConfigurationCanBeOverriddenByLocalConfiguration()
Definition: ContentObjectRendererTest.php:2003
‪TYPO3\CMS\Frontend\ContentObject\ImageResourceContentObject
Definition: ImageResourceContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encodeForJavaScriptValueDataProvider
‪array[] stdWrap_encodeForJavaScriptValueDataProvider()
Definition: ContentObjectRendererTest.php:4889
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest
Definition: ContentObjectRendererTest.php:79
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calcAge
‪calcAge(string $expect, int $timestamp, string $labels)
Definition: ContentObjectRendererTest.php:1253
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prioriCalcDataProvider
‪array stdWrap_prioriCalcDataProvider()
Definition: ContentObjectRendererTest.php:6550
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_char
‪stdWrap_char()
Definition: ContentObjectRendererTest.php:4027
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_substring
‪string stdWrap_substring($content='', $conf=[])
Definition: ContentObjectRenderer.php:2419
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_field
‪string stdWrap_field($content='', $conf=[])
Definition: ContentObjectRenderer.php:1833
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugFunc
‪stdWrap_debugFunc(bool $expectArray, $confDebugFunc)
Definition: ContentObjectRendererTest.php:4440
‪TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject
Definition: EditPanelContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsExcludesGetParameters
‪getQueryArgumentsExcludesGetParameters()
Definition: ContentObjectRendererTest.php:411
‪TYPO3\CMS\Core\Utility\DebugUtility
Definition: DebugUtility.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugRegister
‪getDataWithTypeDebugRegister()
Definition: ContentObjectRendererTest.php:1881
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strPad
‪stdWrap_strPad(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:7088
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForEmailsAndUrls
‪typolinkReturnsCorrectLinksForEmailsAndUrls($linkText, $configuration, $expectedResult)
Definition: ContentObjectRendererTest.php:2244
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\replacement
‪replacement(string $expects, string $content, array $conf)
Definition: ContentObjectRendererTest.php:1180
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_orderedStdWrap
‪stdWrap_orderedStdWrap($firstConf, array $secondConf, array $conf)
Definition: ContentObjectRendererTest.php:3757
‪TYPO3\CMS\Core\Utility\DebugUtility\useAnsiColor
‪static useAnsiColor($ansiColorUsage)
Definition: DebugUtility.php:253
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_typolink
‪string stdWrap_typolink($content='', $conf=[])
Definition: ContentObjectRenderer.php:2652
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_dataWrap
‪string stdWrap_dataWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2730
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dataDataProvider
‪array stdWrap_dataDataProvider()
Definition: ContentObjectRendererTest.php:4196
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\caseshift
‪caseshift(string $expect, string $content, string $case)
Definition: ContentObjectRendererTest.php:3055
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject
Definition: ContentObjectArrayContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertDataProvider
‪array stdWrap_insertDataProvider()
Definition: ContentObjectRendererTest.php:5659
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_current
‪stdWrap_current()
Definition: ContentObjectRendererTest.php:4169
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_csConvDataProvider
‪array stdWrap_csConvDataProvider()
Definition: ContentObjectRendererTest.php:4105
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_append
‪stdWrap_append()
Definition: ContentObjectRendererTest.php:3467
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapReturnsExpectation
‪stdWrapReturnsExpectation(string $content, array $configuration, string $expectation)
Definition: ContentObjectRendererTest.php:1286
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject
Definition: CaseContentObject.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\prefixComment
‪prefixComment(string $expect, string $comment, string $content)
Definition: ContentObjectRendererTest.php:7690
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$frontendControllerMock
‪PHPUnit Framework MockObject MockObject TypoScriptFrontendController AccessibleObjectInterface $frontendControllerMock
Definition: ContentObjectRendererTest.php:91
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesMultiDimensionalForcedParameters
‪getQueryArgumentsOverrulesMultiDimensionalForcedParameters()
Definition: ContentObjectRendererTest.php:501
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_encapsLines
‪string stdWrap_encapsLines($content='', $conf=[])
Definition: ContentObjectRenderer.php:2553
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapAlign
‪stdWrap_wrapAlign(string $expect, string $content, $wrapAlignConf)
Definition: ContentObjectRendererTest.php:7584
‪TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject
Definition: FluidTemplateContentObject.php:31
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$subject
‪PHPUnit Framework MockObject MockObject AccessibleObjectInterface ContentObjectRenderer $subject
Definition: ContentObjectRendererTest.php:87
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrap
‪stdWrap_stdWrap()
Definition: ContentObjectRendererTest.php:6882
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_addPageCacheTagsAddsPageTags
‪stdWrap_addPageCacheTagsAddsPageTags(array $expectedTags, array $configuration)
Definition: ContentObjectRendererTest.php:3418
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setUserObjectType_getUserObjectType
‪setUserObjectType_getUserObjectType()
Definition: ContentObjectRendererTest.php:7735
‪TYPO3\CMS\Core\TypoScript\TemplateService
Definition: TemplateService.php:46
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\recursiveStdWrapIsOnlyCalledOnce
‪recursiveStdWrapIsOnlyCalledOnce()
Definition: ContentObjectRendererTest.php:1030
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_append
‪string stdWrap_append($content='', $conf=[])
Definition: ContentObjectRenderer.php:2756
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkReturnsOnlyLinkTextIfNoLinkResolvingIsPossible
‪typoLinkReturnsOnlyLinkTextIfNoLinkResolvingIsPossible()
Definition: ContentObjectRendererTest.php:2749
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFieldAndFieldIsMultiDimensional
‪getDataWithTypeFieldAndFieldIsMultiDimensional()
Definition: ContentObjectRendererTest.php:1421
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_crop
‪string stdWrap_crop($content='', $conf=[])
Definition: ContentObjectRenderer.php:2457
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:122
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_br
‪stdWrap_br($expected, $input, $xhtmlDoctype)
Definition: ContentObjectRendererTest.php:3529
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:92
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkOpensInNewWindow
‪typolinkOpensInNewWindow()
Definition: ContentObjectRendererTest.php:2712
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifBlankDataProvider
‪array stdWrap_ifBlankDataProvider()
Definition: ContentObjectRendererTest.php:5379
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editIconsDataProvider
‪array stdWrap_editIconsDataProvider()
Definition: ContentObjectRendererTest.php:4537
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesMultiDimensionalParameters
‪getQueryArgumentsOverrulesMultiDimensionalParameters()
Definition: ContentObjectRendererTest.php:459
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_listNum
‪stdWrap_listNum()
Definition: ContentObjectRendererTest.php:5892
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:98
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_typolink
‪stdWrap_typolink()
Definition: ContentObjectRendererTest.php:7339
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_orderedStdWrapDataProvider
‪array stdWrap_orderedStdWrapDataProvider()
Definition: ContentObjectRendererTest.php:3702
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevelmedia
‪getDataWithTypeLevelmedia()
Definition: ContentObjectRendererTest.php:1559
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheRead
‪stdWrap_cacheRead(string $expect, string $input, array $conf, int $times, $with, $will)
Definition: ContentObjectRendererTest.php:3837
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImgResourceCallsGetImgResourcePostProcessHook
‪getImgResourceCallsGetImgResourcePostProcessHook()
Definition: ContentObjectRendererTest.php:216
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapBrTagDataProvider
‪array stdWrapBrTagDataProvider()
Definition: ContentObjectRendererTest.php:3540
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_fieldRequired
‪stdWrap_fieldRequired(string $expect, bool $stop, string $content, array $conf)
Definition: ContentObjectRendererTest.php:5094
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifNullDataProvider
‪array stdWrap_ifNullDataProvider()
Definition: ContentObjectRendererTest.php:5479
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_expandListDataProvider
‪array stdWrap_expandListDataProvider()
Definition: ContentObjectRendererTest.php:4944
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugFuncDataProvider
‪array stdWrap_debugFuncDataProvider()
Definition: ContentObjectRendererTest.php:4410
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\fourTypesOfStdWrapHookObjectProcessors
‪fourTypesOfStdWrapHookObjectProcessors(string $stdWrapMethod, string $hookObjectCall)
Definition: ContentObjectRendererTest.php:3275
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_date
‪stdWrap_date(string $expected, $content, array $conf, int $now)
Definition: ContentObjectRendererTest.php:4331
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFromCacheDtataProvider
‪array getFromCacheDtataProvider()
Definition: ContentObjectRendererTest.php:2872
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_csConv
‪stdWrap_csConv(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:4150
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_bytesDataProvider
‪array stdWrap_bytesDataProvider()
Definition: ContentObjectRendererTest.php:3590
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cObject
‪string stdWrap_cObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:1861
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getCurrentTable
‪getCurrentTable()
Definition: ContentObjectRendererTest.php:7613
‪TYPO3\CMS\Core\Log\Logger
Definition: Logger.php:27
‪TYPO3\CMS\Core\Core\Environment\getConfigPath
‪static string getConfigPath()
Definition: Environment.php:210
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setCurrentFile_getCurrentFile
‪setCurrentFile_getCurrentFile()
Definition: ContentObjectRendererTest.php:7703
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:97
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_overrideDataProvider
‪array stdWrap_overrideDataProvider()
Definition: ContentObjectRendererTest.php:6126
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_htmlSpecialChars
‪stdWrap_htmlSpecialChars(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5216
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertDataAndInputExamples
‪stdWrap_insertDataAndInputExamples($expect, string $content)
Definition: ContentObjectRendererTest.php:5676
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\isGetImgResourceHookCalledCallback
‪array isGetImgResourceHookCalledCallback(string $file, array $fileArray, $imageResource, ContentObjectRenderer $parent)
Definition: ContentObjectRendererTest.php:252
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\HTMLcaseshift
‪HTMLcaseshift(string $expect, string $content, string $case, array $with, array $will)
Definition: ContentObjectRendererTest.php:3129
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debug
‪stdWrap_debug()
Definition: ContentObjectRendererTest.php:4345
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFullrootline
‪getDataWithTypeFullrootline()
Definition: ContentObjectRendererTest.php:1615
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
Definition: FrontendUserAuthentication.php:30
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dateDataProvider
‪array stdWrap_dateDataProvider()
Definition: ContentObjectRendererTest.php:4286
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeParameters
‪getDataWithTypeParameters()
Definition: ContentObjectRendererTest.php:1465
‪TYPO3\CMS\Frontend\ContentObject\TextContentObject
Definition: TextContentObject.php:22
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:52
‪TYPO3\CMS\Frontend\ContentObject\RecordsContentObject
Definition: RecordsContentObject.php:28
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHasLeadingSpaceIfNotEmpty
‪aTagParamsHasLeadingSpaceIfNotEmpty()
Definition: ContentObjectRendererTest.php:1918
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\willThrowAnExceptionForARegisteredNonContentObject
‪willThrowAnExceptionForARegisteredNonContentObject()
Definition: ContentObjectRendererTest.php:344
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsHandlesRemovedMethods
‪getQueryArgumentsHandlesRemovedMethods(string $method, string $expectedMessage, string $expectedResult)
Definition: ContentObjectRendererTest.php:577
‪TYPO3\CMS\Frontend\ContentObject\FilesContentObject
Definition: FilesContentObject.php:27
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrapValue
‪stdWrap_stdWrapValue(string $key, array $configuration, string $defaultValue, string $expected)
Definition: ContentObjectRendererTest.php:6961
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_outerWrap
‪stdWrap_outerWrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:6113
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapDataProvider
‪array stdWrap_wrapDataProvider()
Definition: ContentObjectRendererTest.php:7362
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_age
‪string stdWrap_age($content='', $conf=[])
Definition: ContentObjectRenderer.php:2379
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_numberFormat
‪stdWrap_numberFormat()
Definition: ContentObjectRendererTest.php:6044
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_age
‪stdWrap_age()
Definition: ContentObjectRendererTest.php:3436
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calcAgeDataProvider
‪array calcAgeDataProvider()
Definition: ContentObjectRendererTest.php:1193
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap2
‪stdWrap_wrap2(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7481
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap
‪stdWrap_wrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7415
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHasNoLeadingSpaceIfEmpty
‪aTagParamsHasNoLeadingSpaceIfEmpty()
Definition: ContentObjectRendererTest.php:1937
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectThrowsException
‪renderingContentObjectThrowsException()
Definition: ContentObjectRendererTest.php:1948
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cropHTML
‪string stdWrap_cropHTML($content='', $conf=[])
Definition: ContentObjectRenderer.php:2432
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayInternalContentObject
Definition: ContentObjectArrayInternalContentObject.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prioriCalc
‪stdWrap_prioriCalc($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:6581
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifDataProvider
‪array stdWrap_ifDataProvider()
Definition: ContentObjectRendererTest.php:5229
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:30
‪TYPO3\CMS\Core\Resource\Exception\InvalidPathException
Definition: InvalidPathException.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\fourTypesOfStdWrapHookObjectProcessorsDataProvider
‪array fourTypesOfStdWrapHookObjectProcessorsDataProvider()
Definition: ContentObjectRendererTest.php:3238
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFieldVal
‪getFieldVal($expect, string $fields)
Definition: ContentObjectRendererTest.php:3011
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_data
‪string stdWrap_data($content='', $conf=[])
Definition: ContentObjectRenderer.php:1817
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap3
‪stdWrap_wrap3(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7544
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugData
‪getDataWithTypeDebugData()
Definition: ContentObjectRendererTest.php:1861
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\checkIfDataProvider
‪array checkIfDataProvider()
Definition: ContentObjectRendererTest.php:5345
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preUserFunc
‪string stdWrap_preUserFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:1888
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cropHTML
‪stdWrap_cropHTML()
Definition: ContentObjectRendererTest.php:4079
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postUserFuncInt
‪string stdWrap_postUserFuncInt($content='', $conf=[])
Definition: ContentObjectRenderer.php:2843
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$cacheManager
‪Prophecy Prophecy ObjectProphecy CacheManager $cacheManager
Definition: ContentObjectRendererTest.php:126
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHaveSpaceBetweenLocalAndGlobalParams
‪aTagParamsHaveSpaceBetweenLocalAndGlobalParams()
Definition: ContentObjectRendererTest.php:1927
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_data
‪stdWrap_data(array $expect, array $data, $alt)
Definition: ContentObjectRendererTest.php:4229
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:38
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_splitObjReturnsCount
‪stdWrap_splitObjReturnsCount()
Definition: ContentObjectRendererTest.php:2776
‪TYPO3\CMS\Frontend\ContentObject\ContentContentObject
Definition: ContentContentObject.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_case
‪stdWrap_case()
Definition: ContentObjectRendererTest.php:4001
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForFilesWithAbsRefPrefixDataProvider
‪array typolinkReturnsCorrectLinksForFilesWithAbsRefPrefixDataProvider()
Definition: ContentObjectRendererTest.php:2544
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setCurrentVal_getCurrentVal
‪setCurrentVal_getCurrentVal()
Definition: ContentObjectRendererTest.php:7720
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\exceptionHandlerIsEnabledByDefaultInProductionContext
‪exceptionHandlerIsEnabledByDefaultInProductionContext()
Definition: ContentObjectRendererTest.php:1959
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\checkIf
‪bool checkIf($conf)
Definition: ContentObjectRenderer.php:3074
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_fieldRequired
‪string stdWrap_fieldRequired($content='', $conf=[])
Definition: ContentObjectRenderer.php:2127
‪TYPO3\CMS\Core\Core\Environment\getVarPath
‪static string getVarPath()
Definition: Environment.php:192
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\recursiveStdWrapProperlyRendersBasicString
‪recursiveStdWrapProperlyRendersBasicString()
Definition: ContentObjectRendererTest.php:1013
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postUserFunc
‪string stdWrap_postUserFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:2829