‪TYPO3CMS  9.5
ContentObjectRendererTest.php
Go to the documentation of this file.
1 <?php
2 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 
18 use PHPUnit\Framework\Exception;
19 use Prophecy\Argument;
20 use Psr\Http\Message\ServerRequestInterface;
23 use ‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as CacheFrontendInterface;
31 use TYPO3\CMS\Core\Package\PackageManager;
70 use TYPO3\TestingFramework\Core\AccessibleObjectInterface;
71 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
72 
76 class ‪ContentObjectRendererTest extends UnitTestCase
77 {
79 
83  protected ‪$resetSingletonInstances = true;
84 
88  protected ‪$subject;
89 
94 
98  protected ‪$templateServiceMock;
99 
105  protected ‪$contentObjectMap = [
106  'TEXT' => TextContentObject::class,
107  'CASE' => CaseContentObject::class,
108  'COBJ_ARRAY' => ContentObjectArrayContentObject::class,
109  'COA' => ContentObjectArrayContentObject::class,
110  'COA_INT' => ContentObjectArrayInternalContentObject::class,
111  'USER' => UserContentObject::class,
112  'USER_INT' => UserInternalContentObject::class,
113  'FILE' => FileContentObject::class,
114  'FILES' => FilesContentObject::class,
115  'IMAGE' => ImageContentObject::class,
116  'IMG_RESOURCE' => ImageResourceContentObject::class,
117  'CONTENT' => ContentContentObject::class,
118  'RECORDS' => RecordsContentObject::class,
119  'HMENU' => HierarchicalMenuContentObject::class,
120  'CASEFUNC' => CaseContentObject::class,
121  'LOAD_REGISTER' => LoadRegisterContentObject::class,
122  'RESTORE_REGISTER' => RestoreRegisterContentObject::class,
123  'TEMPLATE' => TemplateContentObject::class,
124  'FLUIDTEMPLATE' => FluidTemplateContentObject::class,
125  'SVG' => ScalableVectorGraphicsContentObject::class,
126  'EDITPANEL' => EditPanelContentObject::class
127  ];
128 
132  protected function ‪setUp(): void
133  {
134  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1534278180;
135  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
136  ->disableOriginalConstructor()
137  ->getMock();
138  $this->templateServiceMock =
139  $this->getMockBuilder(TemplateService::class)
140  ->setConstructorArgs([null, $packageManagerMock])
141  ->setMethods(['linkData'])
142  ->getMock();
143  $pageRepositoryMock =
144  $this->getAccessibleMock(PageRepository::class, ['getRawRecord', 'getMountPointInfo']);
145  $this->frontendControllerMock =
146  $this->getAccessibleMock(
147  TypoScriptFrontendController::class,
148  ['sL'],
149  [],
150  '',
151  false
152  );
153  $this->frontendControllerMock->_set('context', GeneralUtility::makeInstance(Context::class));
154  $this->frontendControllerMock->tmpl = ‪$this->templateServiceMock;
155  $this->frontendControllerMock->config = [];
156  $this->frontendControllerMock->page = [];
157  $this->frontendControllerMock->sys_page = $pageRepositoryMock;
159 
160  $this->subject = $this->getAccessibleMock(
161  ContentObjectRenderer::class,
162  ['getResourceFactory', 'getEnvironmentVariable'],
163  [$this->frontendControllerMock]
164  );
165 
166  $logger = $this->prophesize(Logger::class);
167  $this->subject->setLogger($logger->reveal());
168  $this->subject->setContentObjectClassMap($this->contentObjectMap);
169  $this->subject->start([], 'tt_content');
170  }
171 
173  // Utility functions
175 
180  {
181  return ‪$GLOBALS['TSFE'];
182  }
183 
190  protected function ‪handleCharset(string &‪$subject, string &$expected): void
191  {
192  ‪$subject = mb_convert_encoding(‪$subject, 'utf-8', 'iso-8859-1');
193  $expected = mb_convert_encoding($expected, 'utf-8', 'iso-8859-1');
194  }
195 
197  // Tests concerning the getImgResource hook
199 
203  {
204  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
205  $cacheProphecy = $this->prophesize(CacheFrontendInterface::class);
206  $cacheManagerProphecy->getCache('cache_imagesizes')->willReturn($cacheProphecy->reveal());
207  $cacheProphecy->get(Argument::cetera())->willReturn(false);
208  $cacheProphecy->set(Argument::cetera(), null)->willReturn(false);
209  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
210 
211  $resourceFactory = $this->createMock(ResourceFactory::class);
212  $this->subject->expects($this->any())->method('getResourceFactory')->will($this->returnValue($resourceFactory));
213 
214  $className = $this->getUniqueId('tx_coretest');
215  $getImgResourceHookMock = $this->getMockBuilder(ContentObjectGetImageResourceHookInterface::class)
216  ->setMethods(['getImgResourcePostProcess'])
217  ->setMockClassName($className)
218  ->getMock();
219  $getImgResourceHookMock
220  ->expects($this->once())
221  ->method('getImgResourcePostProcess')
222  ->will($this->returnCallback([$this, 'isGetImgResourceHookCalledCallback']));
223  $getImgResourceHookObjects = [$getImgResourceHookMock];
224  $this->subject->_setRef('getImgResourceHookObjects', $getImgResourceHookObjects);
225  $this->subject->getImgResource('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', []);
226  }
227 
239  string $file,
240  array $fileArray,
241  $imageResource,
242  ContentObjectRenderer $parent
243  ): array {
244  $this->assertEquals('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', $file);
245  $this->assertEquals('typo3/sysext/core/Tests/Unit/Utility/Fixtures/clear.gif', $imageResource['origFile']);
246  $this->assertTrue(is_array($fileArray));
247  $this->assertTrue($parent instanceof ContentObjectRenderer);
248  return $imageResource;
249  }
250 
252  // Tests related to getContentObject
254 
269  {
270  $className = TextContentObject::class;
271  $contentObjectName = 'TEST_TEXT';
272  $this->subject->registerContentObjectClass(
273  $className,
274  $contentObjectName
275  );
276  $object = $this->subject->getContentObject($contentObjectName);
277  $this->assertInstanceOf($className, $object);
278  }
279 
288  {
289  $className = TextContentObject::class;
290  $contentObjectName = 'TEST_TEXT';
291  $classMap = [$contentObjectName => $className];
292  $this->subject->setContentObjectClassMap($classMap);
293  $object = $this->subject->getContentObject($contentObjectName);
294  $this->assertInstanceOf($className, $object);
295  }
296 
306  {
307  $className = TextContentObject::class;
308  $contentObjectName = 'TEST_TEXT';
309  $classMap = [];
310  $this->subject->setContentObjectClassMap($classMap);
311  $classMap[$contentObjectName] = $className;
312  $object = $this->subject->getContentObject($contentObjectName);
313  $this->assertNull($object);
314  }
315 
320  public function ‪willReturnNullForUnregisteredObject(): void
321  {
322  $object = $this->subject->getContentObject('FOO');
323  $this->assertNull($object);
324  }
325 
331  {
332  $this->expectException(ContentRenderingException::class);
333  $this->subject->registerContentObjectClass(
334  \stdClass::class,
335  'STDCLASS'
336  );
337  $this->subject->getContentObject('STDCLASS');
338  }
339 
343  public function ‪registersAllDefaultContentObjectsDataProvider(): array
344  {
345  $dataProvider = [];
346  foreach ($this->contentObjectMap as $name => $className) {
347  $dataProvider[] = [$name, $className];
348  }
349  return $dataProvider;
350  }
351 
361  public function ‪registersAllDefaultContentObjects(
362  string $objectName,
363  string $className
364  ): void {
365  $this->assertTrue(
366  is_subclass_of($className, AbstractContentObject::class)
367  );
368  $object = $this->subject->getContentObject($objectName);
369  $this->assertInstanceOf($className, $object);
370  }
371 
373  // Tests concerning getQueryArguments()
375 
378  public function ‪getQueryArgumentsExcludesParameters(): void
379  {
380  $this->subject->expects($this->any())->method('getEnvironmentVariable')->with($this->equalTo('QUERY_STRING'))->will(
381  $this->returnValue('key1=value1&key2=value2&key3[key31]=value31&key3[key32][key321]=value321&key3[key32][key322]=value322')
382  );
383  $getQueryArgumentsConfiguration = [];
384  $getQueryArgumentsConfiguration['exclude'] = [];
385  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
386  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
387  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
388  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
389  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2&key3[key32][key322]=value322');
390  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
391  $this->assertEquals($expectedResult, $actualResult);
392  }
393 
397  public function ‪getQueryArgumentsExcludesGetParameters(): void
398  {
399  $_GET = [
400  'key1' => 'value1',
401  'key2' => 'value2',
402  'key3' => [
403  'key31' => 'value31',
404  'key32' => [
405  'key321' => 'value321',
406  'key322' => 'value322'
407  ]
408  ]
409  ];
410  $getQueryArgumentsConfiguration = [];
411  $getQueryArgumentsConfiguration['method'] = 'GET';
412  $getQueryArgumentsConfiguration['exclude'] = [];
413  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
414  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
415  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
416  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
417  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2&key3[key32][key322]=value322');
418  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
419  $this->assertEquals($expectedResult, $actualResult);
420  }
421 
425  public function ‪getQueryArgumentsOverrulesSingleParameter(): void
426  {
427  $this->subject->expects($this->any())->method('getEnvironmentVariable')->with($this->equalTo('QUERY_STRING'))->will(
428  $this->returnValue('key1=value1')
429  );
430  $getQueryArgumentsConfiguration = [];
431  $overruleArguments = [
432  // Should be overridden
433  'key1' => 'value1Overruled',
434  // Shouldn't be set: Parameter doesn't exist in source array and is not forced
435  'key2' => 'value2Overruled'
436  ];
437  $expectedResult = '&key1=value1Overruled';
438  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments);
439  $this->assertEquals($expectedResult, $actualResult);
440  }
441 
446  {
447  $_POST = [
448  'key1' => 'value1',
449  'key2' => 'value2',
450  'key3' => [
451  'key31' => 'value31',
452  'key32' => [
453  'key321' => 'value321',
454  'key322' => 'value322'
455  ]
456  ]
457  ];
458  $getQueryArgumentsConfiguration = [];
459  $getQueryArgumentsConfiguration['method'] = 'POST';
460  $getQueryArgumentsConfiguration['exclude'] = [];
461  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
462  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
463  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
464  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
465  $overruleArguments = [
466  // Should be overridden
467  'key2' => 'value2Overruled',
468  'key3' => [
469  'key32' => [
470  // Shouldn't be set: Parameter is excluded and not forced
471  'key321' => 'value321Overruled',
472  // Should be overridden: Parameter is not excluded
473  'key322' => 'value322Overruled',
474  // Shouldn't be set: Parameter doesn't exist in source array and is not forced
475  'key323' => 'value323Overruled'
476  ]
477  ]
478  ];
479  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key322]=value322Overruled');
480  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments);
481  $this->assertEquals($expectedResult, $actualResult);
482  }
483 
488  {
489  $this->subject->expects($this->any())->method('getEnvironmentVariable')->with($this->equalTo('QUERY_STRING'))->will(
490  $this->returnValue('key1=value1&key2=value2&key3[key31]=value31&key3[key32][key321]=value321&key3[key32][key322]=value322')
491  );
492  $_POST = [
493  'key1' => 'value1',
494  'key2' => 'value2',
495  'key3' => [
496  'key31' => 'value31',
497  'key32' => [
498  'key321' => 'value321',
499  'key322' => 'value322'
500  ]
501  ]
502  ];
503  $getQueryArgumentsConfiguration = [];
504  $getQueryArgumentsConfiguration['exclude'] = [];
505  $getQueryArgumentsConfiguration['exclude'][] = 'key1';
506  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
507  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
508  $getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key322]';
509  $getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
510  $overruleArguments = [
511  // Should be overridden
512  'key2' => 'value2Overruled',
513  'key3' => [
514  'key32' => [
515  // Should be set: Parameter is excluded but forced
516  'key321' => 'value321Overruled',
517  // Should be set: Parameter doesn't exist in source array but is forced
518  'key323' => 'value323Overruled'
519  ]
520  ]
521  ];
522  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key321]=value321Overruled&key3[key32][key323]=value323Overruled');
523  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, true);
524  $this->assertEquals($expectedResult, $actualResult);
525  $getQueryArgumentsConfiguration['method'] = 'POST';
526  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, true);
527  $this->assertEquals($expectedResult, $actualResult);
528  }
529 
534  {
535  $_POST = [
536  'key1' => 'POST1',
537  'key2' => 'POST2',
538  'key3' => [
539  'key31' => 'POST31',
540  'key32' => 'POST32',
541  'key33' => [
542  'key331' => 'POST331',
543  'key332' => 'POST332',
544  ]
545  ]
546  ];
547  $_GET = [
548  'key2' => 'GET2',
549  'key3' => [
550  'key32' => 'GET32',
551  'key33' => [
552  'key331' => 'GET331',
553  ]
554  ]
555  ];
556  $getQueryArgumentsConfiguration = [];
557  $getQueryArgumentsConfiguration['method'] = 'POST,GET';
558  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key1=POST1&key2=GET2&key3[key31]=POST31&key3[key32]=GET32&key3[key33][key331]=GET331&key3[key33][key332]=POST332');
559  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
560  $this->assertEquals($expectedResult, $actualResult);
561  }
562 
567  {
568  $_GET = [
569  'key1' => 'GET1',
570  'key2' => 'GET2',
571  'key3' => [
572  'key31' => 'GET31',
573  'key32' => 'GET32',
574  'key33' => [
575  'key331' => 'GET331',
576  'key332' => 'GET332',
577  ]
578  ]
579  ];
580  $_POST = [
581  'key2' => 'POST2',
582  'key3' => [
583  'key32' => 'POST32',
584  'key33' => [
585  'key331' => 'POST331',
586  ]
587  ]
588  ];
589  $getQueryArgumentsConfiguration = [];
590  $getQueryArgumentsConfiguration['method'] = 'GET,POST';
591  $expectedResult = $this->‪rawUrlEncodeSquareBracketsInUrl('&key1=GET1&key2=POST2&key3[key31]=GET31&key3[key32]=POST32&key3[key33][key331]=POST331&key3[key33][key332]=GET332');
592  $actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
593  $this->assertEquals($expectedResult, $actualResult);
594  }
595 
602  private function ‪rawUrlEncodeSquareBracketsInUrl(string $string): string
603  {
604  return str_replace(['[', ']'], ['%5B', '%5D'], $string);
605  }
606 
608  // Tests concerning crop
610 
613  public function ‪cropIsMultibyteSafe(): void
614  {
615  $this->assertEquals('бла', $this->subject->crop('бла', '3|...'));
616  }
617 
619 
621  // Tests concerning cropHTML
623 
631  public function ‪cropHTMLDataProvider(): array
632  {
633  $plainText = 'Kasper Sk' . chr(229) . 'rh' . chr(248)
634  . 'j implemented the original version of the crop function.';
635  $textWithMarkup = '<strong><a href="mailto:kasper@typo3.org">Kasper Sk'
636  . chr(229) . 'rh' . chr(248) . 'j</a> implemented</strong> the '
637  . 'original version of the crop function.';
638  $textWithEntities = 'Kasper Sk&aring;rh&oslash;j implemented the; '
639  . 'original ' . 'version of the crop function.';
640  $textWithLinebreaks = "Lorem ipsum dolor sit amet,\n"
641  . "consetetur sadipscing elitr,\n"
642  . 'sed diam nonumy eirmod tempor invidunt ut labore e'
643  . 't dolore magna aliquyam';
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  ];
898  }
899 
909  public function ‪cropHTML(string $expect, string $content, string $conf): void
910  {
911  $this->‪handleCharset($content, $expect);
912  $this->assertSame(
913  $expect,
914  $this->subject->cropHTML($content, $conf)
915  );
916  }
917 
923  public function ‪roundDataProvider(): array
924  {
925  return [
926  // floats
927  'down' => [1.0, 1.11, []],
928  'up' => [2.0, 1.51, []],
929  'rounds up from x.50' => [2.0, 1.50, []],
930  'down with decimals' => [0.12, 0.1231, ['decimals' => 2]],
931  'up with decimals' => [0.13, 0.1251, ['decimals' => 2]],
932  'ceil' => [1.0, 0.11, ['roundType' => 'ceil']],
933  'ceil does not accept decimals' => [
934  1.0,
935  0.111,
936  [
937  'roundType' => 'ceil',
938  'decimals' => 2,
939  ],
940  ],
941  'floor' => [2.0, 2.99, ['roundType' => 'floor']],
942  'floor does not accept decimals' => [
943  2.0,
944  2.999,
945  [
946  'roundType' => 'floor',
947  'decimals' => 2,
948  ],
949  ],
950  'round, down' => [1.0, 1.11, ['roundType' => 'round']],
951  'round, up' => [2.0, 1.55, ['roundType' => 'round']],
952  'round does accept decimals' => [
953  5.56,
954  5.5555,
955  [
956  'roundType' => 'round',
957  'decimals' => 2,
958  ],
959  ],
960  // strings
961  'emtpy string' => [0.0, '', []],
962  'word string' => [0.0, 'word', []],
963  'float string' => [1.0, '1.123456789', []],
964  // other types
965  'null' => [0.0, null, []],
966  'false' => [0.0, false, []],
967  'true' => [1.0, true, []]
968  ];
969  }
970 
988  public function ‪round(float $expect, $content, array $conf): void
989  {
990  $this->assertSame(
991  $expect,
992  $this->subject->_call('round', $content, $conf)
993  );
994  }
995 
999  public function ‪recursiveStdWrapProperlyRendersBasicString(): void
1000  {
1001  $stdWrapConfiguration = [
1002  'noTrimWrap' => '|| 123|',
1003  'stdWrap.' => [
1004  'wrap' => '<b>|</b>'
1005  ]
1006  ];
1007  $this->assertSame(
1008  '<b>Test</b> 123',
1009  $this->subject->stdWrap('Test', $stdWrapConfiguration)
1010  );
1011  }
1012 
1016  public function ‪recursiveStdWrapIsOnlyCalledOnce(): void
1017  {
1018  $stdWrapConfiguration = [
1019  'append' => 'TEXT',
1020  'append.' => [
1021  'data' => 'register:Counter'
1022  ],
1023  'stdWrap.' => [
1024  'append' => 'LOAD_REGISTER',
1025  'append.' => [
1026  'Counter.' => [
1027  'prioriCalc' => 'intval',
1028  'cObject' => 'TEXT',
1029  'cObject.' => [
1030  'data' => 'register:Counter',
1031  'wrap' => '|+1',
1032  ]
1033  ]
1034  ]
1035  ]
1036  ];
1037  $this->assertSame(
1038  'Counter:1',
1039  $this->subject->stdWrap('Counter:', $stdWrapConfiguration)
1040  );
1041  }
1048  public function ‪numberFormatDataProvider(): array
1049  {
1050  return [
1051  'testing decimals' => [
1052  '0.80',
1053  0.8,
1054  ['decimals' => 2]
1055  ],
1056  'testing decimals with input as string' => [
1057  '0.80',
1058  '0.8',
1059  ['decimals' => 2]
1060  ],
1061  'testing dec_point' => [
1062  '0,8',
1063  0.8,
1064  ['decimals' => 1, 'dec_point' => ',']
1065  ],
1066  'testing thousands_sep' => [
1067  '1.000',
1068  999.99,
1069  [
1070  'decimals' => 0,
1071  'thousands_sep.' => ['char' => 46]
1072  ]
1073  ],
1074  'testing mixture' => [
1075  '1.281.731,5',
1076  1281731.45,
1077  [
1078  'decimals' => 1,
1079  'dec_point.' => ['char' => 44],
1080  'thousands_sep.' => ['char' => 46]
1081  ]
1082  ]
1083  ];
1084  }
1085 
1095  public function ‪numberFormat(string $expects, $content, array $conf): void
1096  {
1097  $this->assertSame(
1098  $expects,
1099  $this->subject->numberFormat($content, $conf)
1100  );
1101  }
1108  public function ‪replacementDataProvider(): array
1109  {
1110  return [
1111  'multiple replacements, including regex' => [
1112  'There is an animal, an animal and an animal around the block! Yeah!',
1113  'There_is_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!',
1114  [
1115  '20.' => [
1116  'search' => '_',
1117  'replace.' => ['char' => '32']
1118  ],
1119  '120.' => [
1120  'search' => 'in da hood',
1121  'replace' => 'around the block'
1122  ],
1123  '130.' => [
1124  'search' => '#a (Cat|Dog|Tiger)#i',
1125  'replace' => 'an animal',
1126  'useRegExp' => '1'
1127  ]
1128  ]
1129  ],
1130  'replacement with optionSplit, normal pattern' => [
1131  'There1is2a3cat,3a3dog3and3a3tiger3in3da3hood!3Yeah!',
1132  'There_is_a_cat,_a_dog_and_a_tiger_in_da_hood!_Yeah!',
1133  [
1134  '10.' => [
1135  'search' => '_',
1136  'replace' => '1 || 2 || 3',
1137  'useOptionSplitReplace' => '1',
1138  'useRegExp' => '0'
1139  ]
1140  ]
1141  ],
1142  'replacement with optionSplit, using regex' => [
1143  'There is a tiny cat, a midsized dog and a big tiger in da hood! Yeah!',
1144  'There is a cat, a dog and a tiger in da hood! Yeah!',
1145  [
1146  '10.' => [
1147  'search' => '#(a) (Cat|Dog|Tiger)#i',
1148  'replace' => '${1} tiny ${2} || ${1} midsized ${2} || ${1} big ${2}',
1149  'useOptionSplitReplace' => '1',
1150  'useRegExp' => '1'
1151  ]
1152  ]
1153  ]
1154  ];
1155  }
1156 
1166  public function ‪replacement(string $expects, string $content, array $conf): void
1167  {
1168  $this->assertSame(
1169  $expects,
1170  $this->subject->_call('replacement', $content, $conf)
1171  );
1172  }
1179  public function ‪calcAgeDataProvider(): array
1180  {
1181  return [
1182  'minutes' => [
1183  '2 min',
1184  120,
1185  ' min| hrs| days| yrs',
1186  ],
1187  'hours' => [
1188  '2 hrs',
1189  7200,
1190  ' min| hrs| days| yrs',
1191  ],
1192  'days' => [
1193  '7 days',
1194  604800,
1195  ' min| hrs| days| yrs',
1196  ],
1197  'day with provided singular labels' => [
1198  '1 day',
1199  86400,
1200  ' min| hrs| days| yrs| min| hour| day| year',
1201  ],
1202  'years' => [
1203  '45 yrs',
1204  1417997800,
1205  ' min| hrs| days| yrs',
1206  ],
1207  'different labels' => [
1208  '2 Minutes',
1209  120,
1210  ' Minutes| Hrs| Days| Yrs',
1211  ],
1212  'negative values' => [
1213  '-7 days',
1214  -604800,
1215  ' min| hrs| days| yrs',
1216  ],
1217  'default label values for wrong label input' => [
1218  '2 min',
1219  121,
1220  10,
1221  ],
1222  'default singular label values for wrong label input' => [
1223  '1 year',
1224  31536000,
1225  10,
1226  ]
1227  ];
1228  }
1229 
1239  public function ‪calcAge(string $expect, int $timestamp, string $labels): void
1240  {
1241  $this->assertSame(
1242  $expect,
1243  $this->subject->calcAge($timestamp, $labels)
1244  );
1245  }
1246 
1250  public function ‪stdWrapReturnsExpectationDataProvider(): array
1251  {
1252  return [
1253  'Prevent silent bool conversion' => [
1254  '1+1',
1255  [
1256  'prioriCalc.' => [
1257  'wrap' => '|',
1258  ],
1259  ],
1260  '1+1',
1261  ],
1262  ];
1263  }
1264 
1272  public function ‪stdWrapReturnsExpectation(string $content, array $configuration, string $expectation): void
1273  {
1274  $this->assertSame($expectation, $this->subject->stdWrap($content, $configuration));
1275  }
1282  public function ‪substringDataProvider(): array
1283  {
1284  return [
1285  'sub -1' => ['g', 'substring', '-1'],
1286  'sub -1,0' => ['g', 'substring', '-1,0'],
1287  'sub -1,-1' => ['', 'substring', '-1,-1'],
1288  'sub -1,1' => ['g', 'substring', '-1,1'],
1289  'sub 0' => ['substring', 'substring', '0'],
1290  'sub 0,0' => ['substring', 'substring', '0,0'],
1291  'sub 0,-1' => ['substrin', 'substring', '0,-1'],
1292  'sub 0,1' => ['s', 'substring', '0,1'],
1293  'sub 1' => ['ubstring', 'substring', '1'],
1294  'sub 1,0' => ['ubstring', 'substring', '1,0'],
1295  'sub 1,-1' => ['ubstrin', 'substring', '1,-1'],
1296  'sub 1,1' => ['u', 'substring', '1,1'],
1297  'sub' => ['substring', 'substring', ''],
1298  ];
1299  }
1300 
1310  public function ‪substring(string $expect, string $content, string $conf): void
1311  {
1312  $this->assertSame($expect, $this->subject->substring($content, $conf));
1313  }
1314 
1316  // Tests concerning getData()
1318 
1322  public function ‪getDataWithTypeGpDataProvider(): array
1323  {
1324  return [
1325  'Value in get-data' => ['onlyInGet', 'GetValue'],
1326  'Value in post-data' => ['onlyInPost', 'PostValue'],
1327  'Value in post-data overriding get-data' => ['inGetAndPost', 'ValueInPost'],
1328  ];
1329  }
1330 
1339  public function ‪getDataWithTypeGp(string $key, string $expectedValue): void
1340  {
1341  $_GET = [
1342  'onlyInGet' => 'GetValue',
1343  'inGetAndPost' => 'ValueInGet',
1344  ];
1345  $_POST = [
1346  'onlyInPost' => 'PostValue',
1347  'inGetAndPost' => 'ValueInPost',
1348  ];
1349  $this->assertEquals($expectedValue, $this->subject->getData('gp:' . $key));
1350  }
1357  public function ‪getDataWithTypeTsfe(): void
1358  {
1359  $this->assertEquals(‪$GLOBALS['TSFE']->metaCharset, $this->subject->getData('tsfe:metaCharset'));
1360  }
1367  public function ‪getDataWithTypeGetenv(): void
1368  {
1369  $envName = $this->getUniqueId('frontendtest');
1370  $value = $this->getUniqueId('someValue');
1371  putenv($envName . '=' . $value);
1372  $this->assertEquals($value, $this->subject->getData('getenv:' . $envName));
1373  }
1380  public function ‪getDataWithTypeGetindpenv(): void
1381  {
1382  $this->subject->expects($this->once())->method('getEnvironmentVariable')
1383  ->with($this->equalTo('SCRIPT_FILENAME'))->will($this->returnValue('dummyPath'));
1384  $this->assertEquals('dummyPath', $this->subject->getData('getindpenv:SCRIPT_FILENAME'));
1385  }
1392  public function ‪getDataWithTypeField(): void
1393  {
1394  $key = 'someKey';
1395  $value = 'someValue';
1396  $field = [$key => $value];
1397 
1398  $this->assertEquals($value, $this->subject->getData('field:' . $key, $field));
1399  }
1400 
1408  {
1409  $key = 'somekey|level1|level2';
1410  $value = 'somevalue';
1411  $field = ['somekey' => ['level1' => ['level2' => 'somevalue']]];
1412 
1413  $this->assertEquals($value, $this->subject->getData('field:' . $key, $field));
1414  }
1421  public function ‪getDataWithTypeFileReturnsUidOfFileObject(): void
1422  {
1423  $uid = $this->getUniqueId();
1424  $file = $this->createMock(File::class);
1425  $file->expects($this->once())->method('getUid')->will($this->returnValue($uid));
1426  $this->subject->setCurrentFile($file);
1427  $this->assertEquals($uid, $this->subject->getData('file:current:uid'));
1428  }
1435  public function ‪getDataWithTypeParameters(): void
1436  {
1437  $key = $this->getUniqueId('someKey');
1438  $value = $this->getUniqueId('someValue');
1439  $this->subject->parameters[$key] = $value;
1440 
1441  $this->assertEquals($value, $this->subject->getData('parameters:' . $key));
1442  }
1449  public function ‪getDataWithTypeRegister(): void
1450  {
1451  $key = $this->getUniqueId('someKey');
1452  $value = $this->getUniqueId('someValue');
1453  ‪$GLOBALS['TSFE']->register[$key] = $value;
1454 
1455  $this->assertEquals($value, $this->subject->getData('register:' . $key));
1456  }
1463  public function ‪getDataWithTypeSession(): void
1464  {
1465  $frontendUser = $this->getMockBuilder(FrontendUserAuthentication::class)
1466  ->setMethods(['getSessionData'])
1467  ->getMock();
1468  $frontendUser->expects($this->once())->method('getSessionData')->with('myext')->willReturn([
1469  'mydata' => [
1470  'someValue' => 42,
1471  ],
1472  ]);
1473  ‪$GLOBALS['TSFE']->fe_user = $frontendUser;
1474 
1475  $this->assertEquals(42, $this->subject->getData('session:myext|mydata|someValue'));
1476  }
1483  public function ‪getDataWithTypeLevel(): void
1484  {
1485  $rootline = [
1486  0 => ['uid' => 1, 'title' => 'title1'],
1487  1 => ['uid' => 2, 'title' => 'title2'],
1488  2 => ['uid' => 3, 'title' => 'title3'],
1489  ];
1490 
1491  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1492  $this->assertEquals(2, $this->subject->getData('level'));
1493  }
1500  public function ‪getDataWithTypeGlobal(): void
1501  {
1502  $this->assertEquals(‪$GLOBALS['TSFE']->metaCharset, $this->subject->getData('global:TSFE|metaCharset'));
1503  }
1510  public function ‪getDataWithTypeLeveltitle(): void
1511  {
1512  $rootline = [
1513  0 => ['uid' => 1, 'title' => 'title1'],
1514  1 => ['uid' => 2, 'title' => 'title2'],
1515  2 => ['uid' => 3, 'title' => ''],
1516  ];
1517 
1518  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1519  $this->assertEquals('', $this->subject->getData('leveltitle:-1'));
1520  // since "title3" is not set, it will slide to "title2"
1521  $this->assertEquals('title2', $this->subject->getData('leveltitle:-1,slide'));
1522  }
1529  public function ‪getDataWithTypeLevelmedia(): void
1530  {
1531  $rootline = [
1532  0 => ['uid' => 1, 'title' => 'title1', 'media' => 'media1'],
1533  1 => ['uid' => 2, 'title' => 'title2', 'media' => 'media2'],
1534  2 => ['uid' => 3, 'title' => 'title3', 'media' => ''],
1535  ];
1536 
1537  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1538  $this->assertEquals('', $this->subject->getData('levelmedia:-1'));
1539  // since "title3" is not set, it will slide to "title2"
1540  $this->assertEquals('media2', $this->subject->getData('levelmedia:-1,slide'));
1541  }
1548  public function ‪getDataWithTypeLeveluid(): void
1549  {
1550  $rootline = [
1551  0 => ['uid' => 1, 'title' => 'title1'],
1552  1 => ['uid' => 2, 'title' => 'title2'],
1553  2 => ['uid' => 3, 'title' => 'title3'],
1554  ];
1555 
1556  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1557  $this->assertEquals(3, $this->subject->getData('leveluid:-1'));
1558  // every element will have a uid - so adding slide doesn't really make sense, just for completeness
1559  $this->assertEquals(3, $this->subject->getData('leveluid:-1,slide'));
1560  }
1567  public function ‪getDataWithTypeLevelfield(): void
1568  {
1569  $rootline = [
1570  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1571  1 => ['uid' => 2, 'title' => 'title2', 'testfield' => 'field2'],
1572  2 => ['uid' => 3, 'title' => 'title3', 'testfield' => ''],
1573  ];
1574 
1575  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1576  $this->assertEquals('', $this->subject->getData('levelfield:-1,testfield'));
1577  $this->assertEquals('field2', $this->subject->getData('levelfield:-1,testfield,slide'));
1578  }
1585  public function ‪getDataWithTypeFullrootline(): void
1586  {
1587  $rootline1 = [
1588  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1589  ];
1590  $rootline2 = [
1591  0 => ['uid' => 1, 'title' => 'title1', 'testfield' => 'field1'],
1592  1 => ['uid' => 2, 'title' => 'title2', 'testfield' => 'field2'],
1593  2 => ['uid' => 3, 'title' => 'title3', 'testfield' => 'field3'],
1594  ];
1595 
1596  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline1;
1597  ‪$GLOBALS['TSFE']->rootLine = $rootline2;
1598  $this->assertEquals('field2', $this->subject->getData('fullrootline:-1,testfield'));
1599  }
1606  public function ‪getDataWithTypeDate(): void
1607  {
1608  $format = 'Y-M-D';
1609  $defaultFormat = 'd/m Y';
1610 
1611  $this->assertEquals(date($format, ‪$GLOBALS['EXEC_TIME']), $this->subject->getData('date:' . $format));
1612  $this->assertEquals(date($defaultFormat, ‪$GLOBALS['EXEC_TIME']), $this->subject->getData('date'));
1613  }
1620  public function ‪getDataWithTypePage(): void
1621  {
1622  $uid = mt_rand();
1623  ‪$GLOBALS['TSFE']->page['uid'] = $uid;
1624  $this->assertEquals($uid, $this->subject->getData('page:uid'));
1625  }
1632  public function ‪getDataWithTypeCurrent(): void
1633  {
1634  $key = $this->getUniqueId('someKey');
1635  $value = $this->getUniqueId('someValue');
1636  $this->subject->data[$key] = $value;
1637  $this->subject->currentValKey = $key;
1638  $this->assertEquals($value, $this->subject->getData('current'));
1639  }
1646  public function ‪getDataWithTypeDb(): void
1647  {
1648  $dummyRecord = ['uid' => 5, 'title' => 'someTitle'];
1649 
1650  ‪$GLOBALS['TSFE']->sys_page->expects($this->atLeastOnce())->method('getRawRecord')->with(
1651  'tt_content',
1652  '106'
1653  )->will($this->returnValue($dummyRecord));
1654  $this->assertEquals($dummyRecord['title'], $this->subject->getData('db:tt_content:106:title'));
1655  }
1662  public function ‪getDataWithTypeLll(): void
1663  {
1664  $key = $this->getUniqueId('someKey');
1665  $value = $this->getUniqueId('someValue');
1666  ‪$GLOBALS['TSFE']->expects($this->once())->method('sL')->with('LLL:' . $key)->will($this->returnValue($value));
1667  $this->assertEquals($value, $this->subject->getData('lll:' . $key));
1668  }
1675  public function ‪getDataWithTypePath(): void
1676  {
1677  $filenameIn = 'typo3/sysext/frontend/Public/Icons/Extension.svg';
1678  $this->assertEquals($filenameIn, $this->subject->getData('path:' . $filenameIn));
1679  }
1686  public function ‪getDataWithTypeContext(): void
1687  {
1688  $context = new ‪Context([
1689  'workspace' => new ‪WorkspaceAspect(3),
1690  'frontend.user' => new ‪UserAspect(new ‪FrontendUserAuthentication(), [0, -1])
1691  ]);
1692  GeneralUtility::setSingletonInstance(Context::class, $context);
1693  $this->assertEquals(3, $this->subject->getData('context:workspace:id'));
1694  $this->assertEquals('0,-1', $this->subject->getData('context:frontend.user:groupIds'));
1695  $this->assertEquals(false, $this->subject->getData('context:frontend.user:isLoggedIn'));
1696  $this->assertEquals(false, $this->subject->getData('context:frontend.user:foozball'));
1697  }
1704  public function ‪getDataWithTypeSite(): void
1705  {
1706  $site = new ‪Site('my-site', 123, [
1707  'base' => 'http://example.com',
1708  'custom' => [
1709  'config' => [
1710  'nested' => 'yeah'
1711  ]
1712  ]
1713  ]);
1714  $serverRequest = $this->prophesize(ServerRequestInterface::class);
1715  $serverRequest->getAttribute('site')->willReturn($site);
1716  ‪$GLOBALS['TYPO3_REQUEST'] = $serverRequest->reveal();
1717  $this->assertEquals('http://example.com', $this->subject->getData('site:base'));
1718  $this->assertEquals('yeah', $this->subject->getData('site:custom.config.nested'));
1719  }
1726  public function ‪getDataWithTypeSiteWithBaseVariants(): void
1727  {
1728  $cacheManagerProphecy = $this->prophesize(CacheManager::class);
1729  $cacheProphecy = $this->prophesize(CacheFrontendInterface::class);
1730  $cacheManagerProphecy->getCache('cache_core')->willReturn($cacheProphecy->reveal());
1731  GeneralUtility::setSingletonInstance(CacheManager::class, $cacheManagerProphecy->reveal());
1732  putenv('LOCAL_DEVELOPMENT=1');
1733 
1734  $site = new ‪Site('my-site', 123, [
1735  'base' => 'http://prod.com',
1736  'baseVariants' => [
1737  [
1738  'base' => 'http://staging.com',
1739  'condition' => 'applicationContext == "Production/Staging"'
1740  ],
1741  [
1742  'base' => 'http://dev.com',
1743  'condition' => 'getenv("LOCAL_DEVELOPMENT") == 1'
1744  ],
1745  ]
1746  ]);
1747 
1748  $serverRequest = $this->prophesize(ServerRequestInterface::class);
1749  $serverRequest->getAttribute('site')->willReturn($site);
1750  ‪$GLOBALS['TYPO3_REQUEST'] = $serverRequest->reveal();
1751  $this->assertEquals('http://dev.com', $this->subject->getData('site:base'));
1752  }
1759  public function ‪getDataWithTypeSiteLanguage(): void
1760  {
1761  $site = $this->‪createSiteWithLanguage([
1762  'base' => '/',
1763  'languageId' => 1,
1764  'locale' => 'de_DE',
1765  'title' => 'languageTitle',
1766  'navigationTitle' => 'German'
1767  ]);
1768  $language = $site->getLanguageById(1);
1769  $serverRequest = $this->prophesize(ServerRequestInterface::class);
1770  $serverRequest->getAttribute('language')->willReturn($language);
1771  ‪$GLOBALS['TYPO3_REQUEST'] = $serverRequest->reveal();
1772  $this->assertEquals('German', $this->subject->getData('siteLanguage:navigationTitle'));
1773  }
1780  public function ‪getDataWithTypeParentRecordNumber(): void
1781  {
1782  $recordNumber = mt_rand();
1783  $this->subject->parentRecordNumber = $recordNumber;
1784  $this->assertEquals($recordNumber, $this->subject->getData('cobj:parentRecordNumber'));
1785  }
1792  public function ‪getDataWithTypeDebugRootline(): void
1793  {
1794  $rootline = [
1795  0 => ['uid' => 1, 'title' => 'title1'],
1796  1 => ['uid' => 2, 'title' => 'title2'],
1797  2 => ['uid' => 3, 'title' => ''],
1798  ];
1799  $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)';
1800  ‪$GLOBALS['TSFE']->tmpl->rootLine = $rootline;
1801 
1803  $result = $this->subject->getData('debug:rootLine');
1804  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1805 
1806  $this->assertEquals($expectedResult, $cleanedResult);
1807  }
1814  public function ‪getDataWithTypeDebugFullRootline(): void
1815  {
1816  $rootline = [
1817  0 => ['uid' => 1, 'title' => 'title1'],
1818  1 => ['uid' => 2, 'title' => 'title2'],
1819  2 => ['uid' => 3, 'title' => ''],
1820  ];
1821  $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)';
1822  ‪$GLOBALS['TSFE']->rootLine = $rootline;
1823 
1825  $result = $this->subject->getData('debug:fullRootLine');
1826  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1827 
1828  $this->assertEquals($expectedResult, $cleanedResult);
1829  }
1836  public function ‪getDataWithTypeDebugData(): void
1837  {
1838  $key = $this->getUniqueId('someKey');
1839  $value = $this->getUniqueId('someValue');
1840  $this->subject->data = [$key => $value];
1841 
1842  $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
1843 
1845  $result = $this->subject->getData('debug:data');
1846  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1847 
1848  $this->assertEquals($expectedResult, $cleanedResult);
1849  }
1856  public function ‪getDataWithTypeDebugRegister(): void
1857  {
1858  $key = $this->getUniqueId('someKey');
1859  $value = $this->getUniqueId('someValue');
1860  ‪$GLOBALS['TSFE']->register = [$key => $value];
1861 
1862  $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
1863 
1865  $result = $this->subject->getData('debug:register');
1866  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1867 
1868  $this->assertEquals($expectedResult, $cleanedResult);
1869  }
1876  public function ‪getDataWithTypeDebugPage(): void
1877  {
1878  $uid = mt_rand();
1879  ‪$GLOBALS['TSFE']->page = ['uid' => $uid];
1880 
1881  $expectedResult = 'array(1item)uid=>' . $uid . '(integer)';
1882 
1884  $result = $this->subject->getData('debug:page');
1885  $cleanedResult = str_replace(["\r", "\n", "\t", ' '], '', $result);
1886 
1887  $this->assertEquals($expectedResult, $cleanedResult);
1888  }
1889 
1893  public function ‪aTagParamsHasLeadingSpaceIfNotEmpty(): void
1894  {
1895  $aTagParams = $this->subject->getATagParams(['ATagParams' => 'data-test="testdata"']);
1896  $this->assertEquals(' data-test="testdata"', $aTagParams);
1897  }
1898 
1903  {
1904  ‪$GLOBALS['TSFE']->ATagParams = 'data-global="dataglobal"';
1905  $aTagParams = $this->subject->getATagParams(['ATagParams' => 'data-test="testdata"']);
1906  $this->assertEquals(' data-global="dataglobal" data-test="testdata"', $aTagParams);
1907  }
1908 
1912  public function ‪aTagParamsHasNoLeadingSpaceIfEmpty(): void
1913  {
1914  // make sure global ATagParams are empty
1915  ‪$GLOBALS['TSFE']->ATagParams = '';
1916  $aTagParams = $this->subject->getATagParams(['ATagParams' => '']);
1917  $this->assertEquals('', $aTagParams);
1918  }
1919 
1924  {
1925  return [
1926  [null, null],
1927  ['', null],
1928  ['', []],
1929  ['fooo', ['foo' => 'bar']]
1930  ];
1931  }
1932 
1941  public function ‪getImageTagTemplateFallsBackToDefaultTemplateIfNoTemplateIsFound($key, $configuration): void
1942  {
1943  $defaultImgTagTemplate = '<img src="###SRC###" width="###WIDTH###" height="###HEIGHT###" ###PARAMS### ###ALTPARAMS### ###BORDER######SELFCLOSINGTAGSLASH###>';
1944  $result = $this->subject->getImageTagTemplate($key, $configuration);
1945  $this->assertEquals($result, $defaultImgTagTemplate);
1946  }
1947 
1952  {
1953  return [
1954  [
1955  'foo',
1956  [
1957  'layout.' => [
1958  'foo.' => [
1959  'element' => '<img src="###SRC###" srcset="###SOURCES###" ###PARAMS### ###ALTPARAMS### ###FOOBAR######SELFCLOSINGTAGSLASH###>'
1960  ]
1961  ]
1962  ],
1963  '<img src="###SRC###" srcset="###SOURCES###" ###PARAMS### ###ALTPARAMS### ###FOOBAR######SELFCLOSINGTAGSLASH###>'
1964  ]
1965 
1966  ];
1967  }
1968 
1978  public function ‪getImageTagTemplateReturnTemplateElementIdentifiedByKey($key, $configuration, $expectation): void
1979  {
1980  $result = $this->subject->getImageTagTemplate($key, $configuration);
1981  $this->assertEquals($result, $expectation);
1982  }
1983 
1988  {
1989  return [
1990  [null, null, null],
1991  ['foo', null, null],
1992  ['foo', ['sourceCollection.' => 1], 'bar']
1993  ];
1994  }
1995 
2006  $layoutKey,
2007  $configuration,
2008  $file
2009  ): void {
2010  $result = $this->subject->getImageSourceCollection($layoutKey, $configuration, $file);
2011  $this->assertSame($result, '');
2012  }
2019  public function ‪getImageSourceCollectionRendersDefinedSources(): void
2020  {
2022  $cObj = $this->getMockBuilder(ContentObjectRenderer::class)
2023  ->setMethods(['stdWrap', 'getImgResource'])
2024  ->getMock();
2025 
2026  $cObj->start([], 'tt_content');
2027 
2028  $layoutKey = 'test';
2029 
2030  $configuration = [
2031  'layoutKey' => 'test',
2032  'layout.' => [
2033  'test.' => [
2034  'element' => '<img ###SRC### ###SRCCOLLECTION### ###SELFCLOSINGTAGSLASH###>',
2035  'source' => '---###SRC###---'
2036  ]
2037  ],
2038  'sourceCollection.' => [
2039  '1.' => [
2040  'width' => '200'
2041  ]
2042  ]
2043  ];
2044 
2045  $file = 'testImageName';
2046 
2047  // Avoid calling of stdWrap
2048  $cObj
2049  ->expects($this->any())
2050  ->method('stdWrap')
2051  ->will($this->returnArgument(0));
2052 
2053  // Avoid calling of imgResource
2054  $cObj
2055  ->expects($this->exactly(1))
2056  ->method('getImgResource')
2057  ->with($this->equalTo('testImageName'))
2058  ->will($this->returnValue([100, 100, null, 'bar']));
2059 
2060  $result = $cObj->getImageSourceCollection($layoutKey, $configuration, $file);
2061 
2062  $this->assertEquals('---bar---', $result);
2063  }
2064 
2072  {
2073  $sourceCollectionArray = [
2074  'small.' => [
2075  'width' => 200,
2076  'srcsetCandidate' => '600w',
2077  'mediaQuery' => '(max-device-width: 600px)',
2078  'dataKey' => 'small',
2079  ],
2080  'smallRetina.' => [
2081  'if.directReturn' => 0,
2082  'width' => 200,
2083  'pixelDensity' => '2',
2084  'srcsetCandidate' => '600w 2x',
2085  'mediaQuery' => '(max-device-width: 600px) AND (min-resolution: 192dpi)',
2086  'dataKey' => 'smallRetina',
2087  ]
2088  ];
2089  return [
2090  [
2091  'default',
2092  [
2093  'layoutKey' => 'default',
2094  'layout.' => [
2095  'default.' => [
2096  'element' => '<img src="###SRC###" width="###WIDTH###" height="###HEIGHT###" ###PARAMS### ###ALTPARAMS### ###BORDER######SELFCLOSINGTAGSLASH###>',
2097  'source' => ''
2098  ]
2099  ],
2100  'sourceCollection.' => $sourceCollectionArray
2101  ]
2102  ],
2103  ];
2104  }
2105 
2114  public function ‪getImageSourceCollectionRendersDefinedLayoutKeyDefault($layoutKey, $configuration): void
2115  {
2117  $cObj = $this->getMockBuilder(ContentObjectRenderer::class)
2118  ->setMethods(['stdWrap', 'getImgResource'])
2119  ->getMock();
2120 
2121  $cObj->start([], 'tt_content');
2122 
2123  $file = 'testImageName';
2124 
2125  // Avoid calling of stdWrap
2126  $cObj
2127  ->expects($this->any())
2128  ->method('stdWrap')
2129  ->will($this->returnArgument(0));
2130 
2131  $result = $cObj->getImageSourceCollection($layoutKey, $configuration, $file);
2132 
2133  $this->assertEmpty($result);
2134  }
2135 
2143  {
2144  $sourceCollectionArray = [
2145  'small.' => [
2146  'width' => 200,
2147  'srcsetCandidate' => '600w',
2148  'mediaQuery' => '(max-device-width: 600px)',
2149  'dataKey' => 'small',
2150  ],
2151  'smallRetina.' => [
2152  'if.directReturn' => 1,
2153  'width' => 200,
2154  'pixelDensity' => '2',
2155  'srcsetCandidate' => '600w 2x',
2156  'mediaQuery' => '(max-device-width: 600px) AND (min-resolution: 192dpi)',
2157  'dataKey' => 'smallRetina',
2158  ]
2159  ];
2160  return [
2161  [
2162  'srcset',
2163  [
2164  'layoutKey' => 'srcset',
2165  'layout.' => [
2166  'srcset.' => [
2167  'element' => '<img src="###SRC###" srcset="###SOURCECOLLECTION###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>',
2168  'source' => '|*|###SRC### ###SRCSETCANDIDATE###,|*|###SRC### ###SRCSETCANDIDATE###'
2169  ]
2170  ],
2171  'sourceCollection.' => $sourceCollectionArray
2172  ],
2173  'xhtml_strict',
2174  'bar-file.jpg 600w,bar-file.jpg 600w 2x',
2175  ],
2176  [
2177  'picture',
2178  [
2179  'layoutKey' => 'picture',
2180  'layout.' => [
2181  'picture.' => [
2182  'element' => '<picture>###SOURCECOLLECTION###<img src="###SRC###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###></picture>',
2183  'source' => '<source src="###SRC###" media="###MEDIAQUERY###"###SELFCLOSINGTAGSLASH###>'
2184  ]
2185  ],
2186  'sourceCollection.' => $sourceCollectionArray,
2187  ],
2188  'xhtml_strict',
2189  '<source src="bar-file.jpg" media="(max-device-width: 600px)" /><source src="bar-file.jpg" media="(max-device-width: 600px) AND (min-resolution: 192dpi)" />',
2190  ],
2191  [
2192  'picture',
2193  [
2194  'layoutKey' => 'picture',
2195  'layout.' => [
2196  'picture.' => [
2197  'element' => '<picture>###SOURCECOLLECTION###<img src="###SRC###" ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###></picture>',
2198  'source' => '<source src="###SRC###" media="###MEDIAQUERY###"###SELFCLOSINGTAGSLASH###>'
2199  ]
2200  ],
2201  'sourceCollection.' => $sourceCollectionArray,
2202  ],
2203  '',
2204  '<source src="bar-file.jpg" media="(max-device-width: 600px)"><source src="bar-file.jpg" media="(max-device-width: 600px) AND (min-resolution: 192dpi)">',
2205  ],
2206  [
2207  'data',
2208  [
2209  'layoutKey' => 'data',
2210  'layout.' => [
2211  'data.' => [
2212  'element' => '<img src="###SRC###" ###SOURCECOLLECTION### ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>',
2213  'source' => 'data-###DATAKEY###="###SRC###"'
2214  ]
2215  ],
2216  'sourceCollection.' => $sourceCollectionArray
2217  ],
2218  'xhtml_strict',
2219  'data-small="bar-file.jpg"data-smallRetina="bar-file.jpg"',
2220  ],
2221  ];
2222  }
2223 
2235  $layoutKey,
2236  $configuration,
2237  $xhtmlDoctype,
2238  $expectedHtml
2239  ): void {
2241  $cObj = $this->getMockBuilder(ContentObjectRenderer::class)
2242  ->setMethods(['stdWrap', 'getImgResource'])
2243  ->getMock();
2244 
2245  $cObj->start([], 'tt_content');
2246 
2247  $file = 'testImageName';
2248 
2249  ‪$GLOBALS['TSFE']->xhtmlDoctype = $xhtmlDoctype;
2250 
2251  // Avoid calling of stdWrap
2252  $cObj
2253  ->expects($this->any())
2254  ->method('stdWrap')
2255  ->will($this->returnArgument(0));
2256 
2257  // Avoid calling of imgResource
2258  $cObj
2259  ->expects($this->exactly(2))
2260  ->method('getImgResource')
2261  ->with($this->equalTo('testImageName'))
2262  ->will($this->returnValue([100, 100, null, 'bar-file.jpg']));
2263 
2264  $result = $cObj->getImageSourceCollection($layoutKey, $configuration, $file);
2265 
2266  $this->assertEquals($expectedHtml, $result);
2267  }
2274  public function ‪getImageSourceCollectionHookCalled(): void
2275  {
2276  $this->subject = $this->getAccessibleMock(
2277  ContentObjectRenderer::class,
2278  ['getResourceFactory', 'stdWrap', 'getImgResource']
2279  );
2280  $this->subject->start([], 'tt_content');
2281 
2282  // Avoid calling stdwrap and getImgResource
2283  $this->subject->expects($this->any())
2284  ->method('stdWrap')
2285  ->will($this->returnArgument(0));
2286 
2287  $this->subject->expects($this->any())
2288  ->method('getImgResource')
2289  ->will($this->returnValue([100, 100, null, 'bar-file.jpg']));
2290 
2291  $resourceFactory = $this->createMock(ResourceFactory::class);
2292  $this->subject->expects($this->any())->method('getResourceFactory')->will($this->returnValue($resourceFactory));
2293 
2294  $className = $this->getUniqueId('tx_coretest_getImageSourceCollectionHookCalled');
2295  $getImageSourceCollectionHookMock = $this->getMockBuilder(
2296  ContentObjectOneSourceCollectionHookInterface::class
2297  )
2298  ->setMethods(['getOneSourceCollection'])
2299  ->setMockClassName($className)
2300  ->getMock();
2301  GeneralUtility::addInstance($className, $getImageSourceCollectionHookMock);
2302  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'][] = $className;
2303 
2304  $getImageSourceCollectionHookMock
2305  ->expects($this->exactly(1))
2306  ->method('getOneSourceCollection')
2307  ->will($this->returnCallback([$this, 'isGetOneSourceCollectionCalledCallback']));
2308 
2309  $configuration = [
2310  'layoutKey' => 'data',
2311  'layout.' => [
2312  'data.' => [
2313  'element' => '<img src="###SRC###" ###SOURCECOLLECTION### ###PARAMS### ###ALTPARAMS######SELFCLOSINGTAGSLASH###>',
2314  'source' => 'data-###DATAKEY###="###SRC###"'
2315  ]
2316  ],
2317  'sourceCollection.' => [
2318  'small.' => [
2319  'width' => 200,
2320  'srcsetCandidate' => '600w',
2321  'mediaQuery' => '(max-device-width: 600px)',
2322  'dataKey' => 'small',
2323  ],
2324  ],
2325  ];
2326 
2327  $result = $this->subject->getImageSourceCollection('data', $configuration, $this->getUniqueId('testImage-'));
2328 
2329  $this->assertSame($result, 'isGetOneSourceCollectionCalledCallback');
2330  }
2331 
2343  array $sourceRenderConfiguration,
2344  array $sourceConfiguration,
2345  $oneSourceCollection,
2346  $parent
2347  ): string {
2348  $this->assertTrue(is_array($sourceRenderConfiguration));
2349  $this->assertTrue(is_array($sourceConfiguration));
2350  return 'isGetOneSourceCollectionCalledCallback';
2351  }
2352 
2356  public function ‪renderingContentObjectThrowsException(): void
2357  {
2358  $this->expectException(\LogicException::class);
2359  $this->expectExceptionCode(1414513947);
2360  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2361  $this->subject->render($contentObjectFixture, []);
2362  }
2363 
2368  {
2369  $backupApplicationContext = GeneralUtility::getApplicationContext();
2371 
2372  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2373  $this->subject->render($contentObjectFixture, []);
2374 
2376  }
2377 
2382  {
2383  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2384 
2385  $configuration = [
2386  'exceptionHandler' => '1'
2387  ];
2388  $this->subject->render($contentObjectFixture, $configuration);
2389  }
2390 
2395  {
2396  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2397 
2398  $this->frontendControllerMock->config['config']['contentObjectExceptionHandler'] = '1';
2399  $this->subject->render($contentObjectFixture, []);
2400  }
2401 
2406  {
2407  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2408  $this->expectException(\LogicException::class);
2409  $this->expectExceptionCode(1414513947);
2410  $this->frontendControllerMock->config['config']['contentObjectExceptionHandler'] = '1';
2411  $configuration = [
2412  'exceptionHandler' => '0'
2413  ];
2414  $this->subject->render($contentObjectFixture, $configuration);
2415  }
2416 
2420  public function ‪renderedErrorMessageCanBeCustomized(): void
2421  {
2422  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2423 
2424  $configuration = [
2425  'exceptionHandler' => '1',
2426  'exceptionHandler.' => [
2427  'errorMessage' => 'New message for testing',
2428  ]
2429  ];
2430 
2431  $this->assertSame('New message for testing', $this->subject->render($contentObjectFixture, $configuration));
2432  }
2433 
2438  {
2439  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2440 
2441  $this->frontendControllerMock
2442  ->config['config']['contentObjectExceptionHandler.'] = [
2443  'errorMessage' => 'Global message for testing',
2444  ];
2445  $configuration = [
2446  'exceptionHandler' => '1',
2447  'exceptionHandler.' => [
2448  'errorMessage' => 'New message for testing',
2449  ]
2450  ];
2451 
2452  $this->assertSame('New message for testing', $this->subject->render($contentObjectFixture, $configuration));
2453  }
2454 
2459  {
2460  $contentObjectFixture = $this->‪createContentObjectThrowingExceptionFixture();
2461 
2462  $configuration = [
2463  'exceptionHandler' => '1',
2464  'exceptionHandler.' => [
2465  'ignoreCodes.' => ['10.' => '1414513947'],
2466  ]
2467  ];
2468  $this->expectException(\LogicException::class);
2469  $this->expectExceptionCode(1414513947);
2470  $this->subject->render($contentObjectFixture, $configuration);
2471  }
2472 
2477  {
2478  $contentObjectFixture = $this->getMockBuilder(AbstractContentObject::class)
2479  ->setConstructorArgs([$this->subject])
2480  ->getMock();
2481  $contentObjectFixture->expects($this->once())
2482  ->method('render')
2483  ->willReturnCallback(function () {
2484  throw new \LogicException('Exception during rendering', 1414513947);
2485  });
2486  return $contentObjectFixture;
2487  }
2488 
2492  protected function ‪getLibParseFunc(): array
2493  {
2494  return [
2495  'makelinks' => '1',
2496  'makelinks.' => [
2497  'http.' => [
2498  'keep' => '{$styles.content.links.keep}',
2499  'extTarget' => '',
2500  'mailto.' => [
2501  'keep' => 'path',
2502  ],
2503  ],
2504  ],
2505  'tags' => [
2506  'link' => 'TEXT',
2507  'link.' => [
2508  'current' => '1',
2509  'typolink.' => [
2510  'parameter.' => [
2511  'data' => 'parameters : allParams',
2512  ],
2513  ],
2514  'parseFunc.' => [
2515  'constants' => '1',
2516  ],
2517  ],
2518  ],
2519 
2520  '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',
2521  'denyTags' => '*',
2522  'sword' => '<span class="csc-sword">|</span>',
2523  'constants' => '1',
2524  'nonTypoTagStdWrap.' => [
2525  'HTMLparser' => '1',
2526  'HTMLparser.' => [
2527  'keepNonMatchedTags' => '1',
2528  'htmlSpecialChars' => '2',
2529  ],
2530  ],
2531  ];
2532  }
2533 
2538  {
2539  return [
2540  'Link to url' => [
2541  'TYPO3',
2542  [
2543  'directImageLink' => false,
2544  'parameter' => 'http://typo3.org',
2545  ],
2546  '<a href="http://typo3.org">TYPO3</a>',
2547  ],
2548  'Link to url without schema' => [
2549  'TYPO3',
2550  [
2551  'directImageLink' => false,
2552  'parameter' => 'typo3.org',
2553  ],
2554  '<a href="http://typo3.org">TYPO3</a>',
2555  ],
2556  'Link to url without link text' => [
2557  '',
2558  [
2559  'directImageLink' => false,
2560  'parameter' => 'http://typo3.org',
2561  ],
2562  '<a href="http://typo3.org">http://typo3.org</a>',
2563  ],
2564  'Link to url with attributes' => [
2565  'TYPO3',
2566  [
2567  'parameter' => 'http://typo3.org',
2568  'ATagParams' => 'class="url-class"',
2569  'extTarget' => '_blank',
2570  'title' => 'Open new window',
2571  ],
2572  '<a href="http://typo3.org" title="Open new window" target="_blank" class="url-class">TYPO3</a>',
2573  ],
2574  'Link to url with attributes in parameter' => [
2575  'TYPO3',
2576  [
2577  'parameter' => 'http://typo3.org _blank url-class "Open new window"',
2578  ],
2579  '<a href="http://typo3.org" title="Open new window" target="_blank" class="url-class">TYPO3</a>',
2580  ],
2581  'Link to url with script tag' => [
2582  '',
2583  [
2584  'directImageLink' => false,
2585  'parameter' => 'http://typo3.org<script>alert(123)</script>',
2586  ],
2587  '<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>',
2588  ],
2589  'Link to email address' => [
2590  'Email address',
2591  [
2592  'parameter' => 'foo@bar.org',
2593  ],
2594  '<a href="mailto:foo@bar.org">Email address</a>',
2595  ],
2596  'Link to email address without link text' => [
2597  '',
2598  [
2599  'parameter' => 'foo@bar.org',
2600  ],
2601  '<a href="mailto:foo@bar.org">foo@bar.org</a>',
2602  ],
2603  'Link to email with attributes' => [
2604  'Email address',
2605  [
2606  'parameter' => 'foo@bar.org',
2607  'ATagParams' => 'class="email-class"',
2608  'title' => 'Write an email',
2609  ],
2610  '<a href="mailto:foo@bar.org" title="Write an email" class="email-class">Email address</a>',
2611  ],
2612  'Link to email with attributes in parameter' => [
2613  'Email address',
2614  [
2615  'parameter' => 'foo@bar.org - email-class "Write an email"',
2616  ],
2617  '<a href="mailto:foo@bar.org" title="Write an email" class="email-class">Email address</a>',
2618  ],
2619  ];
2620  }
2621 
2629  public function ‪typolinkReturnsCorrectLinksForEmailsAndUrls($linkText, $configuration, $expectedResult): void
2630  {
2631  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
2632  ->disableOriginalConstructor()
2633  ->getMock();
2634  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
2635  ->setConstructorArgs([null, $packageManagerMock])
2636  ->setMethods(['dummy'])
2637  ->getMock();
2638  $templateServiceObjectMock->setup = [
2639  'lib.' => [
2640  'parseFunc.' => $this->‪getLibParseFunc(),
2641  ],
2642  ];
2643  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
2644  $typoScriptFrontendControllerMockObject->config = [
2645  'config' => [],
2646  ];
2647  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
2648  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
2649  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
2650 
2651  $this->assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2652  }
2653 
2663  array $settings,
2664  $linkText,
2665  $mailAddress,
2666  $expected
2667  ): void {
2668  $this->‪getFrontendController()->spamProtectEmailAddresses = $settings['spamProtectEmailAddresses'];
2669  $this->‪getFrontendController()->config['config'] = $settings;
2670  $typoScript = ['parameter' => $mailAddress];
2671 
2672  $this->assertEquals($expected, $this->subject->typoLink($linkText, $typoScript));
2673  }
2674 
2679  {
2680  return [
2681  'plain mail without mailto scheme' => [
2682  [
2683  'spamProtectEmailAddresses' => '',
2684  'spamProtectEmailAddresses_atSubst' => '',
2685  'spamProtectEmailAddresses_lastDotSubst' => '',
2686  ],
2687  'some.body@test.typo3.org',
2688  'some.body@test.typo3.org',
2689  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2690  ],
2691  'plain mail with mailto scheme' => [
2692  [
2693  'spamProtectEmailAddresses' => '',
2694  'spamProtectEmailAddresses_atSubst' => '',
2695  'spamProtectEmailAddresses_lastDotSubst' => '',
2696  ],
2697  'some.body@test.typo3.org',
2698  'mailto:some.body@test.typo3.org',
2699  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2700  ],
2701  'plain with at and dot substitution' => [
2702  [
2703  'spamProtectEmailAddresses' => '0',
2704  'spamProtectEmailAddresses_atSubst' => '(at)',
2705  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2706  ],
2707  'some.body@test.typo3.org',
2708  'mailto:some.body@test.typo3.org',
2709  '<a href="mailto:some.body@test.typo3.org">some.body@test.typo3.org</a>',
2710  ],
2711  'mono-alphabetic substitution offset +1' => [
2712  [
2713  'spamProtectEmailAddresses' => '1',
2714  'spamProtectEmailAddresses_atSubst' => '',
2715  'spamProtectEmailAddresses_lastDotSubst' => '',
2716  ],
2717  'some.body@test.typo3.org',
2718  'mailto:some.body@test.typo3.org',
2719  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body(at)test.typo3.org</a>',
2720  ],
2721  'mono-alphabetic substitution offset +1 with at substitution' => [
2722  [
2723  'spamProtectEmailAddresses' => '1',
2724  'spamProtectEmailAddresses_atSubst' => '@',
2725  'spamProtectEmailAddresses_lastDotSubst' => '',
2726  ],
2727  'some.body@test.typo3.org',
2728  'mailto:some.body@test.typo3.org',
2729  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body@test.typo3.org</a>',
2730  ],
2731  'mono-alphabetic substitution offset +1 with at and dot substitution' => [
2732  [
2733  'spamProtectEmailAddresses' => '1',
2734  'spamProtectEmailAddresses_atSubst' => '(at)',
2735  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2736  ],
2737  'some.body@test.typo3.org',
2738  'mailto:some.body@test.typo3.org',
2739  '<a href="javascript:linkTo_UnCryptMailto(%27nbjmup%2Btpnf%5C%2FcpezAuftu%5C%2Fuzqp4%5C%2Fpsh%27);">some.body(at)test.typo3(dot)org</a>',
2740  ],
2741  'mono-alphabetic substitution offset -1 with at and dot substitution' => [
2742  [
2743  'spamProtectEmailAddresses' => '-1',
2744  'spamProtectEmailAddresses_atSubst' => '(at)',
2745  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2746  ],
2747  'some.body@test.typo3.org',
2748  'mailto:some.body@test.typo3.org',
2749  '<a href="javascript:linkTo_UnCryptMailto(%27lzhksn9rnld-ancxZsdrs-sxon2-nqf%27);">some.body(at)test.typo3(dot)org</a>',
2750  ],
2751  'mono-alphabetic substitution offset 2 with at and dot substitution and encoded subject' => [
2752  [
2753  'spamProtectEmailAddresses' => '2',
2754  'spamProtectEmailAddresses_atSubst' => '(at)',
2755  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2756  ],
2757  'some.body@test.typo3.org',
2758  'mailto:some.body@test.typo3.org?subject=foo%20bar',
2759  '<a href="javascript:linkTo_UnCryptMailto(%27ocknvq%2Cuqog0dqfaBvguv0varq50qti%3Fuwdlgev%3Dhqq%2542dct%27);">some.body@test.typo3.org</a>',
2760  ],
2761  'entity substitution with at and dot substitution' => [
2762  [
2763  'spamProtectEmailAddresses' => 'ascii',
2764  'spamProtectEmailAddresses_atSubst' => '',
2765  'spamProtectEmailAddresses_lastDotSubst' => '',
2766  ],
2767  'some.body@test.typo3.org',
2768  'mailto:some.body@test.typo3.org',
2769  '<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>',
2770  ],
2771  'entity substitution with at and dot substitution with at and dot substitution' => [
2772  [
2773  'spamProtectEmailAddresses' => 'ascii',
2774  'spamProtectEmailAddresses_atSubst' => '(at)',
2775  'spamProtectEmailAddresses_lastDotSubst' => '(dot)',
2776  ],
2777  'some.body@test.typo3.org',
2778  'mailto:some.body@test.typo3.org',
2779  '<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>',
2780  ],
2781  ];
2782  }
2783 
2787  public function ‪typolinkReturnsCorrectLinksFilesDataProvider(): array
2788  {
2789  return [
2790  'Link to file' => [
2791  'My file',
2792  [
2793  'directImageLink' => false,
2794  'parameter' => 'fileadmin/foo.bar',
2795  ],
2796  '<a href="fileadmin/foo.bar">My file</a>',
2797  ],
2798  'Link to file without link text' => [
2799  '',
2800  [
2801  'directImageLink' => false,
2802  'parameter' => 'fileadmin/foo.bar',
2803  ],
2804  '<a href="fileadmin/foo.bar">fileadmin/foo.bar</a>',
2805  ],
2806  'Link to file with attributes' => [
2807  'My file',
2808  [
2809  'parameter' => 'fileadmin/foo.bar',
2810  'ATagParams' => 'class="file-class"',
2811  'fileTarget' => '_blank',
2812  'title' => 'Title of the file',
2813  ],
2814  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2815  ],
2816  'Link to file with attributes and additional href' => [
2817  'My file',
2818  [
2819  'parameter' => 'fileadmin/foo.bar',
2820  'ATagParams' => 'href="foo-bar"',
2821  'fileTarget' => '_blank',
2822  'title' => 'Title of the file',
2823  ],
2824  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank">My file</a>',
2825  ],
2826  'Link to file with attributes and additional href and class' => [
2827  'My file',
2828  [
2829  'parameter' => 'fileadmin/foo.bar',
2830  'ATagParams' => 'href="foo-bar" class="file-class"',
2831  'fileTarget' => '_blank',
2832  'title' => 'Title of the file',
2833  ],
2834  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2835  ],
2836  'Link to file with attributes and additional class and href' => [
2837  'My file',
2838  [
2839  'parameter' => 'fileadmin/foo.bar',
2840  'ATagParams' => 'class="file-class" href="foo-bar"',
2841  'fileTarget' => '_blank',
2842  'title' => 'Title of the file',
2843  ],
2844  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2845  ],
2846  'Link to file with attributes and additional class and href and title' => [
2847  'My file',
2848  [
2849  'parameter' => 'fileadmin/foo.bar',
2850  'ATagParams' => 'class="file-class" href="foo-bar" title="foo-bar"',
2851  'fileTarget' => '_blank',
2852  'title' => 'Title of the file',
2853  ],
2854  '<a href="fileadmin/foo.bar" title="foo-bar" target="_blank" class="file-class">My file</a>',
2855  ],
2856  'Link to file with attributes and empty ATagParams' => [
2857  'My file',
2858  [
2859  'parameter' => 'fileadmin/foo.bar',
2860  'ATagParams' => '',
2861  'fileTarget' => '_blank',
2862  'title' => 'Title of the file',
2863  ],
2864  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank">My file</a>',
2865  ],
2866  'Link to file with attributes in parameter' => [
2867  'My file',
2868  [
2869  'parameter' => 'fileadmin/foo.bar _blank file-class "Title of the file"',
2870  ],
2871  '<a href="fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2872  ],
2873  'Link to file with script tag in name' => [
2874  '',
2875  [
2876  'directImageLink' => false,
2877  'parameter' => 'fileadmin/<script>alert(123)</script>',
2878  ],
2879  '<a href="fileadmin/&lt;script&gt;alert(123)&lt;/script&gt;">fileadmin/&lt;script&gt;alert(123)&lt;/script&gt;</a>',
2880  ],
2881  ];
2882  }
2883 
2891  public function ‪typolinkReturnsCorrectLinksFiles($linkText, $configuration, $expectedResult): void
2892  {
2893  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
2894  ->disableOriginalConstructor()
2895  ->getMock();
2896  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
2897  ->setConstructorArgs([null, $packageManagerMock])
2898  ->setMethods(['dummy'])
2899  ->getMock();
2900  $templateServiceObjectMock->setup = [
2901  'lib.' => [
2902  'parseFunc.' => $this->‪getLibParseFunc(),
2903  ],
2904  ];
2905  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
2906  $typoScriptFrontendControllerMockObject->config = [
2907  'config' => [],
2908  ];
2909  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
2910  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
2911 
2912  $resourceFactory = $this->prophesize(ResourceFactory::class);
2913  GeneralUtility::setSingletonInstance(ResourceFactory::class, $resourceFactory->reveal());
2914 
2915  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
2916 
2917  $this->assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
2918  }
2919 
2924  {
2925  return [
2926  'Link to file' => [
2927  'My file',
2928  [
2929  'directImageLink' => false,
2930  'parameter' => 'fileadmin/foo.bar',
2931  ],
2932  '/',
2933  '<a href="/fileadmin/foo.bar">My file</a>',
2934  ],
2935  'Link to file with longer absRefPrefix' => [
2936  'My file',
2937  [
2938  'directImageLink' => false,
2939  'parameter' => 'fileadmin/foo.bar',
2940  ],
2941  '/sub/',
2942  '<a href="/sub/fileadmin/foo.bar">My file</a>',
2943  ],
2944  'Link to absolute file' => [
2945  'My file',
2946  [
2947  'directImageLink' => false,
2948  'parameter' => '/images/foo.bar',
2949  ],
2950  '/',
2951  '<a href="/images/foo.bar">My file</a>',
2952  ],
2953  'Link to absolute file with longer absRefPrefix' => [
2954  'My file',
2955  [
2956  'directImageLink' => false,
2957  'parameter' => '/images/foo.bar',
2958  ],
2959  '/sub/',
2960  '<a href="/images/foo.bar">My file</a>',
2961  ],
2962  'Link to absolute file with identical longer absRefPrefix' => [
2963  'My file',
2964  [
2965  'directImageLink' => false,
2966  'parameter' => '/sub/fileadmin/foo.bar',
2967  ],
2968  '/sub/',
2969  '<a href="/sub/fileadmin/foo.bar">My file</a>',
2970  ],
2971  'Link to file with empty absRefPrefix' => [
2972  'My file',
2973  [
2974  'directImageLink' => false,
2975  'parameter' => 'fileadmin/foo.bar',
2976  ],
2977  '',
2978  '<a href="fileadmin/foo.bar">My file</a>',
2979  ],
2980  'Link to absolute file with empty absRefPrefix' => [
2981  'My file',
2982  [
2983  'directImageLink' => false,
2984  'parameter' => '/fileadmin/foo.bar',
2985  ],
2986  '',
2987  '<a href="/fileadmin/foo.bar">My file</a>',
2988  ],
2989  'Link to file with attributes with absRefPrefix' => [
2990  'My file',
2991  [
2992  'parameter' => 'fileadmin/foo.bar',
2993  'ATagParams' => 'class="file-class"',
2994  'fileTarget' => '_blank',
2995  'title' => 'Title of the file',
2996  ],
2997  '/',
2998  '<a href="/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
2999  ],
3000  'Link to file with attributes with longer absRefPrefix' => [
3001  'My file',
3002  [
3003  'parameter' => 'fileadmin/foo.bar',
3004  'ATagParams' => 'class="file-class"',
3005  'fileTarget' => '_blank',
3006  'title' => 'Title of the file',
3007  ],
3008  '/sub/',
3009  '<a href="/sub/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
3010  ],
3011  'Link to absolute file with attributes with absRefPrefix' => [
3012  'My file',
3013  [
3014  'parameter' => '/images/foo.bar',
3015  'ATagParams' => 'class="file-class"',
3016  'fileTarget' => '_blank',
3017  'title' => 'Title of the file',
3018  ],
3019  '/',
3020  '<a href="/images/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
3021  ],
3022  'Link to absolute file with attributes with longer absRefPrefix' => [
3023  'My file',
3024  [
3025  'parameter' => '/images/foo.bar',
3026  'ATagParams' => 'class="file-class"',
3027  'fileTarget' => '_blank',
3028  'title' => 'Title of the file',
3029  ],
3030  '/sub/',
3031  '<a href="/images/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
3032  ],
3033  'Link to absolute file with attributes with identical longer absRefPrefix' => [
3034  'My file',
3035  [
3036  'parameter' => '/sub/fileadmin/foo.bar',
3037  'ATagParams' => 'class="file-class"',
3038  'fileTarget' => '_blank',
3039  'title' => 'Title of the file',
3040  ],
3041  '/sub/',
3042  '<a href="/sub/fileadmin/foo.bar" title="Title of the file" target="_blank" class="file-class">My file</a>',
3043  ],
3044  ];
3045  }
3046 
3056  $linkText,
3057  $configuration,
3058  $absRefPrefix,
3059  $expectedResult
3060  ): void {
3061  $packageManagerMock = $this->getMockBuilder(PackageManager::class)
3062  ->disableOriginalConstructor()
3063  ->getMock();
3064  $templateServiceObjectMock = $this->getMockBuilder(TemplateService::class)
3065  ->setConstructorArgs([null, $packageManagerMock])
3066  ->setMethods(['dummy'])
3067  ->getMock();
3068  $templateServiceObjectMock->setup = [
3069  'lib.' => [
3070  'parseFunc.' => $this->‪getLibParseFunc(),
3071  ],
3072  ];
3073  $resourceFactory = $this->prophesize(ResourceFactory::class);
3074  GeneralUtility::setSingletonInstance(ResourceFactory::class, $resourceFactory->reveal());
3075 
3076  $typoScriptFrontendControllerMockObject = $this->createMock(TypoScriptFrontendController::class);
3077  $typoScriptFrontendControllerMockObject->config = [
3078  'config' => [],
3079  ];
3080  $typoScriptFrontendControllerMockObject->tmpl = $templateServiceObjectMock;
3081  ‪$GLOBALS['TSFE'] = $typoScriptFrontendControllerMockObject;
3082  ‪$GLOBALS['TSFE']->absRefPrefix = $absRefPrefix;
3083  $this->subject->_set('typoScriptFrontendController', $typoScriptFrontendControllerMockObject);
3084 
3085  $this->assertEquals($expectedResult, $this->subject->typoLink($linkText, $configuration));
3086  }
3087 
3092  {
3093  $linkService = $this->prophesize(LinkService::class);
3094  GeneralUtility::setSingletonInstance(LinkService::class, $linkService->reveal());
3095  $linkService->resolve('foo')->willThrow(InvalidPathException::class);
3096 
3097  $this->assertSame('foo', $this->subject->typoLink('foo', ['parameter' => 'foo']));
3098  }
3099 
3103  public function ‪typoLinkLogsErrorIfNoLinkResolvingIsPossible(): void
3104  {
3105  $linkService = $this->prophesize(LinkService::class);
3106  GeneralUtility::setSingletonInstance(LinkService::class, $linkService->reveal());
3107  $linkService->resolve('foo')->willThrow(InvalidPathException::class);
3108 
3109  $logger = $this->prophesize(Logger::class);
3110  $logger->warning('The link could not be generated', Argument::any())->shouldBeCalled();
3111  $this->subject->setLogger($logger->reveal());
3112  $this->subject->typoLink('foo', ['parameter' => 'foo']);
3113  }
3114 
3118  public function ‪stdWrap_splitObjReturnsCount(): void
3119  {
3120  $conf = [
3121  'token' => ',',
3122  'returnCount' => 1
3123  ];
3124  $expectedResult = 5;
3125  $amountOfEntries = $this->subject->splitObj('1, 2, 3, 4, 5', $conf);
3126  $this->assertSame(
3127  $expectedResult,
3128  $amountOfEntries
3129  );
3130  }
3137  public function ‪calculateCacheKeyDataProvider(): array
3138  {
3139  $value = $this->getUniqueId('value');
3140  $wrap = [$this->getUniqueId('wrap')];
3141  $valueConf = ['key' => $value];
3142  $wrapConf = ['key.' => $wrap];
3143  $conf = array_merge($valueConf, $wrapConf);
3144  $will = $this->getUniqueId('stdWrap');
3145 
3146  return [
3147  'no conf' => [
3148  '',
3149  [],
3150  0,
3151  null,
3152  null,
3153  null
3154  ],
3155  'value conf only' => [
3156  $value,
3157  $valueConf,
3158  0,
3159  null,
3160  null,
3161  null
3162  ],
3163  'wrap conf only' => [
3164  $will,
3165  $wrapConf,
3166  1,
3167  '',
3168  $wrap,
3169  $will
3170  ],
3171  'full conf' => [
3172  $will,
3173  $conf,
3174  1,
3175  $value,
3176  $wrap,
3177  $will
3178  ],
3179  ];
3180  }
3181 
3197  public function ‪calculateCacheKey(string $expect, array $conf, int $times, $with, $withWrap, $will): void
3198  {
3199  ‪$subject = $this->getAccessibleMock(ContentObjectRenderer::class, ['stdWrap']);
3200  ‪$subject->expects($this->exactly($times))
3201  ->method('stdWrap')
3202  ->with($with, $withWrap)
3203  ->willReturn($will);
3204 
3205  $result = ‪$subject->_call('calculateCacheKey', $conf);
3206  $this->assertSame($expect, $result);
3207  }
3214  public function ‪getFromCacheDtataProvider(): array
3215  {
3216  $conf = [$this->getUniqueId('conf')];
3217  return [
3218  'empty cache key' => [
3219  false,
3220  $conf,
3221  '',
3222  0,
3223  null,
3224  ],
3225  'non-empty cache key' => [
3226  'value',
3227  $conf,
3228  'non-empty-key',
3229  1,
3230  'value',
3231  ],
3232  ];
3233  }
3234 
3251  public function ‪getFromCache($expect, $conf, $cacheKey, $times, $cached): void
3252  {
3253  ‪$subject = $this->getAccessibleMock(
3254  ContentObjectRenderer::class,
3255  ['calculateCacheKey']
3256  );
3257  ‪$subject
3258  ->expects($this->exactly(1))
3259  ->method('calculateCacheKey')
3260  ->with($conf)
3261  ->willReturn($cacheKey);
3262  $cacheFrontend = $this->createMock(CacheFrontendInterface::class);
3263  $cacheFrontend
3264  ->expects($this->exactly($times))
3265  ->method('get')
3266  ->with($cacheKey)
3267  ->willReturn($cached);
3268  $cacheManager = $this->createMock(CacheManager::class);
3269  $cacheManager
3270  ->method('getCache')
3271  ->willReturn($cacheFrontend);
3272  GeneralUtility::setSingletonInstance(
3273  CacheManager::class,
3274  $cacheManager
3275  );
3276  $this->assertSame($expect, ‪$subject->_call('getFromCache', $conf));
3277  }
3284  public function ‪getFieldValDataProvider(): array
3285  {
3286  return [
3287  'invalid single key' => [null, 'invalid'],
3288  'single key of null' => [null, 'null'],
3289  'single key of empty string' => ['', 'empty'],
3290  'single key of non-empty string' => ['string 1', 'string1'],
3291  'single key of boolean false' => [false, 'false'],
3292  'single key of boolean true' => [true, 'true'],
3293  'single key of integer 0' => [0, 'zero'],
3294  'single key of integer 1' => [1, 'one'],
3295  'single key to be trimmed' => ['string 1', ' string1 '],
3296 
3297  'split nothing' => ['', '//'],
3298  'split one before' => ['string 1', 'string1//'],
3299  'split one after' => ['string 1', '//string1'],
3300  'split two ' => ['string 1', 'string1//string2'],
3301  'split three ' => ['string 1', 'string1//string2//string3'],
3302  'split to be trimmed' => ['string 1', ' string1 // string2 '],
3303  '0 is not empty' => [0, '// zero'],
3304  '1 is not empty' => [1, '// one'],
3305  'true is not empty' => [true, '// true'],
3306  'false is empty' => ['', '// false'],
3307  'null is empty' => ['', '// null'],
3308  'empty string is empty' => ['', '// empty'],
3309  'string is not empty' => ['string 1', '// string1'],
3310  'first non-empty winns' => [0, 'false//empty//null//zero//one'],
3311  'empty string is fallback' => ['', 'false // empty // null'],
3312  ];
3313  }
3314 
3353  public function ‪getFieldVal($expect, string ‪$fields): void
3354  {
3355  $data = [
3356  'string1' => 'string 1',
3357  'string2' => 'string 2',
3358  'string3' => 'string 3',
3359  'empty' => '',
3360  'null' => null,
3361  'false' => false,
3362  'true' => true,
3363  'zero' => 0,
3364  'one' => 1,
3365  ];
3366  $this->subject->_set('data', $data);
3367  $this->assertSame($expect, $this->subject->getFieldVal(‪$fields));
3368  }
3375  public function ‪caseshiftDataProvider(): array
3376  {
3377  return [
3378  'lower' => ['x y', 'X Y', 'lower'],
3379  'upper' => ['X Y', 'x y', 'upper'],
3380  'capitalize' => ['One Two', 'one two', 'capitalize'],
3381  'ucfirst' => ['One two', 'one two', 'ucfirst'],
3382  'lcfirst' => ['oNE TWO', 'ONE TWO', 'lcfirst'],
3383  'uppercamelcase' => ['CamelCase', 'camel_case', 'uppercamelcase'],
3384  'lowercamelcase' => ['camelCase', 'camel_case', 'lowercamelcase'],
3385  ];
3386  }
3387 
3397  public function ‪caseshift(string $expect, string $content, string $case): void
3398  {
3399  $this->assertSame(
3400  $expect,
3401  $this->subject->caseshift($content, $case)
3402  );
3403  }
3410  public function ‪HTMLcaseshiftDataProvider(): array
3411  {
3412  $case = $this->getUniqueId('case');
3413  return [
3414  'simple text' => [
3415  'TEXT',
3416  'text',
3417  $case,
3418  [['text', $case]],
3419  ['TEXT']
3420  ],
3421  'simple tag' => [
3422  '<i>TEXT</i>',
3423  '<i>text</i>',
3424  $case,
3425  [['', $case], ['text', $case]],
3426  ['', 'TEXT']
3427  ],
3428  'multiple nested tags with classes' => [
3429  '<div class="typo3">'
3430  . '<p>A <b>BOLD<\b> WORD.</p>'
3431  . '<p>AN <i>ITALIC<\i> WORD.</p>'
3432  . '</div>',
3433  '<div class="typo3">'
3434  . '<p>A <b>bold<\b> word.</p>'
3435  . '<p>An <i>italic<\i> word.</p>'
3436  . '</div>',
3437  $case,
3438  [
3439  ['', $case],
3440  ['', $case],
3441  ['A ', $case],
3442  ['bold', $case],
3443  [' word.', $case],
3444  ['', $case],
3445  ['An ', $case],
3446  ['italic', $case],
3447  [' word.', $case],
3448  ['', $case],
3449  ],
3450  ['', '', 'A ', 'BOLD', ' WORD.', '', 'AN ', 'ITALIC', ' WORD.', '']
3451  ],
3452  ];
3453  }
3454 
3471  public function ‪HTMLcaseshift(string $expect, string $content, string $case, array $with, array $will): void
3472  {
3473  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3474  ->setMethods(['caseshift'])->getMock();
3475  ‪$subject
3476  ->expects($this->exactly(count($with)))
3477  ->method('caseshift')
3478  ->withConsecutive(...$with)
3479  ->will($this->onConsecutiveCalls(...$will));
3480  $this->assertSame(
3481  $expect,
3482  ‪$subject->‪HTMLcaseshift($content, $case)
3483  );
3484  }
3485 
3486  /***************************************************************************
3487  * General tests for stdWrap_
3488  ***************************************************************************/
3489 
3501  public function ‪allStdWrapProcessorsAreCallable(): void
3502  {
3503  $callable = 0;
3504  $notCallable = 0;
3505  $processors = ['invalidProcessor'];
3506  foreach (array_keys($this->subject->_get('stdWrapOrder')) as $key) {
3507  $processors[] = strtr($key, ['.' => '']);
3508  }
3509  foreach (array_unique($processors) as $processor) {
3510  $method = [‪$this->subject, 'stdWrap_' . $processor];
3511  if (is_callable($method)) {
3512  $callable += 1;
3513  } else {
3514  $notCallable += 1;
3515  }
3516  }
3517  $this->assertSame(1, $notCallable);
3518  $this->assertSame(86, $callable);
3519  }
3520 
3541  {
3542  $timeTrackerProphecy = $this->prophesize(TimeTracker::class);
3543  GeneralUtility::setSingletonInstance(TimeTracker::class, $timeTrackerProphecy->reveal());
3544 
3545  // `parseFunc` issues deprecation in case `htmlSanitize` is not given
3546  $expectExceptions = ['numRows', 'parseFunc', 'split', 'bytes'];
3547  $count = 0;
3548  $processors = [];
3549  $exceptions = [];
3550  foreach (array_keys($this->subject->_get('stdWrapOrder')) as $key) {
3551  $processors[] = strtr($key, ['.' => '']);
3552  }
3553  foreach (array_unique($processors) as $processor) {
3554  $count += 1;
3555  try {
3556  $conf = [$processor => '', $processor . '.' => ['table' => 'tt_content']];
3557  $method = 'stdWrap_' . $processor;
3558  $this->subject->$method('', $conf);
3559  } catch (\Exception $e) {
3560  $exceptions[] = $processor;
3561  }
3562  }
3563  $this->assertSame($expectExceptions, $exceptions);
3564  $this->assertSame(86, $count);
3565  }
3566 
3567  /***************************************************************************
3568  * End general tests for stdWrap_
3569  ***************************************************************************/
3570 
3571  /***************************************************************************
3572  * Tests for stdWrap_ in alphabetical order (all uppercase before lowercase)
3573  ***************************************************************************/
3581  {
3582  return [
3583  'preProcess' => [
3584  'stdWrap_stdWrapPreProcess',
3585  'stdWrapPreProcess'
3586  ],
3587  'override' => [
3588  'stdWrap_stdWrapOverride',
3589  'stdWrapOverride'
3590  ],
3591  'process' => [
3592  'stdWrap_stdWrapProcess',
3593  'stdWrapProcess'
3594  ],
3595  'postProcess' => [
3596  'stdWrap_stdWrapPostProcess',
3597  'stdWrapPostProcess'
3598  ],
3599  ];
3600  }
3601 
3618  string $stdWrapMethod,
3619  string $hookObjectCall
3620  ): void {
3621  $conf = [$this->getUniqueId('conf')];
3622  $content = $this->getUniqueId('content');
3623  $processed1 = $this->getUniqueId('processed1');
3624  $processed2 = $this->getUniqueId('processed2');
3625  $hookObject1 = $this->createMock(
3626  ContentObjectStdWrapHookInterface::class
3627  );
3628  $hookObject1->expects($this->once())
3629  ->method($hookObjectCall)
3630  ->with($content, $conf)
3631  ->willReturn($processed1);
3632  $hookObject2 = $this->createMock(
3633  ContentObjectStdWrapHookInterface::class
3634  );
3635  $hookObject2->expects($this->once())
3636  ->method($hookObjectCall)
3637  ->with($processed1, $conf)
3638  ->willReturn($processed2);
3639  $this->subject->_set(
3640  'stdWrapHookObjects',
3641  [$hookObject1, $hookObject2]
3642  );
3643  $result = $this->subject->$stdWrapMethod($content, $conf);
3644  $this->assertSame($processed2, $result);
3645  }
3652  public function ‪stdWrap_HTMLparserDataProvider(): array
3653  {
3654  $content = $this->getUniqueId('content');
3655  $parsed = $this->getUniqueId('parsed');
3656  return [
3657  'no config' => [
3658  $content,
3659  $content,
3660  [],
3661  0,
3662  $parsed
3663  ],
3664  'no array' => [
3665  $content,
3666  $content,
3667  ['HTMLparser.' => 1],
3668  0,
3669  $parsed
3670  ],
3671  'empty array' => [
3672  $parsed,
3673  $content,
3674  ['HTMLparser.' => []],
3675  1,
3676  $parsed
3677  ],
3678  'non-empty array' => [
3679  $parsed,
3680  $content,
3681  ['HTMLparser.' => [true]],
3682  1,
3683  $parsed
3684  ],
3685  ];
3686  }
3687 
3710  public function ‪stdWrap_HTMLparser(
3711  string $expect,
3712  string $content,
3713  array $conf,
3714  int $times,
3715  string $will
3716  ): void {
3717  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3718  ->setMethods(['HTMLparser_TSbridge'])->getMock();
3719  ‪$subject
3720  ->expects($this->exactly($times))
3721  ->method('HTMLparser_TSbridge')
3722  ->with($content, $conf['HTMLparser.'] ?? [])
3723  ->willReturn($will);
3724  $this->assertSame(
3725  $expect,
3726  ‪$subject->‪stdWrap_HTMLparser($content, $conf)
3727  );
3728  }
3729 
3734  {
3735  return [
3736  'No Tag' => [
3737  [],
3738  ['addPageCacheTags' => ''],
3739  ],
3740  'Two expectedTags' => [
3741  ['tag1', 'tag2'],
3742  ['addPageCacheTags' => 'tag1,tag2'],
3743  ],
3744  'Two expectedTags plus one with stdWrap' => [
3745  ['tag1', 'tag2', 'tag3'],
3746  [
3747  'addPageCacheTags' => 'tag1,tag2',
3748  'addPageCacheTags.' => ['wrap' => '|,tag3']
3749  ],
3750  ],
3751  ];
3752  }
3753 
3760  public function ‪stdWrap_addPageCacheTagsAddsPageTags(array $expectedTags, array $configuration): void
3761  {
3762  $this->subject->stdWrap_addPageCacheTags('', $configuration);
3763  $this->assertEquals($expectedTags, $this->frontendControllerMock->_get('pageCacheTags'));
3764  }
3765 
3778  public function ‪stdWrap_age(): void
3779  {
3780  $now = 10;
3781  $content = '9';
3782  $conf = ['age' => $this->getUniqueId('age')];
3783  $return = $this->getUniqueId('return');
3784  $difference = $now - (int)$content;
3785  ‪$GLOBALS['EXEC_TIME'] = $now;
3786  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3787  ->setMethods(['calcAge'])->getMock();
3788  ‪$subject
3789  ->expects($this->once())
3790  ->method('calcAge')
3791  ->with($difference, $conf['age'])
3792  ->willReturn($return);
3793  $this->assertSame($return, ‪$subject->‪stdWrap_age($content, $conf));
3794  }
3795 
3809  public function ‪stdWrap_append(): void
3810  {
3811  $debugKey = '/stdWrap/.append';
3812  $content = $this->getUniqueId('content');
3813  $conf = [
3814  'append' => $this->getUniqueId('append'),
3815  'append.' => [$this->getUniqueId('append.')],
3816  ];
3817  $return = $this->getUniqueId('return');
3818  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
3819  ->setMethods(['cObjGetSingle'])->getMock();
3820  ‪$subject
3821  ->expects($this->once())
3822  ->method('cObjGetSingle')
3823  ->with($conf['append'], $conf['append.'], $debugKey)
3824  ->willReturn($return);
3825  $this->assertSame(
3826  $content . $return,
3827  ‪$subject->‪stdWrap_append($content, $conf)
3828  );
3829  }
3836  public function ‪stdWrapBrDataProvider(): array
3837  {
3838  return [
3839  'no xhtml with LF in between' => [
3840  'one<br>' . LF . 'two',
3841  'one' . LF . 'two',
3842  null
3843  ],
3844  'no xhtml with LF in between and around' => [
3845  '<br>' . LF . 'one<br>' . LF . 'two<br>' . LF,
3846  LF . 'one' . LF . 'two' . LF,
3847  null
3848  ],
3849  'xhtml with LF in between' => [
3850  'one<br />' . LF . 'two',
3851  'one' . LF . 'two',
3852  'xhtml_strict'
3853  ],
3854  'xhtml with LF in between and around' => [
3855  '<br />' . LF . 'one<br />' . LF . 'two<br />' . LF,
3856  LF . 'one' . LF . 'two' . LF,
3857  'xhtml_strict'
3858  ],
3859  ];
3860  }
3861 
3871  public function ‪stdWrap_br($expected, $input, $xhtmlDoctype): void
3872  {
3873  ‪$GLOBALS['TSFE']->xhtmlDoctype = $xhtmlDoctype;
3874  $this->assertSame($expected, $this->subject->stdWrap_br($input));
3875  }
3882  public function ‪stdWrapBrTagDataProvider(): array
3883  {
3884  $noConfig = [];
3885  $config1 = ['brTag' => '<br/>'];
3886  $config2 = ['brTag' => '<br>'];
3887  return [
3888  'no config: one break at the beginning' => [LF . 'one' . LF . 'two', 'onetwo', $noConfig],
3889  'no config: multiple breaks at the beginning' => [LF . LF . 'one' . LF . 'two', 'onetwo', $noConfig],
3890  'no config: one break at the end' => ['one' . LF . 'two' . LF, 'onetwo', $noConfig],
3891  'no config: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'onetwo', $noConfig],
3892 
3893  'config1: one break at the beginning' => [LF . 'one' . LF . 'two', '<br/>one<br/>two', $config1],
3894  'config1: multiple breaks at the beginning' => [
3895  LF . LF . 'one' . LF . 'two',
3896  '<br/><br/>one<br/>two',
3897  $config1
3898  ],
3899  'config1: one break at the end' => ['one' . LF . 'two' . LF, 'one<br/>two<br/>', $config1],
3900  'config1: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'one<br/>two<br/><br/>', $config1],
3901 
3902  'config2: one break at the beginning' => [LF . 'one' . LF . 'two', '<br>one<br>two', $config2],
3903  'config2: multiple breaks at the beginning' => [
3904  LF . LF . 'one' . LF . 'two',
3905  '<br><br>one<br>two',
3906  $config2
3907  ],
3908  'config2: one break at the end' => ['one' . LF . 'two' . LF, 'one<br>two<br>', $config2],
3909  'config2: multiple breaks at the end' => ['one' . LF . 'two' . LF . LF, 'one<br>two<br><br>', $config2],
3910  ];
3911  }
3912 
3922  public function ‪stdWrap_brTag(string $input, string $expected, array $config): void
3923  {
3924  $this->assertEquals($expected, $this->subject->stdWrap_brTag($input, $config));
3925  }
3932  public function ‪stdWrap_bytesDataProvider(): array
3933  {
3934  return [
3935  'value 1234 default' => [
3936  '1.21 Ki',
3937  '1234',
3938  ['labels' => '', 'base' => 0],
3939  ],
3940  'value 1234 si' => [
3941  '1.23 k',
3942  '1234',
3943  ['labels' => 'si', 'base' => 0],
3944  ],
3945  'value 1234 iec' => [
3946  '1.21 Ki',
3947  '1234',
3948  ['labels' => 'iec', 'base' => 0],
3949  ],
3950  'value 1234 a-i' => [
3951  '1.23b',
3952  '1234',
3953  ['labels' => 'a|b|c|d|e|f|g|h|i', 'base' => 1000],
3954  ],
3955  'value 1234 a-i invalid base' => [
3956  '1.21b',
3957  '1234',
3958  ['labels' => 'a|b|c|d|e|f|g|h|i', 'base' => 54],
3959  ],
3960  'value 1234567890 default' => [
3961  '1.15 Gi',
3962  '1234567890',
3963  ['labels' => '', 'base' => 0],
3964  ]
3965  ];
3966  }
3967 
3989  public function ‪stdWrap_bytes(string $expect, string $content, array $conf): void
3990  {
3991  $locale = 'en_US.UTF-8';
3992  try {
3993  $this->setLocale(LC_NUMERIC, $locale);
3994  } catch (‪Exception $e) {
3995  $this->markTestSkipped('Locale ' . $locale . ' is not available.');
3996  }
3997  $conf = ['bytes.' => $conf];
3998  $this->assertSame(
3999  $expect,
4000  $this->subject->stdWrap_bytes($content, $conf)
4001  );
4002  }
4003 
4017  public function ‪stdWrap_cObject(): void
4018  {
4019  $debugKey = '/stdWrap/.cObject';
4020  $content = $this->getUniqueId('content');
4021  $conf = [
4022  'cObject' => $this->getUniqueId('cObject'),
4023  'cObject.' => [$this->getUniqueId('cObject.')],
4024  ];
4025  $return = $this->getUniqueId('return');
4026  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4027  ->setMethods(['cObjGetSingle'])->getMock();
4028  ‪$subject
4029  ->expects($this->once())
4030  ->method('cObjGetSingle')
4031  ->with($conf['cObject'], $conf['cObject.'], $debugKey)
4032  ->willReturn($return);
4033  $this->assertSame(
4034  $return,
4035  ‪$subject->‪stdWrap_cObject($content, $conf)
4036  );
4037  }
4044  public function ‪stdWrap_orderedStdWrapDataProvider(): array
4045  {
4046  $confA = [$this->getUniqueId('conf A')];
4047  $confB = [$this->getUniqueId('conf B')];
4048  return [
4049  'standard case: order 1, 2' => [
4050  $confA,
4051  $confB,
4052  ['1.' => $confA, '2.' => $confB]
4053  ],
4054  'inverted: order 2, 1' => [
4055  $confB,
4056  $confA,
4057  ['2.' => $confA, '1.' => $confB]
4058  ],
4059  '0 as integer: order 0, 2' => [
4060  $confA,
4061  $confB,
4062  ['0.' => $confA, '2.' => $confB]
4063  ],
4064  'negative integers: order 2, -2' => [
4065  $confB,
4066  $confA,
4067  ['2.' => $confA, '-2.' => $confB]
4068  ],
4069  'chars are casted to key 0, that is not in the array' => [
4070  null,
4071  $confB,
4072  ['2.' => $confB, 'xxx.' => $confA]
4073  ],
4074  ];
4075  }
4076 
4099  public function ‪stdWrap_orderedStdWrap($firstConf, array $secondConf, array $conf): void
4100  {
4101  $content = $this->getUniqueId('content');
4102  $between = $this->getUniqueId('between');
4103  $expect = $this->getUniqueId('expect');
4104  $conf['orderedStdWrap.'] = $conf;
4105  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4106  ->setMethods(['stdWrap'])->getMock();
4107  ‪$subject
4108  ->expects($this->exactly(2))
4109  ->method('stdWrap')
4110  ->withConsecutive([$content, $firstConf], [$between, $secondConf])
4111  ->will($this->onConsecutiveCalls($between, $expect));
4112  $this->assertSame(
4113  $expect,
4114  ‪$subject->‪stdWrap_orderedStdWrap($content, $conf)
4115  );
4116  }
4123  public function ‪stdWrap_cacheReadDataProvider(): array
4124  {
4125  $cacheConf = [$this->getUniqueId('cache.')];
4126  $conf = ['cache.' => $cacheConf];
4127  return [
4128  'no conf' => [
4129  'content',
4130  'content',
4131  [],
4132  0,
4133  null,
4134  null,
4135  ],
4136  'no cache. conf' => [
4137  'content',
4138  'content',
4139  ['otherConf' => 1],
4140  0,
4141  null,
4142  null,
4143  ],
4144  'non-cached simulation' => [
4145  'content',
4146  'content',
4147  $conf,
4148  1,
4149  $cacheConf,
4150  false,
4151  ],
4152  'cached simulation' => [
4153  'cachedContent',
4154  'content',
4155  $conf,
4156  1,
4157  $cacheConf,
4158  'cachedContent',
4159  ],
4160  ];
4161  }
4162 
4179  public function ‪stdWrap_cacheRead(
4180  string $expect,
4181  string $input,
4182  array $conf,
4183  int $times,
4184  $with,
4185  $will
4186  ): void {
4187  ‪$subject = $this->getAccessibleMock(
4188  ContentObjectRenderer::class,
4189  ['getFromCache']
4190  );
4191  ‪$subject
4192  ->expects($this->exactly($times))
4193  ->method('getFromCache')
4194  ->with($with)
4195  ->willReturn($will);
4196  $this->assertSame(
4197  $expect,
4198  ‪$subject->‪stdWrap_cacheRead($input, $conf)
4199  );
4200  }
4207  public function ‪stdWrap_cacheStoreDataProvider(): array
4208  {
4209  $confCache = [$this->getUniqueId('cache.')];
4210  $key = [$this->getUniqueId('key')];
4211  return [
4212  'Return immediate with no conf' => [
4213  null,
4214  0,
4215  null,
4216  0,
4217  ],
4218  'Return immediate with empty key' => [
4219  $confCache,
4220  1,
4221  '0',
4222  0,
4223  ],
4224  'Call all methods' => [
4225  $confCache,
4226  1,
4227  $key,
4228  1,
4229  ],
4230  ];
4231  }
4232 
4254  public function ‪stdWrap_cacheStore(
4255  $confCache,
4256  int $timesCCK,
4257  $key,
4258  int $times
4259  ): void {
4260  $content = $this->getUniqueId('content');
4261  $conf['cache.'] = $confCache;
4262  $tags = [$this->getUniqueId('tags')];
4263  $lifetime = $this->getUniqueId('lifetime');
4264  $params = [
4265  'key' => $key,
4266  'content' => $content,
4267  'lifetime' => $lifetime,
4268  'tags' => $tags
4269  ];
4270  ‪$subject = $this->getAccessibleMock(
4271  ContentObjectRenderer::class,
4272  [
4273  'calculateCacheKey',
4274  'calculateCacheTags',
4275  'calculateCacheLifetime'
4276  ]
4277  );
4278  ‪$subject
4279  ->expects($this->exactly($timesCCK))
4280  ->method('calculateCacheKey')
4281  ->with($confCache)
4282  ->willReturn($key);
4283  ‪$subject
4284  ->expects($this->exactly($times))
4285  ->method('calculateCacheTags')
4286  ->with($confCache)
4287  ->willReturn($tags);
4288  ‪$subject
4289  ->expects($this->exactly($times))
4290  ->method('calculateCacheLifetime')
4291  ->with($confCache)
4292  ->willReturn($lifetime);
4293  $cacheFrontend = $this->createMock(CacheFrontendInterface::class);
4294  $cacheFrontend
4295  ->expects($this->exactly($times))
4296  ->method('set')
4297  ->with($key, $content, $tags, $lifetime)
4298  ->willReturn(null);
4299  $cacheManager = $this->createMock(CacheManager::class);
4300  $cacheManager
4301  ->method('getCache')
4302  ->willReturn($cacheFrontend);
4303  GeneralUtility::setSingletonInstance(
4304  CacheManager::class,
4305  $cacheManager
4306  );
4307  list($countCalls, $test) = [0, $this];
4308  $closure = function ($par1, $par2) use (
4309  $test,
4310  ‪$subject,
4311  $params,
4312  &$countCalls
4313  ) {
4314  $test->assertSame($params, $par1);
4315  $test->assertSame(‪$subject, $par2);
4316  $countCalls++;
4317  };
4318  ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap_cacheStore'] = [
4319  $closure,
4320  $closure,
4321  $closure
4322  ];
4323  $this->assertSame(
4324  $content,
4325  ‪$subject->‪stdWrap_cacheStore($content, $conf)
4326  );
4327  $this->assertSame($times * 3, $countCalls);
4328  }
4329 
4342  public function ‪stdWrap_case(): void
4343  {
4344  $content = $this->getUniqueId();
4345  $conf = [
4346  'case' => $this->getUniqueId('used'),
4347  'case.' => [$this->getUniqueId('discarded')],
4348  ];
4349  $return = $this->getUniqueId();
4350  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4351  ->setMethods(['HTMLcaseshift'])->getMock();
4352  ‪$subject
4353  ->expects($this->once())
4354  ->method('HTMLcaseshift')
4355  ->with($content, $conf['case'])
4356  ->willReturn($return);
4357  $this->assertSame(
4358  $return,
4359  ‪$subject->‪stdWrap_case($content, $conf)
4360  );
4361  }
4368  public function ‪stdWrap_char(): void
4369  {
4370  $input = 'discarded';
4371  $expected = 'C';
4372  $this->assertEquals($expected, $this->subject->stdWrap_char($input, ['char' => '67']));
4373  }
4374 
4387  public function ‪stdWrap_crop(): void
4388  {
4389  $content = $this->getUniqueId('content');
4390  $conf = [
4391  'crop' => $this->getUniqueId('crop'),
4392  'crop.' => $this->getUniqueId('not used'),
4393  ];
4394  $return = $this->getUniqueId('return');
4395  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4396  ->setMethods(['crop'])->getMock();
4397  ‪$subject
4398  ->expects($this->once())
4399  ->method('crop')
4400  ->with($content, $conf['crop'])
4401  ->willReturn($return);
4402  $this->assertSame(
4403  $return,
4404  ‪$subject->‪stdWrap_crop($content, $conf)
4405  );
4406  }
4407 
4420  public function ‪stdWrap_cropHTML(): void
4421  {
4422  $content = $this->getUniqueId('content');
4423  $conf = [
4424  'cropHTML' => $this->getUniqueId('cropHTML'),
4425  'cropHTML.' => $this->getUniqueId('not used'),
4426  ];
4427  $return = $this->getUniqueId('return');
4428  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4429  ->setMethods(['cropHTML'])->getMock();
4430  ‪$subject
4431  ->expects($this->once())
4432  ->method('cropHTML')
4433  ->with($content, $conf['cropHTML'])
4434  ->willReturn($return);
4435  $this->assertSame(
4436  $return,
4437  ‪$subject->‪stdWrap_cropHTML($content, $conf)
4438  );
4439  }
4446  public function ‪stdWrap_csConvDataProvider(): array
4447  {
4448  return [
4449  'empty string from ISO-8859-15' => [
4450  '',
4451  mb_convert_encoding('', 'ISO-8859-15', 'UTF-8'),
4452  ['csConv' => 'ISO-8859-15']
4453  ],
4454  'empty string from BIG-5' => [
4455  '',
4456  mb_convert_encoding('', 'BIG-5'),
4457  ['csConv' => 'BIG-5']
4458  ],
4459  '"0" from ISO-8859-15' => [
4460  '0',
4461  mb_convert_encoding('0', 'ISO-8859-15', 'UTF-8'),
4462  ['csConv' => 'ISO-8859-15']
4463  ],
4464  '"0" from BIG-5' => [
4465  '0',
4466  mb_convert_encoding('0', 'BIG-5'),
4467  ['csConv' => 'BIG-5']
4468  ],
4469  'euro symbol from ISO-88859-15' => [
4470  '€',
4471  mb_convert_encoding('€', 'ISO-8859-15', 'UTF-8'),
4472  ['csConv' => 'ISO-8859-15']
4473  ],
4474  'good morning from BIG-5' => [
4475  '早安',
4476  mb_convert_encoding('早安', 'BIG-5'),
4477  ['csConv' => 'BIG-5']
4478  ],
4479  ];
4480  }
4481 
4491  public function ‪stdWrap_csConv(string $expected, string $input, array $conf): void
4492  {
4493  $this->assertSame(
4494  $expected,
4495  $this->subject->stdWrap_csConv($input, $conf)
4496  );
4497  }
4498 
4510  public function ‪stdWrap_current(): void
4511  {
4512  $data = [
4513  'currentValue_kidjls9dksoje' => 'default',
4514  'currentValue_new' => 'new',
4515  ];
4516  $this->subject->_set('data', $data);
4517  $this->assertSame(
4518  'currentValue_kidjls9dksoje',
4519  $this->subject->_get('currentValKey')
4520  );
4521  $this->assertSame(
4522  'default',
4523  $this->subject->stdWrap_current('discarded', ['discarded'])
4524  );
4525  $this->subject->_set('currentValKey', 'currentValue_new');
4526  $this->assertSame(
4527  'new',
4528  $this->subject->stdWrap_current('discarded', ['discarded'])
4529  );
4530  }
4537  public function ‪stdWrap_dataDataProvider(): array
4538  {
4539  $data = [$this->getUniqueId('data')];
4540  $alt = [$this->getUniqueId('alternativeData')];
4541  return [
4542  'default' => [$data, $data, ''],
4543  'alt is array' => [$alt, $data, $alt],
4544  'alt is empty array' => [[], $data, []],
4545  'alt null' => [$data, $data, null],
4546  'alt string' => [$data, $data, 'xxx'],
4547  'alt int' => [$data, $data, 1],
4548  'alt bool' => [$data, $data, true],
4549  ];
4550  }
4551 
4570  public function ‪stdWrap_data(array $expect, array $data, $alt): void
4571  {
4572  $conf = ['data' => $this->getUniqueId('conf.data')];
4573  $return = $this->getUniqueId('return');
4574  ‪$subject = $this->getAccessibleMock(
4575  ContentObjectRenderer::class,
4576  ['getData']
4577  );
4578  ‪$subject->_set('data', $data);
4579  ‪$subject->_set('alternativeData', $alt);
4580  ‪$subject
4581  ->expects($this->once())
4582  ->method('getData')
4583  ->with($conf['data'], $expect)
4584  ->willReturn($return);
4585  $this->assertSame($return, ‪$subject->‪stdWrap_data('discard', $conf));
4586  $this->assertSame('', ‪$subject->_get('alternativeData'));
4587  }
4588 
4601  public function ‪stdWrap_dataWrap(): void
4602  {
4603  $content = $this->getUniqueId('content');
4604  $conf = [
4605  'dataWrap' => $this->getUniqueId('dataWrap'),
4606  'dataWrap.' => [$this->getUniqueId('not used')],
4607  ];
4608  $return = $this->getUniqueId('return');
4609  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4610  ->setMethods(['dataWrap'])->getMock();
4611  ‪$subject
4612  ->expects($this->once())
4613  ->method('dataWrap')
4614  ->with($content, $conf['dataWrap'])
4615  ->willReturn($return);
4616  $this->assertSame(
4617  $return,
4618  ‪$subject->‪stdWrap_dataWrap($content, $conf)
4619  );
4620  }
4627  public function ‪stdWrap_dateDataProvider(): array
4628  {
4629  // Fictive execution time: 2015-10-02 12:00
4630  $now = 1443780000;
4631  return [
4632  'given timestamp' => [
4633  '02.10.2015',
4634  $now,
4635  ['date' => 'd.m.Y'],
4636  $now
4637  ],
4638  'empty string' => [
4639  '02.10.2015',
4640  '',
4641  ['date' => 'd.m.Y'],
4642  $now
4643  ],
4644  'testing null' => [
4645  '02.10.2015',
4646  null,
4647  ['date' => 'd.m.Y'],
4648  $now
4649  ],
4650  'given timestamp return GMT' => [
4651  '02.10.2015 10:00:00',
4652  $now,
4653  [
4654  'date' => 'd.m.Y H:i:s',
4655  'date.' => ['GMT' => true],
4656  ],
4657  $now
4658  ]
4659  ];
4660  }
4661 
4672  public function ‪stdWrap_date(string $expected, $content, array $conf, int $now): void
4673  {
4674  ‪$GLOBALS['EXEC_TIME'] = $now;
4675  $this->assertEquals(
4676  $expected,
4677  $this->subject->stdWrap_date($content, $conf)
4678  );
4679  }
4686  public function ‪stdWrap_debug(): void
4687  {
4688  $expect = '<pre>&lt;p class=&quot;class&quot;&gt;&lt;br/&gt;'
4689  . '&lt;/p&gt;</pre>';
4690  $content = '<p class="class"><br/></p>';
4691  $this->assertSame($expect, $this->subject->stdWrap_debug($content));
4692  }
4693 
4720  public function ‪stdWrap_debugData(): void
4721  {
4722  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
4723  $content = $this->getUniqueId('content');
4724  $key = $this->getUniqueId('key');
4725  $value = $this->getUniqueId('value');
4726  $altValue = $this->getUniqueId('value alt');
4727  $this->subject->data = [$key => $value];
4728  // Without alternative data only data is returned.
4729  ob_start();
4730  $result = $this->subject->stdWrap_debugData($content);
4731  $out = ob_get_clean();
4732  $this->assertSame($result, $content);
4733  $this->assertContains('$cObj->data', $out);
4734  $this->assertContains($value, $out);
4735  $this->assertNotContains($altValue, $out);
4736  // By adding alternative data both are returned together.
4737  $this->subject->alternativeData = [$key => $altValue];
4738  ob_start();
4739  $this->subject->stdWrap_debugData($content);
4740  $out = ob_get_clean();
4741  $this->assertNotContains('$cObj->alternativeData', $out);
4742  $this->assertContains($value, $out);
4743  $this->assertContains($altValue, $out);
4744  }
4751  public function ‪stdWrap_debugFuncDataProvider(): array
4752  {
4753  return [
4754  'expect array by string' => [true, '2'],
4755  'expect array by integer' => [true, 2],
4756  'do not expect array' => [false, ''],
4757  ];
4758  }
4759 
4781  public function ‪stdWrap_debugFunc(bool $expectArray, $confDebugFunc): void
4782  {
4783  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'] = '*';
4784  $content = $this->getUniqueId('content');
4785  $conf = ['debugFunc' => $confDebugFunc];
4786  ob_start();
4787  $result = $this->subject->stdWrap_debugFunc($content, $conf);
4788  $out = ob_get_clean();
4789  $this->assertSame($result, $content);
4790  $this->assertContains($content, $out);
4791  if ($expectArray) {
4792  $this->assertContains('=>', $out);
4793  } else {
4794  $this->assertNotContains('=>', $out);
4795  }
4796  }
4803  public function ‪stdWrapDoubleBrTagDataProvider(): array
4804  {
4805  return [
4806  'no config: void input' => [
4807  '',
4808  '',
4809  [],
4810  ],
4811  'no config: single break' => [
4812  'one' . LF . 'two',
4813  'one' . LF . 'two',
4814  [],
4815  ],
4816  'no config: double break' => [
4817  'onetwo',
4818  'one' . LF . LF . 'two',
4819  [],
4820  ],
4821  'no config: double break with whitespace' => [
4822  'onetwo',
4823  'one' . LF . "\t" . ' ' . "\t" . ' ' . LF . 'two',
4824  [],
4825  ],
4826  'no config: single break around' => [
4827  LF . 'one' . LF,
4828  LF . 'one' . LF,
4829  [],
4830  ],
4831  'no config: double break around' => [
4832  'one',
4833  LF . LF . 'one' . LF . LF,
4834  [],
4835  ],
4836  'empty string: double break around' => [
4837  'one',
4838  LF . LF . 'one' . LF . LF,
4839  ['doubleBrTag' => ''],
4840  ],
4841  'br tag: double break' => [
4842  'one<br/>two',
4843  'one' . LF . LF . 'two',
4844  ['doubleBrTag' => '<br/>'],
4845  ],
4846  'br tag: double break around' => [
4847  '<br/>one<br/>',
4848  LF . LF . 'one' . LF . LF,
4849  ['doubleBrTag' => '<br/>'],
4850  ],
4851  'double br tag: double break around' => [
4852  '<br/><br/>one<br/><br/>',
4853  LF . LF . 'one' . LF . LF,
4854  ['doubleBrTag' => '<br/><br/>'],
4855  ],
4856  ];
4857  }
4858 
4868  public function ‪stdWrap_doubleBrTag(string $expected, string $input, array $config): void
4869  {
4870  $this->assertEquals($expected, $this->subject->stdWrap_doubleBrTag($input, $config));
4871  }
4878  public function ‪stdWrap_editIconsDataProvider(): array
4879  {
4880  $content = $this->getUniqueId('content');
4881  $editIcons = $this->getUniqueId('editIcons');
4882  $editIconsArray = [$this->getUniqueId('editIcons.')];
4883  $will = $this->getUniqueId('will');
4884  return [
4885  'standard case calls edit icons' => [
4886  $will,
4887  $content,
4888  ['editIcons' => $editIcons, 'editIcons.' => $editIconsArray],
4889  true,
4890  1,
4891  $editIconsArray,
4892  $will
4893  ],
4894  'null in editIcons. repalaced by []' => [
4895  $will,
4896  $content,
4897  ['editIcons' => $editIcons, 'editIcons.' => null],
4898  true,
4899  1,
4900  [],
4901  $will
4902  ],
4903  'missing editIcons. replaced by []' => [
4904  $will,
4905  $content,
4906  ['editIcons' => $editIcons],
4907  true,
4908  1,
4909  [],
4910  $will
4911  ],
4912  'no user login disables call' => [
4913  $content,
4914  $content,
4915  ['editIcons' => $editIcons, 'editIcons.' => $editIconsArray],
4916  false,
4917  0,
4918  $editIconsArray,
4919  $will
4920  ],
4921  'empty string in editIcons disables call' => [
4922  $content,
4923  $content,
4924  ['editIcons' => '', 'editIcons.' => $editIconsArray],
4925  true,
4926  0,
4927  $editIconsArray,
4928  $will
4929  ],
4930  'zero string in editIcons disables call' => [
4931  $content,
4932  $content,
4933  ['editIcons' => '0', 'editIcons.' => $editIconsArray],
4934  true,
4935  0,
4936  $editIconsArray,
4937  $will
4938  ],
4939  ];
4940  }
4941 
4968  public function ‪stdWrap_editIcons(
4969  string $expect,
4970  string $content,
4971  array $conf,
4972  bool $login,
4973  int $times,
4974  array $param3,
4975  string $will
4976  ): void {
4977  if ($login) {
4978  $backendUser = new ‪BackendUserAuthentication();
4979  $backendUser->user['uid'] = 13;
4980  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new ‪UserAspect($backendUser));
4981  } else {
4982  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect());
4983  }
4984  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
4985  ->setMethods(['editIcons'])->getMock();
4986  ‪$subject
4987  ->expects($this->exactly($times))
4988  ->method('editIcons')
4989  ->with($content, $conf['editIcons'], $param3)
4990  ->willReturn($will);
4991  $this->assertSame(
4992  $expect,
4993  ‪$subject->‪stdWrap_editIcons($content, $conf)
4994  );
4995  }
4996 
5009  public function ‪stdWrap_encapsLines(): void
5010  {
5011  $content = $this->getUniqueId('content');
5012  $conf = [
5013  'encapsLines' => [$this->getUniqueId('not used')],
5014  'encapsLines.' => [$this->getUniqueId('encapsLines.')],
5015  ];
5016  $return = $this->getUniqueId('return');
5017  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5018  ->setMethods(['encaps_lineSplit'])->getMock();
5019  ‪$subject
5020  ->expects($this->once())
5021  ->method('encaps_lineSplit')
5022  ->with($content, $conf['encapsLines.'])
5023  ->willReturn($return);
5024  $this->assertSame(
5025  $return,
5026  ‪$subject->‪stdWrap_encapsLines($content, $conf)
5027  );
5028  }
5029 
5040  public function ‪stdWrap_encapsLines_HTML5SelfClosingTags(string $input, string $expected): void
5041  {
5042  $rteParseFunc = $this->‪getLibParseFunc_RTE();
5043 
5044  $conf = [
5045  'encapsLines' => $rteParseFunc['parseFunc.']['nonTypoTagStdWrap.']['encapsLines'] ?? null,
5046  'encapsLines.' => $rteParseFunc['parseFunc.']['nonTypoTagStdWrap.']['encapsLines.'] ?? null,
5047  ];
5048  // don't add an &nbsp; to tag without content
5049  $conf['encapsLines.']['innerStdWrap_all.']['ifBlank'] = '';
5050  $additionalEncapsTags = ['a', 'b', 'span'];
5051 
5052  // We want to allow any tag to be an encapsulating tag
5053  // since this is possible and we don't want an additional tag to be wrapped around.
5054  $conf['encapsLines.']['encapsTagList'] .= ',' . implode(',', $additionalEncapsTags);
5055  $conf['encapsLines.']['encapsTagList'] .= ',' . implode(',', [$input]);
5056 
5057  // Check if we get a self-closing tag for
5058  // empty tags where this is allowed according to HTML5
5059  $content = '<' . $input . ' id="myId" class="bodytext" />';
5060  $result = $this->subject->stdWrap_encapsLines($content, $conf);
5061  $this->assertSame($expected, $result);
5062  }
5063 
5067  public function ‪html5SelfClosingTagsDataprovider(): array
5068  {
5069  return [
5070  'areaTag_selfclosing' => [
5071  'input' => 'area',
5072  'expected' => '<area id="myId" class="bodytext" />'
5073  ],
5074  'base_selfclosing' => [
5075  'input' => 'base',
5076  'expected' => '<base id="myId" class="bodytext" />'
5077  ],
5078  'br_selfclosing' => [
5079  'input' => 'br',
5080  'expected' => '<br id="myId" class="bodytext" />'
5081  ],
5082  'col_selfclosing' => [
5083  'input' => 'col',
5084  'expected' => '<col id="myId" class="bodytext" />'
5085  ],
5086  'embed_selfclosing' => [
5087  'input' => 'embed',
5088  'expected' => '<embed id="myId" class="bodytext" />'
5089  ],
5090  'hr_selfclosing' => [
5091  'input' => 'hr',
5092  'expected' => '<hr id="myId" class="bodytext" />'
5093  ],
5094  'img_selfclosing' => [
5095  'input' => 'img',
5096  'expected' => '<img id="myId" class="bodytext" />'
5097  ],
5098  'input_selfclosing' => [
5099  'input' => 'input',
5100  'expected' => '<input id="myId" class="bodytext" />'
5101  ],
5102  'keygen_selfclosing' => [
5103  'input' => 'keygen',
5104  'expected' => '<keygen id="myId" class="bodytext" />'
5105  ],
5106  'link_selfclosing' => [
5107  'input' => 'link',
5108  'expected' => '<link id="myId" class="bodytext" />'
5109  ],
5110  'meta_selfclosing' => [
5111  'input' => 'meta',
5112  'expected' => '<meta id="myId" class="bodytext" />'
5113  ],
5114  'param_selfclosing' => [
5115  'input' => 'param',
5116  'expected' => '<param id="myId" class="bodytext" />'
5117  ],
5118  'source_selfclosing' => [
5119  'input' => 'source',
5120  'expected' => '<source id="myId" class="bodytext" />'
5121  ],
5122  'track_selfclosing' => [
5123  'input' => 'track',
5124  'expected' => '<track id="myId" class="bodytext" />'
5125  ],
5126  'wbr_selfclosing' => [
5127  'input' => 'wbr',
5128  'expected' => '<wbr id="myId" class="bodytext" />'
5129  ],
5130  'p_notselfclosing' => [
5131  'input' => 'p',
5132  'expected' => '<p id="myId" class="bodytext"></p>'
5133  ],
5134  'a_notselfclosing' => [
5135  'input' => 'a',
5136  'expected' => '<a id="myId" class="bodytext"></a>'
5137  ],
5138  'strong_notselfclosing' => [
5139  'input' => 'strong',
5140  'expected' => '<strong id="myId" class="bodytext"></strong>'
5141  ],
5142  'span_notselfclosing' => [
5143  'input' => 'span',
5144  'expected' => '<span id="myId" class="bodytext"></span>'
5145  ],
5146  ];
5147  }
5154  public function ‪stdWrap_editPanelDataProvider(): array
5155  {
5156  $content = $this->getUniqueId('content');
5157  $will = $this->getUniqueId('will');
5158  return [
5159  'standard case calls edit icons' => [
5160  $will,
5161  $content,
5162  true,
5163  1,
5164  $will
5165  ],
5166  'no user login disables call' => [
5167  $content,
5168  $content,
5169  false,
5170  0,
5171  $will
5172  ],
5173  ];
5174  }
5175 
5197  public function ‪stdWrap_editPanel(
5198  string $expect,
5199  string $content,
5200  bool $login,
5201  int $times,
5202  string $will
5203  ): void {
5204  if ($login) {
5205  $backendUser = new ‪BackendUserAuthentication();
5206  $backendUser->user['uid'] = 13;
5207  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new ‪UserAspect($backendUser));
5208  } else {
5209  GeneralUtility::makeInstance(Context::class)->setAspect('backend.user', new UserAspect());
5210  }
5211  $conf = ['editPanel.' => [$this->getUniqueId('editPanel.')]];
5212  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5213  ->setMethods(['editPanel'])->getMock();
5214  ‪$subject
5215  ->expects($this->exactly($times))
5216  ->method('editPanel')
5217  ->with($content, $conf['editPanel.'])
5218  ->willReturn($will);
5219  $this->assertSame(
5220  $expect,
5221  ‪$subject->‪stdWrap_editPanel($content, $conf)
5222  );
5223  }
5230  public function ‪stdWrap_encodeForJavaScriptValueDataProvider(): array
5231  {
5232  return [
5233  'double quote in string' => [
5234  '\'double\u0020quote\u0022\'',
5235  'double quote"'
5236  ],
5237  'backslash in string' => [
5238  '\'backslash\u0020\u005C\'',
5239  'backslash \\'
5240  ],
5241  'exclamation mark' => [
5242  '\'exclamation\u0021\'',
5243  'exclamation!'
5244  ],
5245  'whitespace tab, newline and carriage return' => [
5246  '\'white\u0009space\u000As\u000D\'',
5247  "white\tspace\ns\r"
5248  ],
5249  'single quote in string' => [
5250  '\'single\u0020quote\u0020\u0027\'',
5251  'single quote \''
5252  ],
5253  'tag' => [
5254  '\'\u003Ctag\u003E\'',
5255  '<tag>'
5256  ],
5257  'ampersand in string' => [
5258  '\'amper\u0026sand\'',
5259  'amper&sand'
5260  ]
5261  ];
5262  }
5263 
5272  public function ‪stdWrap_encodeForJavaScriptValue(string $expect, string $content): void
5273  {
5274  $this->assertSame(
5275  $expect,
5276  $this->subject->stdWrap_encodeForJavaScriptValue($content)
5277  );
5278  }
5285  public function ‪stdWrap_expandListDataProvider(): array
5286  {
5287  return [
5288  'numbers' => ['1,2,3', '1,2,3'],
5289  'range' => ['3,4,5', '3-5'],
5290  'numbers and range' => ['1,3,4,5,7', '1,3-5,7']
5291  ];
5292  }
5293 
5307  public function ‪stdWrap_expandList(string $expected, string $content): void
5308  {
5309  $this->assertEquals(
5310  $expected,
5311  $this->subject->stdWrap_expandList($content)
5312  );
5313  }
5314 
5325  public function ‪stdWrap_field(): void
5326  {
5327  $expect = $this->getUniqueId('expect');
5328  $conf = ['field' => $this->getUniqueId('field')];
5329  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5330  ->setMethods(['getFieldVal'])->getMock();
5331  ‪$subject
5332  ->expects($this->once())
5333  ->method('getFieldVal')
5334  ->with($conf['field'])
5335  ->willReturn($expect);
5336  $this->assertSame(
5337  $expect,
5338  ‪$subject->‪stdWrap_field('discarded', $conf)
5339  );
5340  }
5347  public function ‪stdWrap_fieldRequiredDataProvider(): array
5348  {
5349  $content = $this->getUniqueId('content');
5350  return [
5351  // resulting in boolean false
5352  'false is false' => [
5353  '',
5354  true,
5355  $content,
5356  ['fieldRequired' => 'false']
5357  ],
5358  'null is false' => [
5359  '',
5360  true,
5361  $content,
5362  ['fieldRequired' => 'null']
5363  ],
5364  'empty string is false' => [
5365  '',
5366  true,
5367  $content,
5368  ['fieldRequired' => 'empty']
5369  ],
5370  'whitespace is false' => [
5371  '',
5372  true,
5373  $content,
5374  ['fieldRequired' => 'whitespace']
5375  ],
5376  'string zero is false' => [
5377  '',
5378  true,
5379  $content,
5380  ['fieldRequired' => 'stringZero']
5381  ],
5382  'string zero with whitespace is false' => [
5383  '',
5384  true,
5385  $content,
5386  ['fieldRequired' => 'stringZeroWithWhiteSpace']
5387  ],
5388  'zero is false' => [
5389  '',
5390  true,
5391  $content,
5392  ['fieldRequired' => 'zero']
5393  ],
5394  // resulting in boolean true
5395  'true is true' => [
5396  $content,
5397  false,
5398  $content,
5399  ['fieldRequired' => 'true']
5400  ],
5401  'string is true' => [
5402  $content,
5403  false,
5404  $content,
5405  ['fieldRequired' => 'string']
5406  ],
5407  'one is true' => [
5408  $content,
5409  false,
5410  $content,
5411  ['fieldRequired' => 'one']
5412  ]
5413  ];
5414  }
5415 
5435  public function ‪stdWrap_fieldRequired(string $expect, bool $stop, string $content, array $conf): void
5436  {
5437  $data = [
5438  'null' => null,
5439  'false' => false,
5440  'empty' => '',
5441  'whitespace' => "\t" . ' ',
5442  'stringZero' => '0',
5443  'stringZeroWithWhiteSpace' => "\t" . ' 0 ' . "\t",
5444  'zero' => 0,
5445  'string' => 'string',
5446  'true' => true,
5447  'one' => 1
5448  ];
5450  ‪$subject->_set('data', $data);
5451  ‪$subject->_set('stdWrapRecursionLevel', 1);
5452  ‪$subject->_set('stopRendering', [1 => false]);
5453  $this->assertSame(
5454  $expect,
5455  ‪$subject->‪stdWrap_fieldRequired($content, $conf)
5456  );
5457  $this->assertSame($stop, ‪$subject->_get('stopRendering')[1]);
5458  }
5465  public function ‪hashDataProvider(): array
5466  {
5467  return [
5468  'md5' => [
5469  'bacb98acf97e0b6112b1d1b650b84971',
5470  'joh316',
5471  ['hash' => 'md5']
5472  ],
5473  'sha1' => [
5474  '063b3d108bed9f88fa618c6046de0dccadcf3158',
5475  'joh316',
5476  ['hash' => 'sha1']
5477  ],
5478  'stdWrap capability' => [
5479  'bacb98acf97e0b6112b1d1b650b84971',
5480  'joh316',
5481  [
5482  'hash' => '5',
5483  'hash.' => ['wrap' => 'md|']
5484  ]
5485  ],
5486  'non-existing hashing algorithm' => [
5487  '',
5488  'joh316',
5489  ['hash' => 'non-existing']
5490  ]
5491  ];
5492  }
5493 
5509  public function ‪stdWrap_hash(string $expect, string $content, array $conf): void
5510  {
5511  $this->assertSame(
5512  $expect,
5513  $this->subject->stdWrap_hash($content, $conf)
5514  );
5515  }
5522  public function ‪stdWrap_htmlSpecialCharsDataProvider(): array
5523  {
5524  return [
5525  'void conf' => [
5526  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5527  '<span>1 &lt; 2</span>',
5528  [],
5529  ],
5530  'void preserveEntities' => [
5531  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5532  '<span>1 &lt; 2</span>',
5533  ['htmlSpecialChars.' => []],
5534  ],
5535  'false preserveEntities' => [
5536  '&lt;span&gt;1 &amp;lt; 2&lt;/span&gt;',
5537  '<span>1 &lt; 2</span>',
5538  ['htmlSpecialChars.' => ['preserveEntities' => 0]],
5539  ],
5540  'true preserveEntities' => [
5541  '&lt;span&gt;1 &lt; 2&lt;/span&gt;',
5542  '<span>1 &lt; 2</span>',
5543  ['htmlSpecialChars.' => ['preserveEntities' => 1]],
5544  ],
5545  ];
5546  }
5547 
5557  public function ‪stdWrap_htmlSpecialChars(string $expected, string $input, array $conf): void
5558  {
5559  $this->assertSame(
5560  $expected,
5561  $this->subject->stdWrap_htmlSpecialChars($input, $conf)
5562  );
5563  }
5570  public function ‪stdWrap_ifDataProvider(): array
5571  {
5572  $content = $this->getUniqueId('content');
5573  $conf = ['if.' => [$this->getUniqueId('if.')]];
5574  return [
5575  // evals to true
5576  'empty config' => [
5577  $content,
5578  false,
5579  $content,
5580  [],
5581  0,
5582  null
5583  ],
5584  'if. is empty array' => [
5585  $content,
5586  false,
5587  $content,
5588  ['if.' => []],
5589  0,
5590  null
5591  ],
5592  'if. is null' => [
5593  $content,
5594  false,
5595  $content,
5596  ['if.' => null],
5597  0,
5598  null
5599  ],
5600  'if. is false' => [
5601  $content,
5602  false,
5603  $content,
5604  ['if.' => false],
5605  0,
5606  null
5607  ],
5608  'if. is 0' => [
5609  $content,
5610  false,
5611  $content,
5612  ['if.' => false],
5613  0,
5614  null
5615  ],
5616  'if. is "0"' => [
5617  $content,
5618  false,
5619  $content,
5620  ['if.' => '0'],
5621  0,
5622  null
5623  ],
5624  'checkIf returning true' => [
5625  $content,
5626  false,
5627  $content,
5628  $conf,
5629  1,
5630  true
5631  ],
5632  // evals to false
5633  'checkIf returning false' => [
5634  '',
5635  true,
5636  $content,
5637  $conf,
5638  1,
5639  false
5640  ],
5641  ];
5642  }
5643 
5664  public function ‪stdWrap_if(string $expect, bool $stop, string $content, array $conf, int $times, $will): void
5665  {
5666  ‪$subject = $this->getAccessibleMock(
5667  ContentObjectRenderer::class,
5668  ['checkIf']
5669  );
5670  ‪$subject->_set('stdWrapRecursionLevel', 1);
5671  ‪$subject->_set('stopRendering', [1 => false]);
5672  ‪$subject
5673  ->expects($this->exactly($times))
5674  ->method('checkIf')
5675  ->with($conf['if.'] ?? null)
5676  ->willReturn($will);
5677  $this->assertSame($expect, ‪$subject->‪stdWrap_if($content, $conf));
5678  $this->assertSame($stop, ‪$subject->_get('stopRendering')[1]);
5679  }
5686  public function ‪stdWrap_ifBlankDataProvider(): array
5687  {
5688  $alt = $this->getUniqueId('alternative content');
5689  $conf = ['ifBlank' => $alt];
5690  return [
5691  // blank cases
5692  'null is blank' => [$alt, null, $conf],
5693  'false is blank' => [$alt, false, $conf],
5694  'empty string is blank' => [$alt, '', $conf],
5695  'whitespace is blank' => [$alt, "\t" . '', $conf],
5696  // non-blank cases
5697  'string is not blank' => ['string', 'string', $conf],
5698  'zero is not blank' => [0, 0, $conf],
5699  'zero string is not blank' => ['0', '0', $conf],
5700  'zero float is not blank' => [0.0, 0.0, $conf],
5701  'true is not blank' => [true, true, $conf],
5702  ];
5703  }
5704 
5721  public function ‪stdWrap_ifBlank($expect, $content, array $conf): void
5722  {
5723  $result = $this->subject->stdWrap_ifBlank($content, $conf);
5724  $this->assertSame($expect, $result);
5725  }
5732  public function ‪stdWrap_ifEmptyDataProvider(): array
5733  {
5734  $alt = $this->getUniqueId('alternative content');
5735  $conf = ['ifEmpty' => $alt];
5736  return [
5737  // empty cases
5738  'null is empty' => [$alt, null, $conf],
5739  'false is empty' => [$alt, false, $conf],
5740  'zero is empty' => [$alt, 0, $conf],
5741  'float zero is empty' => [$alt, 0.0, $conf],
5742  'whitespace is empty' => [$alt, "\t" . ' ', $conf],
5743  'empty string is empty' => [$alt, '', $conf],
5744  'zero string is empty' => [$alt, '0', $conf],
5745  'zero string is empty with whitespace' => [
5746  $alt,
5747  "\t" . ' 0 ' . "\t",
5748  $conf
5749  ],
5750  // non-empty cases
5751  'string is not empty' => ['string', 'string', $conf],
5752  '1 is not empty' => [1, 1, $conf],
5753  '-1 is not empty' => [-1, -1, $conf],
5754  '0.1 is not empty' => [0.1, 0.1, $conf],
5755  '-0.1 is not empty' => [-0.1, -0.1, $conf],
5756  'true is not empty' => [true, true, $conf],
5757  ];
5758  }
5759 
5775  public function ‪stdWrap_ifEmpty($expect, $content, array $conf): void
5776  {
5777  $result = $this->subject->stdWrap_ifEmpty($content, $conf);
5778  $this->assertSame($expect, $result);
5779  }
5786  public function ‪stdWrap_ifNullDataProvider(): array
5787  {
5788  $alt = $this->getUniqueId('alternative content');
5789  $conf = ['ifNull' => $alt];
5790  return [
5791  'only null is null' => [$alt, null, $conf],
5792  'zero is not null' => [0, 0, $conf],
5793  'float zero is not null' => [0.0, 0.0, $conf],
5794  'false is not null' => [false, false, $conf],
5795  'zero is not null' => [0, 0, $conf],
5796  'zero string is not null' => ['0', '0', $conf],
5797  'empty string is not null' => ['', '', $conf],
5798  'whitespace is not null' => ["\t" . '', "\t" . '', $conf],
5799  ];
5800  }
5801 
5817  public function ‪stdWrap_ifNull($expect, $content, array $conf): void
5818  {
5819  $result = $this->subject->stdWrap_ifNull($content, $conf);
5820  $this->assertSame($expect, $result);
5821  }
5828  public function ‪stdWrap_innerWrapDataProvider(): array
5829  {
5830  return [
5831  'no conf' => [
5832  'XXX',
5833  'XXX',
5834  [],
5835  ],
5836  'simple' => [
5837  '<wrap>XXX</wrap>',
5838  'XXX',
5839  ['innerWrap' => '<wrap>|</wrap>'],
5840  ],
5841  'missing pipe puts wrap before' => [
5842  '<pre>XXX',
5843  'XXX',
5844  ['innerWrap' => '<pre>'],
5845  ],
5846  'trims whitespace' => [
5847  '<wrap>XXX</wrap>',
5848  'XXX',
5849  ['innerWrap' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
5850  ],
5851  'split char change is not possible' => [
5852  '<wrap> # </wrap>XXX',
5853  'XXX',
5854  [
5855  'innerWrap' => '<wrap> # </wrap>',
5856  'innerWrap.' => ['splitChar' => '#'],
5857  ],
5858  ],
5859  ];
5860  }
5861 
5871  public function ‪stdWrap_innerWrap(string $expected, string $input, array $conf): void
5872  {
5873  $this->assertSame(
5874  $expected,
5875  $this->subject->stdWrap_innerWrap($input, $conf)
5876  );
5877  }
5884  public function ‪stdWrap_innerWrap2DataProvider(): array
5885  {
5886  return [
5887  'no conf' => [
5888  'XXX',
5889  'XXX',
5890  [],
5891  ],
5892  'simple' => [
5893  '<wrap>XXX</wrap>',
5894  'XXX',
5895  ['innerWrap2' => '<wrap>|</wrap>'],
5896  ],
5897  'missing pipe puts wrap before' => [
5898  '<pre>XXX',
5899  'XXX',
5900  ['innerWrap2' => '<pre>'],
5901  ],
5902  'trims whitespace' => [
5903  '<wrap>XXX</wrap>',
5904  'XXX',
5905  ['innerWrap2' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
5906  ],
5907  'split char change is not possible' => [
5908  '<wrap> # </wrap>XXX',
5909  'XXX',
5910  [
5911  'innerWrap2' => '<wrap> # </wrap>',
5912  'innerWrap2.' => ['splitChar' => '#'],
5913  ],
5914  ],
5915  ];
5916  }
5917 
5927  public function ‪stdWrap_innerWrap2(string $expected, string $input, array $conf): void
5928  {
5929  $this->assertSame(
5930  $expected,
5931  $this->subject->stdWrap_innerWrap2($input, $conf)
5932  );
5933  }
5934 
5946  public function ‪stdWrap_insertData(): void
5947  {
5948  $content = $this->getUniqueId('content');
5949  $conf = [$this->getUniqueId('conf not used')];
5950  $return = $this->getUniqueId('return');
5951  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
5952  ->setMethods(['insertData'])->getMock();
5953  ‪$subject->expects($this->once())->method('insertData')
5954  ->with($content)->willReturn($return);
5955  $this->assertSame(
5956  $return,
5957  ‪$subject->‪stdWrap_insertData($content, $conf)
5958  );
5959  }
5966  public function ‪stdWrap_insertDataProvider(): array
5967  {
5968  return [
5969  'empty' => ['', ''],
5970  'notFoundData' => ['any=1', 'any{$string}=1'],
5971  'queryParameter' => ['any{#string}=1', 'any{#string}=1'],
5972  ];
5973  }
5974 
5983  public function ‪stdWrap_insertDataAndInputExamples($expect, string $content): void
5984  {
5985  $this->assertSame($expect, $this->subject->stdWrap_insertData($content));
5986  }
5993  public function ‪stdWrap_intvalDataProvider(): array
5994  {
5995  return [
5996  // numbers
5997  'int' => [123, 123],
5998  'float' => [123, 123.45],
5999  'float does not round up' => [123, 123.55],
6000  // negative numbers
6001  'negative int' => [-123, -123],
6002  'negative float' => [-123, -123.45],
6003  'negative float does not round down' => [-123, -123.55],
6004  // strings
6005  'word string' => [0, 'string'],
6006  'empty string' => [0, ''],
6007  'zero string' => [0, '0'],
6008  'int string' => [123, '123'],
6009  'float string' => [123, '123.55'],
6010  'negative float string' => [-123, '-123.55'],
6011  // other types
6012  'null' => [0, null],
6013  'true' => [1, true],
6014  'false' => [0, false]
6015  ];
6016  }
6017 
6037  public function ‪stdWrap_intval(int $expect, $content): void
6038  {
6039  $this->assertSame($expect, $this->subject->stdWrap_intval($content));
6040  }
6047  public function ‪stdWrapKeywordsDataProvider(): array
6048  {
6049  return [
6050  'empty string' => ['', ''],
6051  'blank' => ['', ' '],
6052  'tab' => ['', "\t"],
6053  'single semicolon' => [',', ' ; '],
6054  'single comma' => [',', ' , '],
6055  'single nl' => [',', ' ' . PHP_EOL . ' '],
6056  'double semicolon' => [',,', ' ; ; '],
6057  'double comma' => [',,', ' , , '],
6058  'double nl' => [',,', ' ' . PHP_EOL . ' ' . PHP_EOL . ' '],
6059  'simple word' => ['one', ' one '],
6060  'simple word trimmed' => ['one', 'one'],
6061  ', separated' => ['one,two', ' one , two '],
6062  '; separated' => ['one,two', ' one ; two '],
6063  'nl separated' => ['one,two', ' one ' . PHP_EOL . ' two '],
6064  ', typical' => ['one,two,three', 'one, two, three'],
6065  '; typical' => ['one,two,three', ' one; two; three'],
6066  'nl typical' => [
6067  'one,two,three',
6068  'one' . PHP_EOL . 'two' . PHP_EOL . 'three'
6069  ],
6070  ', sourounded' => [',one,two,', ' , one , two , '],
6071  '; sourounded' => [',one,two,', ' ; one ; two ; '],
6072  'nl sourounded' => [
6073  ',one,two,',
6074  ' ' . PHP_EOL . ' one ' . PHP_EOL . ' two ' . PHP_EOL . ' '
6075  ],
6076  'mixed' => [
6077  'one,two,three,four',
6078  ' one, two; three' . PHP_EOL . 'four'
6079  ],
6080  'keywods with blanks in words' => [
6081  'one plus,two minus',
6082  ' one plus , two minus ',
6083  ]
6084  ];
6085  }
6086 
6095  public function ‪stdWrap_keywords(string $expected, string $input): void
6096  {
6097  $this->assertSame($expected, $this->subject->stdWrap_keywords($input));
6098  }
6105  public function ‪stdWrap_langDataProvider(): array
6106  {
6107  return [
6108  'empty conf' => [
6109  'original',
6110  'original',
6111  [],
6112  'de',
6113  ],
6114  'translation de' => [
6115  'Ãœbersetzung',
6116  'original',
6117  [
6118  'lang.' => [
6119  'de' => 'Ãœbersetzung',
6120  'it' => 'traduzione',
6121  ]
6122  ],
6123  'de',
6124  ],
6125  'translation it' => [
6126  'traduzione',
6127  'original',
6128  [
6129  'lang.' => [
6130  'de' => 'Ãœbersetzung',
6131  'it' => 'traduzione',
6132  ]
6133  ],
6134  'it',
6135  ],
6136  'no translation' => [
6137  'original',
6138  'original',
6139  [
6140  'lang.' => [
6141  'de' => 'Ãœbersetzung',
6142  'it' => 'traduzione',
6143  ]
6144  ],
6145  '',
6146  ],
6147  'missing label' => [
6148  'original',
6149  'original',
6150  [
6151  'lang.' => [
6152  'de' => 'Ãœbersetzung',
6153  'it' => 'traduzione',
6154  ]
6155  ],
6156  'fr',
6157  ],
6158  ];
6159  }
6160 
6171  public function ‪stdWrap_langViaTSFE(string $expected, string $input, array $conf, string $language): void
6172  {
6173  if ($language) {
6174  $this->frontendControllerMock
6175  ->config['config']['language'] = $language;
6176  }
6177  $this->assertSame(
6178  $expected,
6179  $this->subject->stdWrap_lang($input, $conf)
6180  );
6181  }
6182 
6193  public function ‪stdWrap_langViaSiteLanguage(string $expected, string $input, array $conf, string $language): void
6194  {
6195  if ($language) {
6196  $site = $this->‪createSiteWithLanguage([
6197  'base' => '/',
6198  'languageId' => 2,
6199  'locale' => 'en_UK',
6200  'typo3Language' => $language,
6201  ]);
6202  $request = new ServerRequest();
6203  ‪$GLOBALS['TYPO3_REQUEST'] = $request->withAttribute(
6204  'language',
6205  $site->getLanguageById(2)
6206  );
6207  }
6208  $this->assertSame(
6209  $expected,
6210  $this->subject->stdWrap_lang($input, $conf)
6211  );
6212  }
6213 
6227  public function ‪stdWrap_listNum(): void
6228  {
6229  $content = $this->getUniqueId('content');
6230  $conf = [
6231  'listNum' => $this->getUniqueId('listNum'),
6232  'listNum.' => [
6233  'splitChar' => $this->getUniqueId('splitChar')
6234  ],
6235  ];
6236  $return = $this->getUniqueId('return');
6237  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6238  ->setMethods(['listNum'])->getMock();
6239  ‪$subject
6240  ->expects($this->once())
6241  ->method('listNum')
6242  ->with(
6243  $content,
6244  $conf['listNum'],
6245  $conf['listNum.']['splitChar']
6246  )
6247  ->willReturn($return);
6248  $this->assertSame(
6249  $return,
6250  ‪$subject->‪stdWrap_listNum($content, $conf)
6251  );
6252  }
6259  public function ‪stdWrap_noTrimWrapDataProvider(): array
6260  {
6261  return [
6262  'Standard case' => [
6263  ' left middle right ',
6264  'middle',
6265  [
6266  'noTrimWrap' => '| left | right |',
6267  ],
6268  ],
6269  'Tabs as whitespace' => [
6270  "\t" . 'left' . "\t" . 'middle' . "\t" . 'right' . "\t",
6271  'middle',
6272  [
6273  'noTrimWrap' =>
6274  '|' . "\t" . 'left' . "\t" . '|' . "\t" . 'right' . "\t" . '|',
6275  ],
6276  ],
6277  'Split char is 0' => [
6278  ' left middle right ',
6279  'middle',
6280  [
6281  'noTrimWrap' => '0 left 0 right 0',
6282  'noTrimWrap.' => ['splitChar' => '0'],
6283  ],
6284  ],
6285  'Split char is pipe (default)' => [
6286  ' left middle right ',
6287  'middle',
6288  [
6289  'noTrimWrap' => '| left | right |',
6290  'noTrimWrap.' => ['splitChar' => '|'],
6291  ],
6292  ],
6293  'Split char is a' => [
6294  ' left middle right ',
6295  'middle',
6296  [
6297  'noTrimWrap' => 'a left a right a',
6298  'noTrimWrap.' => ['splitChar' => 'a'],
6299  ],
6300  ],
6301  'Split char is a word (ab)' => [
6302  ' left middle right ',
6303  'middle',
6304  [
6305  'noTrimWrap' => 'ab left ab right ab',
6306  'noTrimWrap.' => ['splitChar' => 'ab'],
6307  ],
6308  ],
6309  'Split char accepts stdWrap' => [
6310  ' left middle right ',
6311  'middle',
6312  [
6313  'noTrimWrap' => 'abc left abc right abc',
6314  'noTrimWrap.' => [
6315  'splitChar' => 'b',
6316  'splitChar.' => ['wrap' => 'a|c'],
6317  ],
6318  ],
6319  ],
6320  ];
6321  }
6322 
6332  public function ‪stdWrap_noTrimWrap(string $expect, string $content, array $conf): void
6333  {
6334  $this->assertSame(
6335  $expect,
6336  $this->subject->stdWrap_noTrimWrap($content, $conf)
6337  );
6338  }
6339 
6351  public function ‪stdWrap_numRows(): void
6352  {
6353  $conf = [
6354  'numRows' => $this->getUniqueId('numRows'),
6355  'numRows.' => [$this->getUniqueId('numRows')],
6356  ];
6357  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6358  ->setMethods(['numRows'])->getMock();
6359  ‪$subject->expects($this->once())->method('numRows')
6360  ->with($conf['numRows.'])->willReturn('return');
6361  $this->assertSame(
6362  'return',
6363  ‪$subject->‪stdWrap_numRows('discard', $conf)
6364  );
6365  }
6366 
6379  public function ‪stdWrap_numberFormat(): void
6380  {
6381  $content = $this->getUniqueId('content');
6382  $conf = [
6383  'numberFormat' => $this->getUniqueId('not used'),
6384  'numberFormat.' => [$this->getUniqueId('numberFormat.')],
6385  ];
6386  $return = $this->getUniqueId('return');
6387  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6388  ->setMethods(['numberFormat'])->getMock();
6389  ‪$subject
6390  ->expects($this->once())
6391  ->method('numberFormat')
6392  ->with($content, $conf['numberFormat.'])
6393  ->willReturn($return);
6394  $this->assertSame(
6395  $return,
6396  ‪$subject->‪stdWrap_numberFormat($content, $conf)
6397  );
6398  }
6405  public function ‪stdWrap_outerWrapDataProvider(): array
6406  {
6407  return [
6408  'no conf' => [
6409  'XXX',
6410  'XXX',
6411  [],
6412  ],
6413  'simple' => [
6414  '<wrap>XXX</wrap>',
6415  'XXX',
6416  ['outerWrap' => '<wrap>|</wrap>'],
6417  ],
6418  'missing pipe puts wrap before' => [
6419  '<pre>XXX',
6420  'XXX',
6421  ['outerWrap' => '<pre>'],
6422  ],
6423  'trims whitespace' => [
6424  '<wrap>XXX</wrap>',
6425  'XXX',
6426  ['outerWrap' => '<wrap>' . "\t" . ' | ' . "\t" . '</wrap>'],
6427  ],
6428  'split char change is not possible' => [
6429  '<wrap> # </wrap>XXX',
6430  'XXX',
6431  [
6432  'outerWrap' => '<wrap> # </wrap>',
6433  'outerWrap.' => ['splitChar' => '#'],
6434  ],
6435  ],
6436  ];
6437  }
6438 
6448  public function ‪stdWrap_outerWrap(string $expected, string $input, array $conf): void
6449  {
6450  $this->assertSame(
6451  $expected,
6452  $this->subject->stdWrap_outerWrap($input, $conf)
6453  );
6454  }
6461  public function ‪stdWrap_overrideDataProvider(): array
6462  {
6463  return [
6464  'standard case' => [
6465  'override',
6466  'content',
6467  ['override' => 'override']
6468  ],
6469  'empty conf does not override' => [
6470  'content',
6471  'content',
6472  []
6473  ],
6474  'empty string does not override' => [
6475  'content',
6476  'content',
6477  ['override' => '']
6478  ],
6479  'whitespace does not override' => [
6480  'content',
6481  'content',
6482  ['override' => ' ' . "\t"]
6483  ],
6484  'zero does not override' => [
6485  'content',
6486  'content',
6487  ['override' => 0]
6488  ],
6489  'false does not override' => [
6490  'content',
6491  'content',
6492  ['override' => false]
6493  ],
6494  'null does not override' => [
6495  'content',
6496  'content',
6497  ['override' => null]
6498  ],
6499  'one does override' => [
6500  1,
6501  'content',
6502  ['override' => 1]
6503  ],
6504  'minus one does override' => [
6505  -1,
6506  'content',
6507  ['override' => -1]
6508  ],
6509  'float does override' => [
6510  -0.1,
6511  'content',
6512  ['override' => -0.1]
6513  ],
6514  'true does override' => [
6515  true,
6516  'content',
6517  ['override' => true]
6518  ],
6519  'the value is not trimmed' => [
6520  "\t" . 'override',
6521  'content',
6522  ['override' => "\t" . 'override']
6523  ],
6524  ];
6525  }
6526 
6536  public function ‪stdWrap_override($expect, string $content, array $conf): void
6537  {
6538  $this->assertSame(
6539  $expect,
6540  $this->subject->stdWrap_override($content, $conf)
6541  );
6542  }
6543 
6557  public function ‪stdWrap_parseFunc(): void
6558  {
6559  $content = $this->getUniqueId('content');
6560  $conf = [
6561  'parseFunc' => $this->getUniqueId('parseFunc'),
6562  'parseFunc.' => [$this->getUniqueId('parseFunc.')],
6563  ];
6564  $return = $this->getUniqueId('return');
6565  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6566  ->setMethods(['parseFunc'])->getMock();
6567  ‪$subject
6568  ->expects($this->once())
6569  ->method('parseFunc')
6570  ->with($content, $conf['parseFunc.'], $conf['parseFunc'])
6571  ->willReturn($return);
6572  $this->assertSame(
6573  $return,
6574  ‪$subject->‪stdWrap_parseFunc($content, $conf)
6575  );
6576  }
6577 
6591  public function ‪stdWrap_postCObject(): void
6592  {
6593  $debugKey = '/stdWrap/.postCObject';
6594  $content = $this->getUniqueId('content');
6595  $conf = [
6596  'postCObject' => $this->getUniqueId('postCObject'),
6597  'postCObject.' => [$this->getUniqueId('postCObject.')],
6598  ];
6599  $return = $this->getUniqueId('return');
6600  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6601  ->setMethods(['cObjGetSingle'])->getMock();
6602  ‪$subject
6603  ->expects($this->once())
6604  ->method('cObjGetSingle')
6605  ->with($conf['postCObject'], $conf['postCObject.'], $debugKey)
6606  ->willReturn($return);
6607  $this->assertSame(
6608  $content . $return,
6609  ‪$subject->‪stdWrap_postCObject($content, $conf)
6610  );
6611  }
6612 
6624  public function ‪stdWrap_postUserFunc(): void
6625  {
6626  $content = $this->getUniqueId('content');
6627  $conf = [
6628  'postUserFunc' => $this->getUniqueId('postUserFunc'),
6629  'postUserFunc.' => [$this->getUniqueId('postUserFunc.')],
6630  ];
6631  $return = $this->getUniqueId('return');
6632  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6633  ->setMethods(['callUserFunction'])->getMock();
6634  ‪$subject
6635  ->expects($this->once())
6636  ->method('callUserFunction')
6637  ->with($conf['postUserFunc'], $conf['postUserFunc.'])
6638  ->willReturn($return);
6639  $this->assertSame(
6640  $return,
6641  ‪$subject->‪stdWrap_postUserFunc($content, $conf)
6642  );
6643  }
6644 
6663  public function ‪stdWrap_postUserFuncInt(): void
6664  {
6665  $uniqueHash = $this->getUniqueId('uniqueHash');
6666  $substKey = 'INT_SCRIPT.' . $uniqueHash;
6667  $content = $this->getUniqueId('content');
6668  $conf = [
6669  'postUserFuncInt' => $this->getUniqueId('function'),
6670  'postUserFuncInt.' => [$this->getUniqueId('function array')],
6671  ];
6672  $expect = '<!--' . $substKey . '-->';
6673  $frontend = $this->getMockBuilder(TypoScriptFrontendController::class)
6674  ->disableOriginalConstructor()->setMethods(['uniqueHash'])
6675  ->getMock();
6676  $frontend->expects($this->once())->method('uniqueHash')
6677  ->with()->willReturn($uniqueHash);
6678  $frontend->config = [];
6679  ‪$subject = $this->getAccessibleMock(
6680  ContentObjectRenderer::class,
6681  null,
6682  [$frontend]
6683  );
6684  $this->assertSame(
6685  $expect,
6686  ‪$subject->‪stdWrap_postUserFuncInt($content, $conf)
6687  );
6688  $array = [
6689  'content' => $content,
6690  'postUserFunc' => $conf['postUserFuncInt'],
6691  'conf' => $conf['postUserFuncInt.'],
6692  'type' => 'POSTUSERFUNC',
6693  'cObj' => serialize(‪$subject)
6694  ];
6695  $this->assertSame(
6696  $array,
6697  $frontend->config['INTincScript'][$substKey]
6698  );
6699  }
6700 
6714  public function ‪stdWrap_preCObject(): void
6715  {
6716  $debugKey = '/stdWrap/.preCObject';
6717  $content = $this->getUniqueId('content');
6718  $conf = [
6719  'preCObject' => $this->getUniqueId('preCObject'),
6720  'preCObject.' => [$this->getUniqueId('preCObject.')],
6721  ];
6722  $return = $this->getUniqueId('return');
6723  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6724  ->setMethods(['cObjGetSingle'])->getMock();
6725  ‪$subject
6726  ->expects($this->once())
6727  ->method('cObjGetSingle')
6728  ->with($conf['preCObject'], $conf['preCObject.'], $debugKey)
6729  ->willReturn($return);
6730  $this->assertSame(
6731  $return . $content,
6732  ‪$subject->‪stdWrap_preCObject($content, $conf)
6733  );
6734  }
6735 
6749  public function ‪stdWrap_preIfEmptyListNum(): void
6750  {
6751  $content = $this->getUniqueId('content');
6752  $conf = [
6753  'preIfEmptyListNum' => $this->getUniqueId('preIfEmptyListNum'),
6754  'preIfEmptyListNum.' => [
6755  'splitChar' => $this->getUniqueId('splitChar')
6756  ],
6757  ];
6758  $return = $this->getUniqueId('return');
6759  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6760  ->setMethods(['listNum'])->getMock();
6761  ‪$subject
6762  ->expects($this->once())
6763  ->method('listNum')
6764  ->with(
6765  $content,
6766  $conf['preIfEmptyListNum'],
6767  $conf['preIfEmptyListNum.']['splitChar']
6768  )
6769  ->willReturn($return);
6770  $this->assertSame(
6771  $return,
6772  ‪$subject->‪stdWrap_preIfEmptyListNum($content, $conf)
6773  );
6774  }
6781  public function ‪stdWrap_prefixCommentDataProvider(): array
6782  {
6783  $content = $this->getUniqueId('content');
6784  $will = $this->getUniqueId('will');
6785  $conf['prefixComment'] = $this->getUniqueId('prefixComment');
6786  $emptyConf1 = [];
6787  $emptyConf2['prefixComment'] = '';
6788  return [
6789  'standard case' => [$will, $content, $conf, false, 1, $will],
6790  'emptyConf1' => [$content, $content, $emptyConf1, false, 0, $will],
6791  'emptyConf2' => [$content, $content, $emptyConf2, false, 0, $will],
6792  'disabled by bool' => [$content, $content, $conf, true, 0, $will],
6793  'disabled by int' => [$content, $content, $conf, 1, 0, $will],
6794  ];
6795  }
6796 
6820  public function ‪stdWrap_prefixComment(
6821  string $expect,
6822  string $content,
6823  array $conf,
6824  $disable,
6825  int $times,
6826  string $will
6827  ): void {
6828  $this->frontendControllerMock
6829  ->config['config']['disablePrefixComment'] = $disable;
6830  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6831  ->setMethods(['prefixComment'])->getMock();
6832  ‪$subject
6833  ->expects($this->exactly($times))
6834  ->method('prefixComment')
6835  ->with($conf['prefixComment'] ?? null, [], $content)
6836  ->willReturn($will);
6837  $this->assertSame(
6838  $expect,
6839  ‪$subject->‪stdWrap_prefixComment($content, $conf)
6840  );
6841  }
6842 
6856  public function ‪stdWrap_prepend(): void
6857  {
6858  $debugKey = '/stdWrap/.prepend';
6859  $content = $this->getUniqueId('content');
6860  $conf = [
6861  'prepend' => $this->getUniqueId('prepend'),
6862  'prepend.' => [$this->getUniqueId('prepend.')],
6863  ];
6864  $return = $this->getUniqueId('return');
6865  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6866  ->setMethods(['cObjGetSingle'])->getMock();
6867  ‪$subject
6868  ->expects($this->once())
6869  ->method('cObjGetSingle')
6870  ->with($conf['prepend'], $conf['prepend.'], $debugKey)
6871  ->willReturn($return);
6872  $this->assertSame(
6873  $return . $content,
6874  ‪$subject->‪stdWrap_prepend($content, $conf)
6875  );
6876  }
6883  public function ‪stdWrap_prioriCalcDataProvider(): array
6884  {
6885  return [
6886  'priority of *' => ['7', '1 + 2 * 3', []],
6887  'priority of parentheses' => ['9', '(1 + 2) * 3', []],
6888  'float' => ['1.5', '3/2', []],
6889  'intval casts to int' => [1, '3/2', ['prioriCalc' => 'intval']],
6890  'intval does not round' => [2, '2.7', ['prioriCalc' => 'intval']],
6891  ];
6892  }
6893 
6914  public function ‪stdWrap_prioriCalc($expect, string $content, array $conf): void
6915  {
6916  $result = $this->subject->stdWrap_prioriCalc($content, $conf);
6917  $this->assertSame($expect, $result);
6918  }
6919 
6933  public function ‪stdWrap_preUserFunc(): void
6934  {
6935  $content = $this->getUniqueId('content');
6936  $conf = [
6937  'preUserFunc' => $this->getUniqueId('preUserFunc'),
6938  'preUserFunc.' => [$this->getUniqueId('preUserFunc.')],
6939  ];
6940  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
6941  ->setMethods(['callUserFunction'])->getMock();
6942  ‪$subject->expects($this->once())->method('callUserFunction')
6943  ->with($conf['preUserFunc'], $conf['preUserFunc.'], $content)
6944  ->willReturn('return');
6945  $this->assertSame(
6946  'return',
6947  ‪$subject->‪stdWrap_preUserFunc($content, $conf)
6948  );
6949  }
6956  public function ‪stdWrap_rawUrlEncodeDataProvider(): array
6957  {
6958  return [
6959  'https://typo3.org?id=10' => [
6960  'https%3A%2F%2Ftypo3.org%3Fid%3D10',
6961  'https://typo3.org?id=10',
6962  ],
6963  'https://typo3.org?id=10&foo=bar' => [
6964  'https%3A%2F%2Ftypo3.org%3Fid%3D10%26foo%3Dbar',
6965  'https://typo3.org?id=10&foo=bar',
6966  ],
6967  ];
6968  }
6969 
6978  public function ‪stdWrap_rawUrlEncode(string $expect, string $content): void
6979  {
6980  $this->assertSame(
6981  $expect,
6982  $this->subject->stdWrap_rawUrlEncode($content)
6983  );
6984  }
6985 
6998  public function ‪stdWrap_replacement(): void
6999  {
7000  $content = $this->getUniqueId('content');
7001  $conf = [
7002  'replacement' => $this->getUniqueId('not used'),
7003  'replacement.' => [$this->getUniqueId('replacement.')],
7004  ];
7005  $return = $this->getUniqueId('return');
7006  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7007  ->setMethods(['replacement'])->getMock();
7008  ‪$subject
7009  ->expects($this->once())
7010  ->method('replacement')
7011  ->with($content, $conf['replacement.'])
7012  ->willReturn($return);
7013  $this->assertSame(
7014  $return,
7015  ‪$subject->‪stdWrap_replacement($content, $conf)
7016  );
7017  }
7024  public function ‪stdWrap_requiredDataProvider(): array
7025  {
7026  return [
7027  // empty content
7028  'empty string is empty' => ['', true, ''],
7029  'null is empty' => ['', true, null],
7030  'false is empty' => ['', true, false],
7031 
7032  // non-empty content
7033  'blank is not empty' => [' ', false, ' '],
7034  'tab is not empty' => ["\t", false, "\t"],
7035  'linebreak is not empty' => [PHP_EOL, false, PHP_EOL],
7036  '"0" is not empty' => ['0', false, '0'],
7037  '0 is not empty' => [0, false, 0],
7038  '1 is not empty' => [1, false, 1],
7039  'true is not empty' => [true, false, true],
7040  ];
7041  }
7042 
7058  public function ‪stdWrap_required($expect, bool $stop, $content): void
7059  {
7061  ‪$subject->_set('stdWrapRecursionLevel', 1);
7062  ‪$subject->_set('stopRendering', [1 => false]);
7063  $this->assertSame($expect, ‪$subject->‪stdWrap_required($content));
7064  $this->assertSame($stop, ‪$subject->_get('stopRendering')[1]);
7065  }
7066 
7079  public function ‪stdWrap_round(): void
7080  {
7081  $content = $this->getUniqueId('content');
7082  $conf = [
7083  'round' => $this->getUniqueId('not used'),
7084  'round.' => [$this->getUniqueId('round.')],
7085  ];
7086  $return = $this->getUniqueId('return');
7087  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7088  ->setMethods(['round'])->getMock();
7089  ‪$subject
7090  ->expects($this->once())
7091  ->method('round')
7092  ->with($content, $conf['round.'])
7093  ->willReturn($return);
7094  $this->assertSame($return, ‪$subject->‪stdWrap_round($content, $conf));
7095  }
7102  public function ‪stdWrap_setContentToCurrent(): void
7103  {
7104  $content = $this->getUniqueId('content');
7105  $this->assertNotSame($content, $this->subject->getData('current'));
7106  $this->assertSame(
7107  $content,
7108  $this->subject->stdWrap_setContentToCurrent($content)
7109  );
7110  $this->assertSame($content, $this->subject->getData('current'));
7111  }
7118  public function ‪stdWrap_setCurrentDataProvider(): array
7119  {
7120  return [
7121  'no conf' => [
7122  'content',
7123  [],
7124  ],
7125  'empty string' => [
7126  'content',
7127  ['setCurrent' => ''],
7128  ],
7129  'non-empty string' => [
7130  'content',
7131  ['setCurrent' => 'xxx'],
7132  ],
7133  'integer null' => [
7134  'content',
7135  ['setCurrent' => 0],
7136  ],
7137  'integer not null' => [
7138  'content',
7139  ['setCurrent' => 1],
7140  ],
7141  'boolean true' => [
7142  'content',
7143  ['setCurrent' => true],
7144  ],
7145  'boolean false' => [
7146  'content',
7147  ['setCurrent' => false],
7148  ],
7149  ];
7150  }
7151 
7160  public function ‪stdWrap_setCurrent(string $input, array $conf): void
7161  {
7162  if (isset($conf['setCurrent'])) {
7163  $this->assertNotSame($conf['setCurrent'], $this->subject->getData('current'));
7164  }
7165  $this->assertSame($input, $this->subject->stdWrap_setCurrent($input, $conf));
7166  if (isset($conf['setCurrent'])) {
7167  $this->assertSame($conf['setCurrent'], $this->subject->getData('current'));
7168  }
7169  }
7170 
7183  public function ‪stdWrap_split(): void
7184  {
7185  $content = $this->getUniqueId('content');
7186  $conf = [
7187  'split' => $this->getUniqueId('not used'),
7188  'split.' => [$this->getUniqueId('split.')],
7189  ];
7190  $return = $this->getUniqueId('return');
7191  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7192  ->setMethods(['splitObj'])->getMock();
7193  ‪$subject
7194  ->expects($this->once())
7195  ->method('splitObj')
7196  ->with($content, $conf['split.'])
7197  ->willReturn($return);
7198  $this->assertSame(
7199  $return,
7200  ‪$subject->‪stdWrap_split($content, $conf)
7201  );
7202  }
7203 
7215  public function ‪stdWrap_stdWrap(): void
7216  {
7217  $content = $this->getUniqueId('content');
7218  $conf = [
7219  'stdWrap' => $this->getUniqueId('not used'),
7220  'stdWrap.' => [$this->getUniqueId('stdWrap.')],
7221  ];
7222  $return = $this->getUniqueId('return');
7223  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7224  ->setMethods(['stdWrap'])->getMock();
7225  ‪$subject
7226  ->expects($this->once())
7227  ->method('stdWrap')
7228  ->with($content, $conf['stdWrap.'])
7229  ->willReturn($return);
7230  $this->assertSame($return, ‪$subject->‪stdWrap_stdWrap($content, $conf));
7231  }
7238  public function ‪stdWrap_stdWrapValueDataProvider(): array
7239  {
7240  return [
7241  'only key returns value' => [
7242  'ifNull',
7243  [
7244  'ifNull' => '1',
7245  ],
7246  '',
7247  '1',
7248  ],
7249  'array without key returns empty string' => [
7250  'ifNull',
7251  [
7252  'ifNull.' => '1',
7253  ],
7254  '',
7255  '',
7256  ],
7257  'array without key returns default' => [
7258  'ifNull',
7259  [
7260  'ifNull.' => '1',
7261  ],
7262  'default',
7263  'default',
7264  ],
7265  'non existing key returns default' => [
7266  'ifNull',
7267  [
7268  'noTrimWrap' => 'test',
7269  'noTrimWrap.' => '1',
7270  ],
7271  'default',
7272  'default',
7273  ],
7274  'existing key and array returns stdWrap' => [
7275  'test',
7276  [
7277  'test' => 'value',
7278  'test.' => ['case' => 'upper'],
7279  ],
7280  'default',
7281  'VALUE'
7282  ],
7283  ];
7284  }
7285 
7294  public function ‪stdWrap_stdWrapValue(
7295  string $key,
7296  array $configuration,
7297  string $defaultValue,
7298  string $expected
7299  ): void {
7300  $result = $this->subject->stdWrapValue($key, $configuration, $defaultValue);
7301  $this->assertEquals($expected, $result);
7302  }
7309  public function ‪stdWrap_strPadDataProvider(): array
7310  {
7311  return [
7312  'pad string with default settings and length 10' => [
7313  'Alien ',
7314  'Alien',
7315  [
7316  'length' => '10',
7317  ],
7318  ],
7319  'pad string with padWith -= and type left and length 10' => [
7320  '-=-=-Alien',
7321  'Alien',
7322  [
7323  'length' => '10',
7324  'padWith' => '-=',
7325  'type' => 'left',
7326  ],
7327  ],
7328  'pad string with padWith _ and type both and length 10' => [
7329  '__Alien___',
7330  'Alien',
7331  [
7332  'length' => '10',
7333  'padWith' => '_',
7334  'type' => 'both',
7335  ],
7336  ],
7337  'pad string with padWith 0 and type both and length 10' => [
7338  '00Alien000',
7339  'Alien',
7340  [
7341  'length' => '10',
7342  'padWith' => '0',
7343  'type' => 'both',
7344  ],
7345  ],
7346  'pad string with padWith ___ and type both and length 6' => [
7347  'Alien_',
7348  'Alien',
7349  [
7350  'length' => '6',
7351  'padWith' => '___',
7352  'type' => 'both',
7353  ],
7354  ],
7355  'pad string with padWith _ and type both and length 12, using stdWrap for length' => [
7356  '___Alien____',
7357  'Alien',
7358  [
7359  'length' => '1',
7360  'length.' => [
7361  'wrap' => '|2',
7362  ],
7363  'padWith' => '_',
7364  'type' => 'both',
7365  ],
7366  ],
7367  'pad string with padWith _ and type both and length 12, using stdWrap for padWidth' => [
7368  '-_=Alien-_=-',
7369  'Alien',
7370  [
7371  'length' => '12',
7372  'padWith' => '_',
7373  'padWith.' => [
7374  'wrap' => '-|=',
7375  ],
7376  'type' => 'both',
7377  ],
7378  ],
7379  'pad string with padWith _ and type both and length 12, using stdWrap for type' => [
7380  '_______Alien',
7381  'Alien',
7382  [
7383  'length' => '12',
7384  'padWith' => '_',
7385  'type' => 'both',
7386  // make type become "left"
7387  'type.' => [
7388  'substring' => '2,1',
7389  'wrap' => 'lef|',
7390  ],
7391  ],
7392  ],
7393  ];
7394  }
7395 
7405  public function ‪stdWrap_strPad(string $expect, string $content, array $conf): void
7406  {
7407  $conf = ['strPad.' => $conf];
7408  $result = $this->subject->stdWrap_strPad($content, $conf);
7409  $this->assertSame($expect, $result);
7410  }
7417  public function ‪stdWrap_strftimeDataProvider(): array
7418  {
7419  // Fictive execution time is 2012-09-01 12:00 in UTC/GMT.
7420  $now = 1346500800;
7421  return [
7422  'given timestamp' => [
7423  '01-09-2012',
7424  $now,
7425  ['strftime' => '%d-%m-%Y'],
7426  $now
7427  ],
7428  'empty string' => [
7429  '01-09-2012',
7430  '',
7431  ['strftime' => '%d-%m-%Y'],
7432  $now
7433  ],
7434  'testing null' => [
7435  '01-09-2012',
7436  null,
7437  ['strftime' => '%d-%m-%Y'],
7438  $now
7439  ]
7440  ];
7441  }
7442 
7453  public function ‪stdWrap_strftime(string $expect, $content, array $conf, int $now): void
7454  {
7455  // Save current timezone and set to UTC to make the system under test
7456  // behave the same in all server timezone settings
7457  $timezoneBackup = date_default_timezone_get();
7458  date_default_timezone_set('UTC');
7459 
7460  ‪$GLOBALS['EXEC_TIME'] = $now;
7461  $result = $this->subject->stdWrap_strftime($content, $conf);
7462 
7463  // Reset timezone
7464  date_default_timezone_set($timezoneBackup);
7465 
7466  $this->assertSame($expect, $result);
7467  }
7474  public function ‪stdWrap_stripHtml(): void
7475  {
7476  $content = '<html><p>Hello <span class="inline">inline tag<span>!</p><p>Hello!</p></html>';
7477  $expected = 'Hello inline tag!Hello!';
7478  $this->assertSame($expected, $this->subject->stdWrap_stripHtml($content));
7479  }
7486  public function ‪stdWrap_strtotimeDataProvider(): array
7487  {
7488  return [
7489  'date from content' => [
7490  1417651200,
7491  '2014-12-04',
7492  ['strtotime' => '1']
7493  ],
7494  'manipulation of date from content' => [
7495  1417996800,
7496  '2014-12-04',
7497  ['strtotime' => '+ 2 weekdays']
7498  ],
7499  'date from configuration' => [
7500  1417651200,
7501  '',
7502  ['strtotime' => '2014-12-04']
7503  ],
7504  'manipulation of date from configuration' => [
7505  1417996800,
7506  '',
7507  ['strtotime' => '2014-12-04 + 2 weekdays']
7508  ],
7509  'empty input' => [
7510  false,
7511  '',
7512  ['strtotime' => '1']
7513  ],
7514  'date from content and configuration' => [
7515  false,
7516  '2014-12-04',
7517  ['strtotime' => '2014-12-05']
7518  ]
7519  ];
7520  }
7521 
7531  public function ‪stdWrap_strtotime($expect, string $content, array $conf): void
7532  {
7533  // Set exec_time to a hard timestamp
7534  ‪$GLOBALS['EXEC_TIME'] = 1417392000;
7535  // Save current timezone and set to UTC to make the system under test
7536  // behave the same in all server timezone settings
7537  $timezoneBackup = date_default_timezone_get();
7538  date_default_timezone_set('UTC');
7539 
7540  $result = $this->subject->stdWrap_strtotime($content, $conf);
7541 
7542  // Reset timezone
7543  date_default_timezone_set($timezoneBackup);
7544 
7545  $this->assertEquals($expect, $result);
7546  }
7547 
7560  public function ‪stdWrap_substring(): void
7561  {
7562  $content = $this->getUniqueId('content');
7563  $conf = [
7564  'substring' => $this->getUniqueId('substring'),
7565  'substring.' => $this->getUniqueId('not used'),
7566  ];
7567  $return = $this->getUniqueId('return');
7568  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7569  ->setMethods(['substring'])->getMock();
7570  ‪$subject
7571  ->expects($this->once())
7572  ->method('substring')
7573  ->with($content, $conf['substring'])
7574  ->willReturn($return);
7575  $this->assertSame(
7576  $return,
7577  ‪$subject->‪stdWrap_substring($content, $conf)
7578  );
7579  }
7586  public function ‪stdWrap_trimDataProvider(): array
7587  {
7588  return [
7589  // string not trimmed
7590  'empty string' => ['', ''],
7591  'string without whitespace' => ['xxx', 'xxx'],
7592  'string with whitespace inside' => [
7593  'xx ' . "\t" . ' xx',
7594  'xx ' . "\t" . ' xx',
7595  ],
7596  'string with newlines inside' => [
7597  'xx ' . PHP_EOL . ' xx',
7598  'xx ' . PHP_EOL . ' xx',
7599  ],
7600  // string trimmed
7601  'blanks around' => ['xxx', ' xxx '],
7602  'tabs around' => ['xxx', "\t" . 'xxx' . "\t"],
7603  'newlines around' => ['xxx', PHP_EOL . 'xxx' . PHP_EOL],
7604  'mixed case' => ['xxx', "\t" . ' xxx ' . PHP_EOL],
7605  // non strings
7606  'null' => ['', null],
7607  'false' => ['', false],
7608  'true' => ['1', true],
7609  'zero' => ['0', 0],
7610  'one' => ['1', 1],
7611  '-1' => ['-1', -1],
7612  '0.0' => ['0', 0.0],
7613  '1.0' => ['1', 1.0],
7614  '-1.0' => ['-1', -1.0],
7615  '1.1' => ['1.1', 1.1],
7616  ];
7617  }
7618 
7639  public function ‪stdWrap_trim(string $expect, $content): void
7640  {
7641  $result = $this->subject->stdWrap_trim($content);
7642  $this->assertSame($expect, $result);
7643  }
7644 
7656  public function ‪stdWrap_typolink(): void
7657  {
7658  $content = $this->getUniqueId('content');
7659  $conf = [
7660  'typolink' => $this->getUniqueId('not used'),
7661  'typolink.' => [$this->getUniqueId('typolink.')],
7662  ];
7663  $return = $this->getUniqueId('return');
7664  ‪$subject = $this->getMockBuilder(ContentObjectRenderer::class)
7665  ->setMethods(['typolink'])->getMock();
7666  ‪$subject
7667  ->expects($this->once())
7668  ->method('typolink')
7669  ->with($content, $conf['typolink.'])
7670  ->willReturn($return);
7671  $this->assertSame($return, ‪$subject->‪stdWrap_typolink($content, $conf));
7672  }
7679  public function ‪stdWrap_wrapDataProvider(): array
7680  {
7681  return [
7682  'no conf' => [
7683  'XXX',
7684  'XXX',
7685  [],
7686  ],
7687  'simple' => [
7688  '<wrapper>XXX</wrapper>',
7689  'XXX',
7690  ['wrap' => '<wrapper>|</wrapper>'],
7691  ],
7692  'trims whitespace' => [
7693  '<wrapper>XXX</wrapper>',
7694  'XXX',
7695  ['wrap' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7696  ],
7697  'missing pipe puts wrap before' => [
7698  '<pre>XXX',
7699  'XXX',
7700  [
7701  'wrap' => '<pre>',
7702  ],
7703  ],
7704  'split char change' => [
7705  '<wrapper>XXX</wrapper>',
7706  'XXX',
7707  [
7708  'wrap' => '<wrapper> # </wrapper>',
7709  'wrap.' => ['splitChar' => '#'],
7710  ],
7711  ],
7712  'split by pattern' => [
7713  '<wrapper>XXX</wrapper>',
7714  'XXX',
7715  [
7716  'wrap' => '<wrapper> ###splitter### </wrapper>',
7717  'wrap.' => ['splitChar' => '###splitter###'],
7718  ],
7719  ],
7720  ];
7721  }
7722 
7732  public function ‪stdWrap_wrap(string $expected, string $input, array $conf): void
7733  {
7734  $this->assertSame(
7735  $expected,
7736  $this->subject->stdWrap_wrap($input, $conf)
7737  );
7738  }
7745  public function ‪stdWrap_wrap2DataProvider(): array
7746  {
7747  return [
7748  'no conf' => [
7749  'XXX',
7750  'XXX',
7751  [],
7752  ],
7753  'simple' => [
7754  '<wrapper>XXX</wrapper>',
7755  'XXX',
7756  ['wrap2' => '<wrapper>|</wrapper>'],
7757  ],
7758  'trims whitespace' => [
7759  '<wrapper>XXX</wrapper>',
7760  'XXX',
7761  ['wrap2' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7762  ],
7763  'missing pipe puts wrap2 before' => [
7764  '<pre>XXX',
7765  'XXX',
7766  [
7767  'wrap2' => '<pre>',
7768  ],
7769  ],
7770  'split char change' => [
7771  '<wrapper>XXX</wrapper>',
7772  'XXX',
7773  [
7774  'wrap2' => '<wrapper> # </wrapper>',
7775  'wrap2.' => ['splitChar' => '#'],
7776  ],
7777  ],
7778  'split by pattern' => [
7779  '<wrapper>XXX</wrapper>',
7780  'XXX',
7781  [
7782  'wrap2' => '<wrapper> ###splitter### </wrapper>',
7783  'wrap2.' => ['splitChar' => '###splitter###'],
7784  ],
7785  ],
7786  ];
7787  }
7788 
7798  public function ‪stdWrap_wrap2(string $expected, string $input, array $conf): void
7799  {
7800  $this->assertSame($expected, $this->subject->stdWrap_wrap2($input, $conf));
7801  }
7808  public function ‪stdWrap_wrap3DataProvider(): array
7809  {
7810  return [
7811  'no conf' => [
7812  'XXX',
7813  'XXX',
7814  [],
7815  ],
7816  'simple' => [
7817  '<wrapper>XXX</wrapper>',
7818  'XXX',
7819  ['wrap3' => '<wrapper>|</wrapper>'],
7820  ],
7821  'trims whitespace' => [
7822  '<wrapper>XXX</wrapper>',
7823  'XXX',
7824  ['wrap3' => '<wrapper>' . "\t" . ' | ' . "\t" . '</wrapper>'],
7825  ],
7826  'missing pipe puts wrap3 before' => [
7827  '<pre>XXX',
7828  'XXX',
7829  [
7830  'wrap3' => '<pre>',
7831  ],
7832  ],
7833  'split char change' => [
7834  '<wrapper>XXX</wrapper>',
7835  'XXX',
7836  [
7837  'wrap3' => '<wrapper> # </wrapper>',
7838  'wrap3.' => ['splitChar' => '#'],
7839  ],
7840  ],
7841  'split by pattern' => [
7842  '<wrapper>XXX</wrapper>',
7843  'XXX',
7844  [
7845  'wrap3' => '<wrapper> ###splitter### </wrapper>',
7846  'wrap3.' => ['splitChar' => '###splitter###'],
7847  ],
7848  ],
7849  ];
7850  }
7851 
7861  public function ‪stdWrap_wrap3(string $expected, string $input, array $conf): void
7862  {
7863  $this->assertSame($expected, $this->subject->stdWrap_wrap3($input, $conf));
7864  }
7871  public function ‪stdWrap_wrapAlignDataProvider(): array
7872  {
7873  $format = '<div style="text-align:%s;">%s</div>';
7874  $content = $this->getUniqueId('content');
7875  $wrapAlign = $this->getUniqueId('wrapAlign');
7876  $expect = sprintf($format, $wrapAlign, $content);
7877  return [
7878  'standard case' => [$expect, $content, $wrapAlign],
7879  'empty conf' => [$content, $content, null],
7880  'empty string' => [$content, $content, ''],
7881  'whitespaced zero string' => [$content, $content, ' 0 '],
7882  ];
7883  }
7884 
7901  public function ‪stdWrap_wrapAlign(string $expect, string $content, $wrapAlignConf): void
7902  {
7903  $conf = [];
7904  if ($wrapAlignConf !== null) {
7905  $conf['wrapAlign'] = $wrapAlignConf;
7906  }
7907  $this->assertSame(
7908  $expect,
7909  $this->subject->stdWrap_wrapAlign($content, $conf)
7910  );
7911  }
7912 
7913  /***************************************************************************
7914  * End of tests of stdWrap in alphabetical order
7915  ***************************************************************************/
7916 
7917  /***************************************************************************
7918  * Begin: Mixed tests
7919  *
7920  * - Add new tests here that still don't have a better place in this class.
7921  * - Place tests in alphabetical order.
7922  * - Place data provider above test method.
7923  ***************************************************************************/
7930  public function ‪getCurrentTable(): void
7931  {
7932  $this->assertEquals('tt_content', $this->subject->getCurrentTable());
7933  }
7940  public function ‪linkWrapDataProvider(): array
7941  {
7942  $content = $this->getUniqueId();
7943  return [
7944  'Handles a tag as wrap.' => [
7945  '<tag>' . $content . '</tag>',
7946  $content,
7947  '<tag>|</tag>'
7948  ],
7949  'Handles simple text as wrap.' => [
7950  'alpha' . $content . 'omega',
7951  $content,
7952  'alpha|omega'
7953  ],
7954  'Trims whitespace around tags.' => [
7955  '<tag>' . $content . '</tag>',
7956  $content,
7957  "\t <tag>\t |\t </tag>\t "
7958  ],
7959  'A wrap without pipe is placed before the content.' => [
7960  '<tag>' . $content,
7961  $content,
7962  '<tag>'
7963  ],
7964  'For an empty string as wrap the content is returned as is.' => [
7965  $content,
7966  $content,
7967  ''
7968  ],
7969  'For null as wrap the content is returned as is.' => [
7970  $content,
7971  $content,
7972  null
7973  ],
7974  'For a valid rootline level the uid will be inserted.' => [
7975  '<a href="?id=55">' . $content . '</a>',
7976  $content,
7977  '<a href="?id={3}"> | </a>'
7978  ],
7979  'For an invalid rootline level there is no replacement.' => [
7980  '<a href="?id={4}">' . $content . '</a>',
7981  $content,
7982  '<a href="?id={4}"> | </a>'
7983  ],
7984  ];
7985  }
7986 
7996  public function ‪linkWrap(string $expected, string $content, $wrap): void
7997  {
7998  $this->templateServiceMock->rootLine = [3 => ['uid' => 55]];
7999  $actual = $this->subject->linkWrap($content, $wrap);
8000  $this->assertEquals($expected, $actual);
8001  }
8008  public function ‪prefixCommentDataProvider(): array
8009  {
8010  $comment = $this->getUniqueId();
8011  $content = $this->getUniqueId();
8012  $format = '%s';
8013  $format .= '%%s<!-- %%s [begin] -->%s';
8014  $format .= '%%s%s%%s%s';
8015  $format .= '%%s<!-- %%s [end] -->%s';
8016  $format .= '%%s%s';
8017  $format = sprintf($format, LF, LF, "\t", LF, LF, "\t");
8018  $indent1 = "\t";
8019  $indent2 = "\t" . "\t";
8020  return [
8021  'indent one tab' => [
8022  sprintf(
8023  $format,
8024  $indent1,
8025  $comment,
8026  $indent1,
8027  $content,
8028  $indent1,
8029  $comment,
8030  $indent1
8031  ),
8032  '1|' . $comment,
8033  $content
8034  ],
8035  'indent two tabs' => [
8036  sprintf(
8037  $format,
8038  $indent2,
8039  $comment,
8040  $indent2,
8041  $content,
8042  $indent2,
8043  $comment,
8044  $indent2
8045  ),
8046  '2|' . $comment,
8047  $content
8048  ],
8049  'htmlspecialchars applies for comment only' => [
8050  sprintf(
8051  $format,
8052  $indent1,
8053  '&lt;' . $comment . '&gt;',
8054  $indent1,
8055  '<' . $content . '>',
8056  $indent1,
8057  '&lt;' . $comment . '&gt;',
8058  $indent1
8059  ),
8060  '1|' . '<' . $comment . '>',
8061  '<' . $content . '>'
8062  ],
8063  ];
8064  }
8065 
8075  public function ‪prefixComment(string $expect, string $comment, string $content): void
8076  {
8077  // The parameter $conf is never used. Just provide null.
8078  // Consider to improve the signature and deprecate the old one.
8079  $result = $this->subject->prefixComment($comment, null, $content);
8080  $this->assertEquals($expect, $result);
8081  }
8088  public function ‪setCurrentFile_getCurrentFile(): void
8089  {
8090  $storageMock = $this->createMock(ResourceStorage::class);
8091  $file = new ‪File(['testfile'], $storageMock);
8092  $this->subject->setCurrentFile($file);
8093  $this->assertSame($file, $this->subject->getCurrentFile());
8094  }
8095 
8105  public function ‪setCurrentVal_getCurrentVal(): void
8106  {
8107  $key = $this->getUniqueId();
8108  $value = $this->getUniqueId();
8109  $this->subject->currentValKey = $key;
8110  $this->subject->setCurrentVal($value);
8111  $this->assertEquals($value, $this->subject->getCurrentVal());
8112  $this->assertEquals($value, $this->subject->data[$key]);
8113  }
8120  public function ‪setUserObjectType_getUserObjectType(): void
8121  {
8122  $value = $this->getUniqueId();
8123  $this->subject->setUserObjectType($value);
8124  $this->assertEquals($value, $this->subject->getUserObjectType());
8125  }
8132  public function ‪emailSpamProtectionWithTypeAsciiDataProvider(): array
8133  {
8134  return [
8135  'Simple email address' => [
8136  'test@email.tld',
8137  '&#116;&#101;&#115;&#116;&#64;&#101;&#109;&#97;&#105;&#108;&#46;&#116;&#108;&#100;'
8138  ],
8139  'Simple email address with unicode characters' => [
8140  'matthäus@email.tld',
8141  '&#109;&#97;&#116;&#116;&#104;&#228;&#117;&#115;&#64;&#101;&#109;&#97;&#105;&#108;&#46;&#116;&#108;&#100;'
8142  ],
8143  'Susceptible email address' => [
8144  '"><script>alert(\'emailSpamProtection\')</script>',
8145  '&#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;'
8146 
8147  ],
8148  'Susceptible email address with unicode characters' => [
8149  '"><script>alert(\'È…mÇ¡ilSpamProtÈ…ction\')</script>',
8150  '&#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;'
8151  ],
8152  ];
8153  }
8154 
8163  public function ‪mailSpamProtectionWithTypeAscii(string $content, string $expected): void
8164  {
8165  $this->assertSame(
8166  $expected,
8167  $this->subject->_call('encryptEmail', $content, 'ascii')
8168  );
8169  }
8170 
8171  /***************************************************************************
8172  * End: Mixed tests
8173  ***************************************************************************/
8174 
8179  private function ‪createSiteWithLanguage(array $languageConfiguration): ‪Site
8180  {
8181  return new ‪Site('test', 1, [
8182  'identifier' => 'test',
8183  'rootPageId' => 1,
8184  'base' => '/',
8185  'languages' => [
8186  array_merge(
8187  $languageConfiguration,
8188  [
8189  'base' => '/',
8190  ]
8191  )
8192  ]
8193  ]);
8194  }
8195 }
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canRegisterAContentObjectClassForATypoScriptName
‪canRegisterAContentObjectClassForATypoScriptName()
Definition: ContentObjectRendererTest.php:262
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prepend
‪stdWrap_prepend()
Definition: ContentObjectRendererTest.php:6850
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\mailSpamProtectionWithTypeAscii
‪mailSpamProtectionWithTypeAscii(string $content, string $expected)
Definition: ContentObjectRendererTest.php:8157
‪TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject
Definition: RestoreRegisterContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setContentToCurrent
‪stdWrap_setContentToCurrent()
Definition: ContentObjectRendererTest.php:7096
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_rawUrlEncodeDataProvider
‪array stdWrap_rawUrlEncodeDataProvider()
Definition: ContentObjectRendererTest.php:6950
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_case
‪string stdWrap_case($content='', $conf=[])
Definition: ContentObjectRenderer.php:2354
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectStdWrapHookInterface
Definition: ContentObjectStdWrapHookInterface.php:21
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_editIcons
‪string stdWrap_editIcons($content='', $conf=[])
Definition: ContentObjectRenderer.php:2874
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\round
‪round(float $expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:982
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesSingleParameter
‪getQueryArgumentsOverrulesSingleParameter()
Definition: ContentObjectRendererTest.php:419
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encapsLines
‪stdWrap_encapsLines()
Definition: ContentObjectRendererTest.php:5003
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preIfEmptyListNum
‪stdWrap_preIfEmptyListNum()
Definition: ContentObjectRendererTest.php:6743
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$templateServiceMock
‪PHPUnit_Framework_MockObject_MockObject TemplateService $templateServiceMock
Definition: ContentObjectRendererTest.php:93
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cacheRead
‪string stdWrap_cacheRead($content='', $conf=[])
Definition: ContentObjectRenderer.php:1677
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\roundDataProvider
‪array roundDataProvider()
Definition: ContentObjectRendererTest.php:917
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strftime
‪stdWrap_strftime(string $expect, $content, array $conf, int $now)
Definition: ContentObjectRendererTest.php:7447
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap2DataProvider
‪array stdWrap_innerWrap2DataProvider()
Definition: ContentObjectRendererTest.php:5878
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSiteLanguage
‪getDataWithTypeSiteLanguage()
Definition: ContentObjectRendererTest.php:1753
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strtotime
‪stdWrap_strtotime($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:7525
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsWithMethodPostGetMergesParameters
‪getQueryArgumentsWithMethodPostGetMergesParameters()
Definition: ContentObjectRendererTest.php:527
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapBrDataProvider
‪string[][] stdWrapBrDataProvider()
Definition: ContentObjectRendererTest.php:3830
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:29
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_editPanel
‪string stdWrap_editPanel($content='', $conf=[])
Definition: ContentObjectRenderer.php:2893
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_round
‪stdWrap_round()
Definition: ContentObjectRendererTest.php:7073
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$subject
‪PHPUnit_Framework_MockObject_MockObject AccessibleObjectInterface ContentObjectRenderer $subject
Definition: ContentObjectRendererTest.php:85
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_insertData
‪string stdWrap_insertData($content='')
Definition: ContentObjectRenderer.php:2806
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$contentObjectMap
‪array $contentObjectMap
Definition: ContentObjectRendererTest.php:99
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsExcludesParameters
‪getQueryArgumentsExcludesParameters()
Definition: ContentObjectRendererTest.php:372
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeTsfe
‪getDataWithTypeTsfe()
Definition: ContentObjectRendererTest.php:1351
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGlobal
‪getDataWithTypeGlobal()
Definition: ContentObjectRendererTest.php:1494
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\emailSpamProtectionWithTypeAsciiDataProvider
‪array emailSpamProtectionWithTypeAsciiDataProvider()
Definition: ContentObjectRendererTest.php:8126
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_orderedStdWrap
‪string stdWrap_orderedStdWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2777
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_HTMLparserDataProvider
‪array stdWrap_HTMLparserDataProvider()
Definition: ContentObjectRendererTest.php:3646
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_split
‪stdWrap_split()
Definition: ContentObjectRendererTest.php:7177
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\isGetOneSourceCollectionCalledCallback
‪string isGetOneSourceCollectionCalledCallback(array $sourceRenderConfiguration, array $sourceConfiguration, $oneSourceCollection, $parent)
Definition: ContentObjectRendererTest.php:2336
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait\getLibParseFunc_RTE
‪array getLibParseFunc_RTE()
Definition: ContentObjectRendererTestTrait.php:28
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksFilesDataProvider
‪array typolinkReturnsCorrectLinksFilesDataProvider()
Definition: ContentObjectRendererTest.php:2781
‪TYPO3\CMS\Core\Core\ApplicationContext
Definition: ApplicationContext.php:36
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFromCache
‪getFromCache($expect, $conf, $cacheKey, $times, $cached)
Definition: ContentObjectRendererTest.php:3245
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canNotAccessInternalContentObjectMapByReference
‪canNotAccessInternalContentObjectMapByReference()
Definition: ContentObjectRendererTest.php:299
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheStore
‪stdWrap_cacheStore( $confCache, int $timesCCK, $key, int $times)
Definition: ContentObjectRendererTest.php:4248
‪TYPO3\CMS\Frontend\ContentObject\ImageContentObject
Definition: ImageContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkEncodesMailAddressForSpamProtection
‪typoLinkEncodesMailAddressForSpamProtection(array $settings, $linkText, $mailAddress, $expected)
Definition: ContentObjectRendererTest.php:2656
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap3DataProvider
‪array stdWrap_wrap3DataProvider()
Definition: ContentObjectRendererTest.php:7802
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugRootline
‪getDataWithTypeDebugRootline()
Definition: ContentObjectRendererTest.php:1786
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForFilesWithAbsRefPrefix
‪typolinkReturnsCorrectLinksForFilesWithAbsRefPrefix( $linkText, $configuration, $absRefPrefix, $expectedResult)
Definition: ContentObjectRendererTest.php:3049
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_replacement
‪stdWrap_replacement()
Definition: ContentObjectRendererTest.php:6992
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDate
‪getDataWithTypeDate()
Definition: ContentObjectRendererTest.php:1600
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cObject
‪stdWrap_cObject()
Definition: ContentObjectRendererTest.php:4011
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_listNum
‪string stdWrap_listNum($content='', $conf=[])
Definition: ContentObjectRenderer.php:1959
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheReadDataProvider
‪array stdWrap_cacheReadDataProvider()
Definition: ContentObjectRendererTest.php:4117
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGp
‪getDataWithTypeGp(string $key, string $expectedValue)
Definition: ContentObjectRendererTest.php:1333
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_prefixComment
‪string stdWrap_prefixComment($content='', $conf=[])
Definition: ContentObjectRenderer.php:2855
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapReturnsExpectationDataProvider
‪array stdWrapReturnsExpectationDataProvider()
Definition: ContentObjectRendererTest.php:1244
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\localConfigurationOverridesGlobalConfiguration
‪localConfigurationOverridesGlobalConfiguration()
Definition: ContentObjectRendererTest.php:2431
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_replacement
‪string stdWrap_replacement($content='', $conf=[])
Definition: ContentObjectRenderer.php:2169
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTestTrait
Definition: ContentObjectRendererTestTrait.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_addPageCacheTagsAddsPageTagsDataProvider
‪array stdWrap_addPageCacheTagsAddsPageTagsDataProvider()
Definition: ContentObjectRendererTest.php:3727
‪TYPO3\CMS\Frontend\ContentObject\HierarchicalMenuContentObject
Definition: HierarchicalMenuContentObject.php:23
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: ContentObjectRendererTest.php:81
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionReturnsEmptyStringIfNoSourcesAreDefined
‪getImageSourceCollectionReturnsEmptyStringIfNoSourcesAreDefined( $layoutKey, $configuration, $file)
Definition: ContentObjectRendererTest.php:1999
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeCurrent
‪getDataWithTypeCurrent()
Definition: ContentObjectRendererTest.php:1626
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_required
‪stdWrap_required($expect, bool $stop, $content)
Definition: ContentObjectRendererTest.php:7052
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheStoreDataProvider
‪array stdWrap_cacheStoreDataProvider()
Definition: ContentObjectRendererTest.php:4201
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\hashDataProvider
‪array hashDataProvider()
Definition: ContentObjectRendererTest.php:5459
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap2
‪stdWrap_innerWrap2(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5921
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap2DataProvider
‪array stdWrap_wrap2DataProvider()
Definition: ContentObjectRendererTest.php:7739
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrapValueDataProvider
‪array stdWrap_stdWrapValueDataProvider()
Definition: ContentObjectRendererTest.php:7232
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeRegister
‪getDataWithTypeRegister()
Definition: ContentObjectRendererTest.php:1443
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\canSetTheContentObjectClassMapAndGetARegisteredContentObject
‪canSetTheContentObjectClassMapAndGetARegisteredContentObject()
Definition: ContentObjectRendererTest.php:281
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dataWrap
‪stdWrap_dataWrap()
Definition: ContentObjectRendererTest.php:4595
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeParentRecordNumber
‪getDataWithTypeParentRecordNumber()
Definition: ContentObjectRendererTest.php:1774
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_prepend
‪string stdWrap_prepend($content='', $conf=[])
Definition: ContentObjectRenderer.php:2733
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_brTag
‪stdWrap_brTag(string $input, string $expected, array $config)
Definition: ContentObjectRendererTest.php:3916
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderedErrorMessageCanBeCustomized
‪renderedErrorMessageCanBeCustomized()
Definition: ContentObjectRendererTest.php:2414
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertData
‪stdWrap_insertData()
Definition: ContentObjectRendererTest.php:5940
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFileReturnsUidOfFileObject
‪getDataWithTypeFileReturnsUidOfFileObject()
Definition: ContentObjectRendererTest.php:1415
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_stdWrap
‪string stdWrap_stdWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2021
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\html5SelfClosingTagsDataprovider
‪array html5SelfClosingTagsDataprovider()
Definition: ContentObjectRendererTest.php:5061
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGetindpenv
‪getDataWithTypeGetindpenv()
Definition: ContentObjectRendererTest.php:1374
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_trim
‪stdWrap_trim(string $expect, $content)
Definition: ContentObjectRendererTest.php:7633
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\willReturnNullForUnregisteredObject
‪willReturnNullForUnregisteredObject()
Definition: ContentObjectRendererTest.php:314
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\replacementDataProvider
‪array replacementDataProvider()
Definition: ContentObjectRendererTest.php:1102
‪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:5658
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\HTMLcaseshift
‪string HTMLcaseshift($theValue, $case)
Definition: ContentObjectRenderer.php:6069
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapDoubleBrTagDataProvider
‪array stdWrapDoubleBrTagDataProvider()
Definition: ContentObjectRendererTest.php:4797
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugData
‪stdWrap_debugData()
Definition: ContentObjectRendererTest.php:4714
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\rawUrlEncodeSquareBracketsInUrl
‪string rawUrlEncodeSquareBracketsInUrl(string $string)
Definition: ContentObjectRendererTest.php:596
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Fixtures\GeneralUtilityFixture\setApplicationContext
‪static setApplicationContext($applicationContext)
Definition: GeneralUtilityFixture.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_langViaSiteLanguage
‪stdWrap_langViaSiteLanguage(string $expected, string $input, array $conf, string $language)
Definition: ContentObjectRendererTest.php:6187
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectGetImageResourceHookInterface
Definition: ContentObjectGetImageResourceHookInterface.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFrontendController
‪TypoScriptFrontendController getFrontendController()
Definition: ContentObjectRendererTest.php:173
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_parseFunc
‪stdWrap_parseFunc()
Definition: ContentObjectRendererTest.php:6551
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\registersAllDefaultContentObjects
‪registersAllDefaultContentObjects(string $objectName, string $className)
Definition: ContentObjectRendererTest.php:355
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_htmlSpecialCharsDataProvider
‪array stdWrap_htmlSpecialCharsDataProvider()
Definition: ContentObjectRendererTest.php:5516
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_HTMLparser
‪stdWrap_HTMLparser(string $expect, string $content, array $conf, int $times, string $will)
Definition: ContentObjectRendererTest.php:3704
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionRendersDefinedLayoutKeyDataDataProvider
‪array getImageSourceCollectionRendersDefinedLayoutKeyDataDataProvider()
Definition: ContentObjectRendererTest.php:2136
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_expandList
‪stdWrap_expandList(string $expected, string $content)
Definition: ContentObjectRendererTest.php:5301
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encapsLines_HTML5SelfClosingTags
‪stdWrap_encapsLines_HTML5SelfClosingTags(string $input, string $expected)
Definition: ContentObjectRendererTest.php:5034
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\createSiteWithLanguage
‪Site createSiteWithLanguage(array $languageConfiguration)
Definition: ContentObjectRendererTest.php:8173
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_round
‪string stdWrap_round($content='', $conf=[])
Definition: ContentObjectRenderer.php:2246
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropHTMLDataProvider
‪array cropHTMLDataProvider()
Definition: ContentObjectRendererTest.php:625
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_hash
‪stdWrap_hash(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:5503
‪TYPO3\CMS\Frontend\ContentObject\FileContentObject
Definition: FileContentObject.php:27
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsWithMethodGetPostMergesParameters
‪getQueryArgumentsWithMethodGetPostMergesParameters()
Definition: ContentObjectRendererTest.php:560
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevelfield
‪getDataWithTypeLevelfield()
Definition: ContentObjectRendererTest.php:1561
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSession
‪getDataWithTypeSession()
Definition: ContentObjectRendererTest.php:1457
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_trimDataProvider
‪array stdWrap_trimDataProvider()
Definition: ContentObjectRendererTest.php:7580
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\handleCharset
‪handleCharset(string &$subject, string &$expected)
Definition: ContentObjectRendererTest.php:184
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_substring
‪stdWrap_substring()
Definition: ContentObjectRendererTest.php:7554
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_intvalDataProvider
‪array stdWrap_intvalDataProvider()
Definition: ContentObjectRendererTest.php:5987
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_HTMLparser
‪string stdWrap_HTMLparser($content='', $conf=[])
Definition: ContentObjectRenderer.php:2139
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_keywords
‪stdWrap_keywords(string $expected, string $input)
Definition: ContentObjectRendererTest.php:6089
‪TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException
Definition: ContentRenderingException.php:22
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeField
‪getDataWithTypeField()
Definition: ContentObjectRendererTest.php:1386
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapAlignDataProvider
‪array stdWrap_wrapAlignDataProvider()
Definition: ContentObjectRendererTest.php:7865
‪$fields
‪$fields
Definition: pages.php:4
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_split
‪string stdWrap_split($content='', $conf=[])
Definition: ContentObjectRenderer.php:2156
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getLibParseFunc
‪array getLibParseFunc()
Definition: ContentObjectRendererTest.php:2486
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:49
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encodeForJavaScriptValue
‪stdWrap_encodeForJavaScriptValue(string $expect, string $content)
Definition: ContentObjectRendererTest.php:5266
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_rawUrlEncode
‪stdWrap_rawUrlEncode(string $expect, string $content)
Definition: ContentObjectRendererTest.php:6972
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropIsMultibyteSafe
‪cropIsMultibyteSafe()
Definition: ContentObjectRendererTest.php:607
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_field
‪stdWrap_field()
Definition: ContentObjectRendererTest.php:5319
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkEncodesMailAddressForSpamProtectionDataProvider
‪array typoLinkEncodesMailAddressForSpamProtectionDataProvider()
Definition: ContentObjectRendererTest.php:2672
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_numRows
‪string stdWrap_numRows($content='', $conf=[])
Definition: ContentObjectRenderer.php:1822
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFieldValDataProvider
‪array getFieldValDataProvider()
Definition: ContentObjectRendererTest.php:3278
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionHookCalled
‪getImageSourceCollectionHookCalled()
Definition: ContentObjectRendererTest.php:2268
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cacheStore
‪string stdWrap_cacheStore($content='', $conf=[])
Definition: ContentObjectRenderer.php:2924
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageTagTemplateReturnTemplateElementIdentifiedByKeyDataProvider
‪array getImageTagTemplateReturnTemplateElementIdentifiedByKeyDataProvider()
Definition: ContentObjectRendererTest.php:1945
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredGlobally
‪renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredGlobally()
Definition: ContentObjectRendererTest.php:2388
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_doubleBrTag
‪stdWrap_doubleBrTag(string $expected, string $input, array $config)
Definition: ContentObjectRendererTest.php:4862
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\allStdWrapProcessorsAreCallable
‪allStdWrapProcessorsAreCallable()
Definition: ContentObjectRendererTest.php:3495
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\HTMLcaseshiftDataProvider
‪array HTMLcaseshiftDataProvider()
Definition: ContentObjectRendererTest.php:3404
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypePage
‪getDataWithTypePage()
Definition: ContentObjectRendererTest.php:1614
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_if
‪string stdWrap_if($content='', $conf=[])
Definition: ContentObjectRenderer.php:2070
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_outerWrapDataProvider
‪array stdWrap_outerWrapDataProvider()
Definition: ContentObjectRendererTest.php:6399
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapKeywordsDataProvider
‪string[][] stdWrapKeywordsDataProvider()
Definition: ContentObjectRendererTest.php:6041
‪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:6814
‪TYPO3\CMS\Frontend\ContentObject\UserInternalContentObject
Definition: UserInternalContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_override
‪stdWrap_override($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:6530
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setUp
‪setUp()
Definition: ContentObjectRendererTest.php:126
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preCObject
‪stdWrap_preCObject()
Definition: ContentObjectRendererTest.php:6708
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:39
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageTagTemplateFallsBackToDefaultTemplateIfNoTemplateIsFound
‪getImageTagTemplateFallsBackToDefaultTemplateIfNoTemplateIsFound($key, $configuration)
Definition: ContentObjectRendererTest.php:1935
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postCObject
‪stdWrap_postCObject()
Definition: ContentObjectRendererTest.php:6585
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLeveltitle
‪getDataWithTypeLeveltitle()
Definition: ContentObjectRendererTest.php:1504
‪TYPO3\CMS\Frontend\ContentObject\TemplateContentObject
Definition: TemplateContentObject.php:25
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkLogsErrorIfNoLinkResolvingIsPossible
‪typoLinkLogsErrorIfNoLinkResolvingIsPossible()
Definition: ContentObjectRendererTest.php:3097
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_fieldRequiredDataProvider
‪array stdWrap_fieldRequiredDataProvider()
Definition: ContentObjectRendererTest.php:5341
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\substring
‪substring(string $expect, string $content, string $conf)
Definition: ContentObjectRendererTest.php:1304
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_noTrimWrap
‪stdWrap_noTrimWrap(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:6326
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\prefixCommentDataProvider
‪array prefixCommentDataProvider()
Definition: ContentObjectRendererTest.php:8002
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\cropHTML
‪cropHTML(string $expect, string $content, string $conf)
Definition: ContentObjectRendererTest.php:903
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\linkWrapDataProvider
‪array linkWrapDataProvider()
Definition: ContentObjectRendererTest.php:7934
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\numberFormat
‪numberFormat(string $expects, $content, array $conf)
Definition: ContentObjectRendererTest.php:1089
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSiteWithBaseVariants
‪getDataWithTypeSiteWithBaseVariants()
Definition: ContentObjectRendererTest.php:1720
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preIfEmptyListNum
‪string stdWrap_preIfEmptyListNum($content='', $conf=[])
Definition: ContentObjectRenderer.php:1897
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strtotimeDataProvider
‪array stdWrap_strtotimeDataProvider()
Definition: ContentObjectRendererTest.php:7480
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeContext
‪getDataWithTypeContext()
Definition: ContentObjectRendererTest.php:1680
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLeveluid
‪getDataWithTypeLeveluid()
Definition: ContentObjectRendererTest.php:1542
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\numberFormatDataProvider
‪array numberFormatDataProvider()
Definition: ContentObjectRendererTest.php:1042
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setCurrentDataProvider
‪array stdWrap_setCurrentDataProvider()
Definition: ContentObjectRendererTest.php:7112
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\caseshiftDataProvider
‪array caseshiftDataProvider()
Definition: ContentObjectRendererTest.php:3369
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\specificExceptionsCanBeIgnoredByExceptionHandler
‪specificExceptionsCanBeIgnoredByExceptionHandler()
Definition: ContentObjectRendererTest.php:2452
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preCObject
‪string stdWrap_preCObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:2596
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_langViaTSFE
‪stdWrap_langViaTSFE(string $expected, string $input, array $conf, string $language)
Definition: ContentObjectRendererTest.php:6165
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_encodeForJavaScriptValueDataProvider
‪array stdWrap_encodeForJavaScriptValueDataProvider()
Definition: ContentObjectRendererTest.php:5224
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_required
‪string stdWrap_required($content='')
Definition: ContentObjectRenderer.php:2052
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDb
‪getDataWithTypeDb()
Definition: ContentObjectRendererTest.php:1640
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strPadDataProvider
‪array stdWrap_strPadDataProvider()
Definition: ContentObjectRendererTest.php:7303
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_bytes
‪stdWrap_bytes(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:3983
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_numRows
‪stdWrap_numRows()
Definition: ContentObjectRendererTest.php:6345
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\registersAllDefaultContentObjectsDataProvider
‪string[][] registersAllDefaultContentObjectsDataProvider()
Definition: ContentObjectRendererTest.php:337
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calculateCacheKey
‪calculateCacheKey(string $expect, array $conf, int $times, $with, $withWrap, $will)
Definition: ContentObjectRendererTest.php:3191
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_setCurrent
‪stdWrap_setCurrent(string $input, array $conf)
Definition: ContentObjectRendererTest.php:7154
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugPage
‪getDataWithTypeDebugPage()
Definition: ContentObjectRendererTest.php:1870
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGpDataProvider
‪array getDataWithTypeGpDataProvider()
Definition: ContentObjectRendererTest.php:1316
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLll
‪getDataWithTypeLll()
Definition: ContentObjectRendererTest.php:1656
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calculateCacheKeyDataProvider
‪array calculateCacheKeyDataProvider()
Definition: ContentObjectRendererTest.php:3131
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifNull
‪stdWrap_ifNull($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5811
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stripHtml
‪stdWrap_stripHtml()
Definition: ContentObjectRendererTest.php:7468
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_numberFormat
‪string stdWrap_numberFormat($content='', $conf=[])
Definition: ContentObjectRenderer.php:2259
‪TYPO3\CMS\Frontend\Exception
Definition: Exception.php:23
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeGetenv
‪getDataWithTypeGetenv()
Definition: ContentObjectRendererTest.php:1361
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksFiles
‪typolinkReturnsCorrectLinksFiles($linkText, $configuration, $expectedResult)
Definition: ContentObjectRendererTest.php:2885
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifEmpty
‪stdWrap_ifEmpty($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5769
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionReturnsEmptyStringIfNoSourcesAreDefinedDataProvider
‪array getImageSourceCollectionReturnsEmptyStringIfNoSourcesAreDefinedDataProvider()
Definition: ContentObjectRendererTest.php:1981
‪TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject
Definition: ScalableVectorGraphicsContentObject.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_requiredDataProvider
‪array stdWrap_requiredDataProvider()
Definition: ContentObjectRendererTest.php:7018
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editPanelDataProvider
‪array stdWrap_editPanelDataProvider()
Definition: ContentObjectRendererTest.php:5148
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionRendersDefinedLayoutKeyData
‪getImageSourceCollectionRendersDefinedLayoutKeyData( $layoutKey, $configuration, $xhtmlDoctype, $expectedHtml)
Definition: ContentObjectRendererTest.php:2228
‪TYPO3\CMS\Frontend\Page\PageRepository
Definition: PageRepository.php:53
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifBlank
‪stdWrap_ifBlank($expect, $content, array $conf)
Definition: ContentObjectRendererTest.php:5715
‪TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject
Definition: LoadRegisterContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrap
‪stdWrap_innerWrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5865
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_langDataProvider
‪array stdWrap_langDataProvider()
Definition: ContentObjectRendererTest.php:6099
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugFullRootline
‪getDataWithTypeDebugFullRootline()
Definition: ContentObjectRendererTest.php:1808
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_preUserFunc
‪stdWrap_preUserFunc()
Definition: ContentObjectRendererTest.php:6927
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_parseFunc
‪string stdWrap_parseFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:2125
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForEmailsAndUrlsDataProvider
‪array typolinkReturnsCorrectLinksForEmailsAndUrlsDataProvider()
Definition: ContentObjectRendererTest.php:2531
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:33
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject
Definition: CaseContentObjectTest.php:4
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageTagTemplateFallsBackToDefaultTemplateIfNoTemplateIsFoundDataProvider
‪array getImageTagTemplateFallsBackToDefaultTemplateIfNoTemplateIsFoundDataProvider()
Definition: ContentObjectRendererTest.php:1917
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_innerWrapDataProvider
‪array stdWrap_innerWrapDataProvider()
Definition: ContentObjectRendererTest.php:5822
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypePath
‪getDataWithTypePath()
Definition: ContentObjectRendererTest.php:1669
‪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:4962
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postUserFuncInt
‪stdWrap_postUserFuncInt()
Definition: ContentObjectRendererTest.php:6657
‪TYPO3\CMS\Core\Resource\File
Definition: File.php:23
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_postUserFunc
‪stdWrap_postUserFunc()
Definition: ContentObjectRendererTest.php:6618
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\substringDataProvider
‪array substringDataProvider()
Definition: ContentObjectRendererTest.php:1276
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeSite
‪getDataWithTypeSite()
Definition: ContentObjectRendererTest.php:1698
‪TYPO3\CMS\Frontend\ContentObject\UserContentObject
Definition: UserContentObject.php:23
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\notAllStdWrapProcessorsAreCallableWithEmptyConfiguration
‪notAllStdWrapProcessorsAreCallableWithEmptyConfiguration()
Definition: ContentObjectRendererTest.php:3534
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_intval
‪stdWrap_intval(int $expect, $content)
Definition: ContentObjectRendererTest.php:6031
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prefixCommentDataProvider
‪array stdWrap_prefixCommentDataProvider()
Definition: ContentObjectRendererTest.php:6775
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredLocally
‪renderingContentObjectDoesNotThrowExceptionIfExceptionHandlerIsConfiguredLocally()
Definition: ContentObjectRendererTest.php:2375
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevel
‪getDataWithTypeLevel()
Definition: ContentObjectRendererTest.php:1477
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:35
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postCObject
‪string stdWrap_postCObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:2609
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editPanel
‪stdWrap_editPanel(string $expect, string $content, bool $login, int $times, string $will)
Definition: ContentObjectRendererTest.php:5191
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifEmptyDataProvider
‪array stdWrap_ifEmptyDataProvider()
Definition: ContentObjectRendererTest.php:5726
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strftimeDataProvider
‪array stdWrap_strftimeDataProvider()
Definition: ContentObjectRendererTest.php:7411
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_noTrimWrapDataProvider
‪array stdWrap_noTrimWrapDataProvider()
Definition: ContentObjectRendererTest.php:6253
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_crop
‪stdWrap_crop()
Definition: ContentObjectRendererTest.php:4381
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\globalExceptionHandlerConfigurationCanBeOverriddenByLocalConfiguration
‪globalExceptionHandlerConfigurationCanBeOverriddenByLocalConfiguration()
Definition: ContentObjectRendererTest.php:2399
‪TYPO3\CMS\Frontend\ContentObject\ImageResourceContentObject
Definition: ImageResourceContentObject.php:21
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest
Definition: ContentObjectRendererTest.php:77
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calcAge
‪calcAge(string $expect, int $timestamp, string $labels)
Definition: ContentObjectRendererTest.php:1233
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prioriCalcDataProvider
‪array stdWrap_prioriCalcDataProvider()
Definition: ContentObjectRendererTest.php:6877
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_char
‪stdWrap_char()
Definition: ContentObjectRendererTest.php:4362
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_substring
‪string stdWrap_substring($content='', $conf=[])
Definition: ContentObjectRenderer.php:2380
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_field
‪string stdWrap_field($content='', $conf=[])
Definition: ContentObjectRenderer.php:1780
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugFunc
‪stdWrap_debugFunc(bool $expectArray, $confDebugFunc)
Definition: ContentObjectRendererTest.php:4775
‪TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject
Definition: EditPanelContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsExcludesGetParameters
‪getQueryArgumentsExcludesGetParameters()
Definition: ContentObjectRendererTest.php:391
‪TYPO3\CMS\Core\Utility\DebugUtility
Definition: DebugUtility.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugRegister
‪getDataWithTypeDebugRegister()
Definition: ContentObjectRendererTest.php:1850
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\createContentObjectThrowingExceptionFixture
‪PHPUnit_Framework_MockObject_MockObject createContentObjectThrowingExceptionFixture()
Definition: ContentObjectRendererTest.php:2470
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_strPad
‪stdWrap_strPad(string $expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:7399
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForEmailsAndUrls
‪typolinkReturnsCorrectLinksForEmailsAndUrls($linkText, $configuration, $expectedResult)
Definition: ContentObjectRendererTest.php:2623
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\replacement
‪replacement(string $expects, string $content, array $conf)
Definition: ContentObjectRendererTest.php:1160
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_orderedStdWrap
‪stdWrap_orderedStdWrap($firstConf, array $secondConf, array $conf)
Definition: ContentObjectRendererTest.php:4093
‪TYPO3\CMS\Core\Utility\DebugUtility\useAnsiColor
‪static useAnsiColor($ansiColorUsage)
Definition: DebugUtility.php:252
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_typolink
‪string stdWrap_typolink($content='', $conf=[])
Definition: ContentObjectRenderer.php:2642
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_dataWrap
‪string stdWrap_dataWrap($content='', $conf=[])
Definition: ContentObjectRenderer.php:2720
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dataDataProvider
‪array stdWrap_dataDataProvider()
Definition: ContentObjectRendererTest.php:4531
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\caseshift
‪caseshift(string $expect, string $content, string $case)
Definition: ContentObjectRendererTest.php:3391
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject
Definition: ContentObjectArrayContentObject.php:24
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertDataProvider
‪array stdWrap_insertDataProvider()
Definition: ContentObjectRendererTest.php:5960
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_current
‪stdWrap_current()
Definition: ContentObjectRendererTest.php:4504
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_csConvDataProvider
‪array stdWrap_csConvDataProvider()
Definition: ContentObjectRendererTest.php:4440
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_append
‪stdWrap_append()
Definition: ContentObjectRendererTest.php:3803
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapReturnsExpectation
‪stdWrapReturnsExpectation(string $content, array $configuration, string $expectation)
Definition: ContentObjectRendererTest.php:1266
‪TYPO3\CMS\Frontend\ContentObject\CaseContentObject
Definition: CaseContentObject.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\prefixComment
‪prefixComment(string $expect, string $comment, string $content)
Definition: ContentObjectRendererTest.php:8069
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesMultiDimensionalForcedParameters
‪getQueryArgumentsOverrulesMultiDimensionalForcedParameters()
Definition: ContentObjectRendererTest.php:481
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_encapsLines
‪string stdWrap_encapsLines($content='', $conf=[])
Definition: ContentObjectRenderer.php:2514
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapAlign
‪stdWrap_wrapAlign(string $expect, string $content, $wrapAlignConf)
Definition: ContentObjectRendererTest.php:7895
‪TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject
Definition: FluidTemplateContentObject.php:30
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrap
‪stdWrap_stdWrap()
Definition: ContentObjectRendererTest.php:7209
‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
Definition: FrontendInterface.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_addPageCacheTagsAddsPageTags
‪stdWrap_addPageCacheTagsAddsPageTags(array $expectedTags, array $configuration)
Definition: ContentObjectRendererTest.php:3754
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\linkWrap
‪linkWrap(string $expected, string $content, $wrap)
Definition: ContentObjectRendererTest.php:7990
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setUserObjectType_getUserObjectType
‪setUserObjectType_getUserObjectType()
Definition: ContentObjectRendererTest.php:8114
‪TYPO3\CMS\Core\TypoScript\TemplateService
Definition: TemplateService.php:50
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\recursiveStdWrapIsOnlyCalledOnce
‪recursiveStdWrapIsOnlyCalledOnce()
Definition: ContentObjectRendererTest.php:1010
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_append
‪string stdWrap_append($content='', $conf=[])
Definition: ContentObjectRenderer.php:2746
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typoLinkReturnsOnlyLinkTextIfNoLinkResolvingIsPossible
‪typoLinkReturnsOnlyLinkTextIfNoLinkResolvingIsPossible()
Definition: ContentObjectRendererTest.php:3085
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionRendersDefinedLayoutKeyDefault
‪getImageSourceCollectionRendersDefinedLayoutKeyDefault($layoutKey, $configuration)
Definition: ContentObjectRendererTest.php:2108
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFieldAndFieldIsMultiDimensional
‪getDataWithTypeFieldAndFieldIsMultiDimensional()
Definition: ContentObjectRendererTest.php:1401
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_crop
‪string stdWrap_crop($content='', $conf=[])
Definition: ContentObjectRenderer.php:2418
‪TYPO3\CMS\Core\Resource\ResourceStorage
Definition: ResourceStorage.php:74
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_br
‪stdWrap_br($expected, $input, $xhtmlDoctype)
Definition: ContentObjectRendererTest.php:3865
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifBlankDataProvider
‪array stdWrap_ifBlankDataProvider()
Definition: ContentObjectRendererTest.php:5680
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_editIconsDataProvider
‪array stdWrap_editIconsDataProvider()
Definition: ContentObjectRendererTest.php:4872
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getQueryArgumentsOverrulesMultiDimensionalParameters
‪getQueryArgumentsOverrulesMultiDimensionalParameters()
Definition: ContentObjectRendererTest.php:439
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_listNum
‪stdWrap_listNum()
Definition: ContentObjectRendererTest.php:6221
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:97
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_typolink
‪stdWrap_typolink()
Definition: ContentObjectRendererTest.php:7650
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_orderedStdWrapDataProvider
‪array stdWrap_orderedStdWrapDataProvider()
Definition: ContentObjectRendererTest.php:4038
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeLevelmedia
‪getDataWithTypeLevelmedia()
Definition: ContentObjectRendererTest.php:1523
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cacheRead
‪stdWrap_cacheRead(string $expect, string $input, array $conf, int $times, $with, $will)
Definition: ContentObjectRendererTest.php:4173
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImgResourceCallsGetImgResourcePostProcessHook
‪getImgResourceCallsGetImgResourcePostProcessHook()
Definition: ContentObjectRendererTest.php:196
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrapBrTagDataProvider
‪array stdWrapBrTagDataProvider()
Definition: ContentObjectRendererTest.php:3876
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageTagTemplateReturnTemplateElementIdentifiedByKey
‪getImageTagTemplateReturnTemplateElementIdentifiedByKey($key, $configuration, $expectation)
Definition: ContentObjectRendererTest.php:1972
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_fieldRequired
‪stdWrap_fieldRequired(string $expect, bool $stop, string $content, array $conf)
Definition: ContentObjectRendererTest.php:5429
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifNullDataProvider
‪array stdWrap_ifNullDataProvider()
Definition: ContentObjectRendererTest.php:5780
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_expandListDataProvider
‪array stdWrap_expandListDataProvider()
Definition: ContentObjectRendererTest.php:5279
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debugFuncDataProvider
‪array stdWrap_debugFuncDataProvider()
Definition: ContentObjectRendererTest.php:4745
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\fourTypesOfStdWrapHookObjectProcessors
‪fourTypesOfStdWrapHookObjectProcessors(string $stdWrapMethod, string $hookObjectCall)
Definition: ContentObjectRendererTest.php:3611
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectOneSourceCollectionHookInterface
Definition: ContentObjectOneSourceCollectionHookInterface.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_date
‪stdWrap_date(string $expected, $content, array $conf, int $now)
Definition: ContentObjectRendererTest.php:4666
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFromCacheDtataProvider
‪array getFromCacheDtataProvider()
Definition: ContentObjectRendererTest.php:3208
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_csConv
‪stdWrap_csConv(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:4485
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_bytesDataProvider
‪array stdWrap_bytesDataProvider()
Definition: ContentObjectRendererTest.php:3926
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cObject
‪string stdWrap_cObject($content='', $conf=[])
Definition: ContentObjectRenderer.php:1808
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getCurrentTable
‪getCurrentTable()
Definition: ContentObjectRendererTest.php:7924
‪TYPO3\CMS\Core\Log\Logger
Definition: Logger.php:23
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionRendersDefinedSources
‪getImageSourceCollectionRendersDefinedSources()
Definition: ContentObjectRendererTest.php:2013
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setCurrentFile_getCurrentFile
‪setCurrentFile_getCurrentFile()
Definition: ContentObjectRendererTest.php:8082
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:91
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_overrideDataProvider
‪array stdWrap_overrideDataProvider()
Definition: ContentObjectRendererTest.php:6455
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\$frontendControllerMock
‪PHPUnit_Framework_MockObject_MockObject TypoScriptFrontendController AccessibleObjectInterface $frontendControllerMock
Definition: ContentObjectRendererTest.php:89
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_htmlSpecialChars
‪stdWrap_htmlSpecialChars(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:5551
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_insertDataAndInputExamples
‪stdWrap_insertDataAndInputExamples($expect, string $content)
Definition: ContentObjectRendererTest.php:5977
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\isGetImgResourceHookCalledCallback
‪array isGetImgResourceHookCalledCallback(string $file, array $fileArray, $imageResource, ContentObjectRenderer $parent)
Definition: ContentObjectRendererTest.php:232
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\HTMLcaseshift
‪HTMLcaseshift(string $expect, string $content, string $case, array $with, array $will)
Definition: ContentObjectRendererTest.php:3465
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_debug
‪stdWrap_debug()
Definition: ContentObjectRendererTest.php:4680
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeFullrootline
‪getDataWithTypeFullrootline()
Definition: ContentObjectRendererTest.php:1579
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getImageSourceCollectionRendersDefinedLayoutKeyDataDefaultProvider
‪array getImageSourceCollectionRendersDefinedLayoutKeyDataDefaultProvider()
Definition: ContentObjectRendererTest.php:2065
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
Definition: FrontendUserAuthentication.php:28
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_dateDataProvider
‪array stdWrap_dateDataProvider()
Definition: ContentObjectRendererTest.php:4621
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeParameters
‪getDataWithTypeParameters()
Definition: ContentObjectRendererTest.php:1429
‪TYPO3\CMS\Frontend\ContentObject\TextContentObject
Definition: TextContentObject.php:21
‪TYPO3\CMS\Frontend\ContentObject\RecordsContentObject
Definition: RecordsContentObject.php:27
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHasLeadingSpaceIfNotEmpty
‪aTagParamsHasLeadingSpaceIfNotEmpty()
Definition: ContentObjectRendererTest.php:1887
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\willThrowAnExceptionForARegisteredNonContentObject
‪willThrowAnExceptionForARegisteredNonContentObject()
Definition: ContentObjectRendererTest.php:324
‪TYPO3\CMS\Frontend\ContentObject\FilesContentObject
Definition: FilesContentObject.php:26
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_stdWrapValue
‪stdWrap_stdWrapValue(string $key, array $configuration, string $defaultValue, string $expected)
Definition: ContentObjectRendererTest.php:7288
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_outerWrap
‪stdWrap_outerWrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:6442
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrapDataProvider
‪array stdWrap_wrapDataProvider()
Definition: ContentObjectRendererTest.php:7673
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_age
‪string stdWrap_age($content='', $conf=[])
Definition: ContentObjectRenderer.php:2340
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_numberFormat
‪stdWrap_numberFormat()
Definition: ContentObjectRendererTest.php:6373
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_age
‪stdWrap_age()
Definition: ContentObjectRendererTest.php:3772
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\calcAgeDataProvider
‪array calcAgeDataProvider()
Definition: ContentObjectRendererTest.php:1173
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap2
‪stdWrap_wrap2(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7792
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap
‪stdWrap_wrap(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7726
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHasNoLeadingSpaceIfEmpty
‪aTagParamsHasNoLeadingSpaceIfEmpty()
Definition: ContentObjectRendererTest.php:1906
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\renderingContentObjectThrowsException
‪renderingContentObjectThrowsException()
Definition: ContentObjectRendererTest.php:2350
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_cropHTML
‪string stdWrap_cropHTML($content='', $conf=[])
Definition: ContentObjectRenderer.php:2393
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayInternalContentObject
Definition: ContentObjectArrayInternalContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_prioriCalc
‪stdWrap_prioriCalc($expect, string $content, array $conf)
Definition: ContentObjectRendererTest.php:6908
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_ifDataProvider
‪array stdWrap_ifDataProvider()
Definition: ContentObjectRendererTest.php:5564
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:27
‪TYPO3\CMS\Core\Resource\Exception\InvalidPathException
Definition: InvalidPathException.php:21
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\fourTypesOfStdWrapHookObjectProcessorsDataProvider
‪array fourTypesOfStdWrapHookObjectProcessorsDataProvider()
Definition: ContentObjectRendererTest.php:3574
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getFieldVal
‪getFieldVal($expect, string $fields)
Definition: ContentObjectRendererTest.php:3347
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_data
‪string stdWrap_data($content='', $conf=[])
Definition: ContentObjectRenderer.php:1764
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_wrap3
‪stdWrap_wrap3(string $expected, string $input, array $conf)
Definition: ContentObjectRendererTest.php:7855
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\getDataWithTypeDebugData
‪getDataWithTypeDebugData()
Definition: ContentObjectRendererTest.php:1830
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_preUserFunc
‪string stdWrap_preUserFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:1849
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_cropHTML
‪stdWrap_cropHTML()
Definition: ContentObjectRendererTest.php:4414
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postUserFuncInt
‪string stdWrap_postUserFuncInt($content='', $conf=[])
Definition: ContentObjectRenderer.php:2833
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\aTagParamsHaveSpaceBetweenLocalAndGlobalParams
‪aTagParamsHaveSpaceBetweenLocalAndGlobalParams()
Definition: ContentObjectRendererTest.php:1896
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_data
‪stdWrap_data(array $expect, array $data, $alt)
Definition: ContentObjectRendererTest.php:4564
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:36
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_splitObjReturnsCount
‪stdWrap_splitObjReturnsCount()
Definition: ContentObjectRendererTest.php:3112
‪TYPO3\CMS\Frontend\ContentObject\ContentContentObject
Definition: ContentContentObject.php:25
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\stdWrap_case
‪stdWrap_case()
Definition: ContentObjectRendererTest.php:4336
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\typolinkReturnsCorrectLinksForFilesWithAbsRefPrefixDataProvider
‪array typolinkReturnsCorrectLinksForFilesWithAbsRefPrefixDataProvider()
Definition: ContentObjectRendererTest.php:2917
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\setCurrentVal_getCurrentVal
‪setCurrentVal_getCurrentVal()
Definition: ContentObjectRendererTest.php:8099
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\exceptionHandlerIsEnabledByDefaultInProductionContext
‪exceptionHandlerIsEnabledByDefaultInProductionContext()
Definition: ContentObjectRendererTest.php:2361
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_fieldRequired
‪string stdWrap_fieldRequired($content='', $conf=[])
Definition: ContentObjectRenderer.php:2088
‪TYPO3\CMS\Frontend\Tests\Unit\ContentObject\ContentObjectRendererTest\recursiveStdWrapProperlyRendersBasicString
‪recursiveStdWrapProperlyRendersBasicString()
Definition: ContentObjectRendererTest.php:993
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_postUserFunc
‪string stdWrap_postUserFunc($content='', $conf=[])
Definition: ContentObjectRenderer.php:2819