‪TYPO3CMS  ‪main
JsonViewTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
28 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
29 
30 final class ‪JsonViewTest extends UnitTestCase
31 {
32  protected bool ‪$resetSingletonInstances = true;
33 
34  public static function ‪transformValueDataProvider(): array
35  {
36  ‪$output = [];
37 
38  $object = new \stdClass();
39  $object->value1 = 'foo';
40  $object->value2 = 1;
41  $configuration = [];
42  $expected = ['value1' => 'foo', 'value2' => 1];
43  ‪$output[] = [$object, $configuration, $expected, 'all direct child properties should be serialized'];
44 
45  $configuration = ['_only' => ['value1']];
46  $expected = ['value1' => 'foo'];
47  ‪$output[] = [$object, $configuration, $expected, 'if "only" properties are specified, only these should be serialized'];
48 
49  $configuration = ['_exclude' => ['value1']];
50  $expected = ['value2' => 1];
51  ‪$output[] = [$object, $configuration, $expected, 'if "exclude" properties are specified, they should not be serialized'];
52 
53  $object = new \stdClass();
54  $object->value1 = new \stdClass();
55  $object->value1->subvalue1 = 'Foo';
56  $object->value2 = 1;
57  $configuration = [];
58  $expected = ['value2' => 1];
59  ‪$output[] = [$object, $configuration, $expected, 'by default, sub objects of objects should not be serialized.'];
60 
61  $object = new \stdClass();
62  $object->value1 = ['subarray' => 'value'];
63  $object->value2 = 1;
64  $configuration = [];
65  $expected = ['value2' => 1];
66  ‪$output[] = [$object, $configuration, $expected, 'by default, sub arrays of objects should not be serialized.'];
67 
68  $object = ['foo' => 'bar', 1 => 'baz', 'deep' => ['test' => 'value']];
69  $configuration = [];
70  $expected = ['foo' => 'bar', 1 => 'baz', 'deep' => ['test' => 'value']];
71  ‪$output[] = [$object, $configuration, $expected, 'associative arrays should be serialized deeply'];
72 
73  $object = ['foo', 'bar'];
74  $configuration = [];
75  $expected = ['foo', 'bar'];
76  ‪$output[] = [$object, $configuration, $expected, 'numeric arrays should be serialized'];
77 
78  $nestedObject = new \stdClass();
79  $nestedObject->value1 = 'foo';
80  $object = [$nestedObject];
81  $configuration = [];
82  $expected = [['value1' => 'foo']];
83  ‪$output[] = [$object, $configuration, $expected, 'array of objects should be serialized'];
84 
85  $properties = ['foo' => 'bar', 'prohibited' => 'xxx'];
86  $nestedObject = new class ($properties) {
87  private array $properties;
88  private string $prohibited = 'foo';
89  public function __construct(array $properties)
90  {
91  $this->properties = $properties;
92  }
93  public function getName(): string
94  {
95  return 'name';
96  }
97 
98  public function getPath(): string
99  {
100  return 'path';
101  }
102 
103  public function getProperties(): array
104  {
105  return $this->properties;
106  }
107 
108  public function getProhibited(): string
109  {
110  return $this->prohibited;
111  }
112  };
113  $object = $nestedObject;
114  $configuration = [
115  '_only' => ['name', 'path', 'properties'],
116  '_descend' => [
117  'properties' => [
118  '_exclude' => ['prohibited'],
119  ],
120  ],
121  ];
122  $expected = [
123  'name' => 'name',
124  'path' => 'path',
125  'properties' => ['foo' => 'bar'],
126  ];
127  ‪$output[] = [$object, $configuration, $expected, 'descending into arrays should be possible'];
128 
129  $nestedObject = new \stdClass();
130  $nestedObject->value1 = 'foo';
131  $value = new \SplObjectStorage();
132  $value->attach($nestedObject);
133  $configuration = [];
134  $expected = [['value1' => 'foo']];
135  ‪$output[] = [$value, $configuration, $expected, 'SplObjectStorage with objects should be serialized'];
136 
137  $dateTimeObject = new \DateTime('2011-02-03T03:15:23', new \DateTimeZone('UTC'));
138  $configuration = [];
139  $expected = '2011-02-03T03:15:23+00:00';
140  ‪$output[] = [$dateTimeObject, $configuration, $expected, 'DateTime object in UTC time zone should not be serialized.'];
141 
142  $dateTimeObject = new \DateTime('2013-08-15T15:25:30', new \DateTimeZone('America/Los_Angeles'));
143  $configuration = [];
144  $expected = '2013-08-15T15:25:30-07:00';
145  ‪$output[] = [$dateTimeObject, $configuration, $expected, 'DateTime object in America/Los_Angeles time zone should not be serialized.'];
146 
147  $dateTimeObject = new \DateTimeImmutable('2021-08-29T10:36:24', new \DateTimeZone('UTC'));
148  $configuration = [];
149  $expected = '2021-08-29T10:36:24+00:00';
150  ‪$output[] = [$dateTimeObject, $configuration, $expected, 'DateTimeImmutable object in UTC time zone should not be serialized.'];
151 
152  return ‪$output;
153  }
154 
155  #[DataProvider('transformValueDataProvider')]
156  #[Test]
157  public function ‪transformValue(object|array $object, array $configuration, array|string $expected, string $description): void
158  {
159  GeneralUtility::setSingletonInstance(ReflectionService::class, new ‪ReflectionService(new ‪NullFrontend('extbase'), 'ClassSchemata'));
160 
161  $jsonView = $this->getAccessibleMock(JsonView::class, null, [], '', false);
162 
163  $actual = $jsonView->_call('transformValue', $object, $configuration);
164 
165  self::assertSame($expected, $actual, $description);
166  }
167 
168  public static function ‪recursiveDataProvider(): array
169  {
170  $object = new class ('foo') {
171  private $value1 = '';
172  private $child;
173  public function __construct($value1)
174  {
175  $this->value1 = $value1;
176  }
177  public function getValue1(): string
178  {
179  return $this->value1;
180  }
181  public function setValue1(string $value1): void
182  {
183  $this->value1 = $value1;
184  }
185  public function getChild()
186  {
187  return $this->child;
188  }
189  public function setChild($child): void
190  {
191  $this->child = $child;
192  }
193  };
194 
195  $child1 = clone $object;
196  $child1->setValue1('bar');
197  $child2 = clone $object;
198  $child2->setValue1('baz');
199  $child1->setChild($child2);
200  $object->setChild($child1);
201 
202  $configuration = [
203  'testData' => [
204  '_recursive' => ['child'],
205  ],
206  ];
207 
208  $expected = [
209  'child' => [
210  'child' => [
211  'child' => null,
212  'value1' => 'baz',
213  ],
214  'value1' => 'bar',
215  ],
216  'value1' => 'foo',
217  ];
218 
219  ‪$output[] = [$object, $configuration, $expected, 'testData', 'Recursive rendering of defined property should be possible.'];
220 
221  $object = new class ('foo') {
222  private $value1 = '';
223  private $children = [];
224  private $secret = 'secret';
225  public function __construct($value1)
226  {
227  $this->value1 = $value1;
228  }
229  public function getValue1(): string
230  {
231  return $this->value1;
232  }
233  public function setValue1(string $value1): void
234  {
235  $this->value1 = $value1;
236  }
237  public function getChildren(): array
238  {
239  return $this->children;
240  }
241  public function addChild($child): void
242  {
243  $this->children[] = $child;
244  }
245  public function getSecret(): string
246  {
247  return $this->secret;
248  }
249  };
250  $child1 = clone $object;
251  $child1->setValue1('bar');
252  $child1->addChild(clone $object);
253  $child1->addChild(clone $object);
254 
255  $child2 = clone $object;
256  $child2->setValue1('baz');
257  $child2->addChild(clone $object);
258  $child2->addChild(clone $object);
259 
260  $object->addChild($child1);
261  $object->addChild($child2);
262  $children = [
263  clone $object,
264  clone $object,
265  ];
266 
267  $configuration = [
268  'testData' => [
269  '_descendAll' => [
270  '_exclude' => ['secret'],
271  '_recursive' => ['children'],
272  ],
273  ],
274  ];
275 
276  $expected = [
277  [
278  'children' => [
279  [
280  'children' => [
281  ['children' => [], 'value1' => 'foo'],
282  ['children' => [], 'value1' => 'foo'],
283  ],
284  'value1' => 'bar',
285  ],
286  [
287  'children' => [
288  ['children' => [], 'value1' => 'foo'],
289  ['children' => [], 'value1' => 'foo'],
290  ],
291  'value1' => 'baz',
292  ],
293  ],
294  'value1' => 'foo',
295  ],
296  [
297  'children' => [
298  [
299  'children' => [
300  ['children' => [], 'value1' => 'foo'],
301  ['children' => [], 'value1' => 'foo'],
302  ],
303  'value1' => 'bar',
304  ],
305  [
306  'children' => [
307  ['children' => [], 'value1' => 'foo'],
308  ['children' => [], 'value1' => 'foo'],
309  ],
310  'value1' => 'baz',
311  ],
312  ],
313  'value1' => 'foo',
314  ],
315  ];
316  ‪$output[] = [$children, $configuration, $expected, 'testData', 'Recursive rendering of lists of defined property should be possible.'];
317 
318  return ‪$output;
319  }
320 
321  #[DataProvider('recursiveDataProvider')]
322  #[Test]
323  public function ‪recursive(object|array $object, array $configuration, object|array $expected, string $variableToRender, string $description): void
324  {
325  GeneralUtility::setSingletonInstance(ReflectionService::class, new ‪ReflectionService(new ‪NullFrontend('extbase'), 'ClassSchemata'));
326 
327  $jsonView = $this->getAccessibleMock(JsonView::class, null, [], '', false);
328  $jsonView->_set('configuration', $configuration);
329  $jsonView->_set('variablesToRender', [$variableToRender]);
330  $jsonView->_call('assign', $variableToRender, $object);
331  $actual = $jsonView->_call('renderArray');
332 
333  self::assertSame($expected, $actual, $description);
334  }
335 
337  {
338  ‪$output = [];
339 
340  $dummyIdentifier = 'e4f40dfc-8c6e-4414-a5b1-6fd3c5cf7a53';
341 
342  $object = new \stdClass();
343  $object->value1 = new \stdClass();
344  $configuration = [
345  '_descend' => [
346  'value1' => [
347  '_exposeObjectIdentifier' => true,
348  ],
349  ],
350  ];
351 
352  $expected = ['value1' => ['__identity' => $dummyIdentifier]];
353  ‪$output[] = [$object, $configuration, $expected, $dummyIdentifier, 'boolean TRUE should result in __identity key'];
354 
355  $configuration['_descend']['value1']['_exposedObjectIdentifierKey'] = 'guid';
356  $expected = ['value1' => ['guid' => $dummyIdentifier]];
357  ‪$output[] = [$object, $configuration, $expected, $dummyIdentifier, 'string value should result in string-equal key'];
358 
359  return ‪$output;
360  }
361 
362  #[DataProvider('transformValueWithObjectIdentifierExposureDataProvider')]
363  #[Test]
365  object $object,
366  array $configuration,
367  array $expected,
368  string $dummyIdentifier,
369  string $description
370  ): void {
371  $persistenceManagerMock = $this->getMockBuilder(PersistenceManager::class)
372  ->disableOriginalConstructor()
373  ->onlyMethods(['getIdentifierByObject'])
374  ->getMock();
375  $jsonView = $this->getAccessibleMock(JsonView::class, null, [], '', false);
376  $jsonView->_set('persistenceManager', $persistenceManagerMock);
377 
378  $persistenceManagerMock->expects(self::once())->method('getIdentifierByObject')->with($object->value1)->willReturn($dummyIdentifier);
379 
380  $actual = $jsonView->_call('transformValue', $object, $configuration);
381 
382  self::assertSame($expected, $actual, $description);
383  }
384 
386  {
387  $className = ‪StringUtility::getUniqueId('DummyClass');
388  $namespace = 'TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\\' . $className;
389  return [
390  [
392  $className,
393  $namespace,
394  ['value1' => ['__class' => $namespace . '\\' . $className]],
395  ],
396  [
398  $className,
399  $namespace,
400  ['value1' => ['__class' => $className]],
401  ],
402  [
403  null,
404  $className,
405  $namespace,
406  ['value1' => []],
407  ],
408  ];
409  }
410 
411  #[DataProvider('viewExposesClassNameFullyIfConfiguredSoDataProvider')]
412  #[Test]
414  ?int $exposeClassNameSetting,
415  string $className,
416  string $namespace,
417  array $expected
418  ): void {
419  $fullyQualifiedClassName = $namespace . '\\' . $className;
420  if (class_exists($fullyQualifiedClassName) === false) {
421  eval('namespace ' . $namespace . '; class ' . $className . ' {}');
422  }
423 
424  $object = new \stdClass();
425  $object->value1 = new $fullyQualifiedClassName();
426  $configuration = [
427  '_descend' => [
428  'value1' => [
429  '_exposeClassName' => $exposeClassNameSetting,
430  ],
431  ],
432  ];
433 
434  GeneralUtility::setSingletonInstance(ReflectionService::class, new ‪ReflectionService(new ‪NullFrontend('extbase'), 'ClassSchemata'));
435 
436  $jsonView = $this->getAccessibleMock(JsonView::class, null, [], '', false);
437  $actual = $jsonView->_call('transformValue', $object, $configuration);
438  self::assertSame($expected, $actual);
439  }
440 
441  #[Test]
443  {
444  $object = new \stdClass();
445  $object->foo = 'Foo';
446  $subject = new ‪JsonView();
447  $subject->assign('value', $object);
448 
449  $expectedResult = '{"foo":"Foo"}';
450  $actualResult = $subject->render();
451  self::assertSame($expectedResult, $actualResult);
452  }
453 
454  #[Test]
456  {
457  $array = ['foo' => 'Foo', 'bar' => 'Bar'];
458  $subject = new ‪JsonView();
459  $subject->assign('value', $array);
460 
461  $expectedResult = '{"foo":"Foo","bar":"Bar"}';
462  $actualResult = $subject->render();
463  self::assertSame($expectedResult, $actualResult);
464  }
465 
466  #[Test]
468  {
469  $value = 'Foo';
470  $subject = new ‪JsonView();
471  $subject->assign('value', $value);
472 
473  $expectedResult = '"Foo"';
474  $actualResult = $subject->render();
475  self::assertSame($expectedResult, $actualResult);
476  }
477 
478  #[Test]
480  {
481  $value = 'Gürkchen';
482  $subject = new ‪JsonView();
483  $subject->assign('value', $value);
484 
485  $actualResult = $subject->render();
486 
487  $expectedResult = '"' . $value . '"';
488  self::assertSame($expectedResult, $actualResult);
489  }
490 
491  public static function ‪escapeCharacterDataProvider(): array
492  {
493  return [
494  'backslash' => ['\\'],
495  'double quote' => ['"'],
496  ];
497  }
498 
499  #[DataProvider('escapeCharacterDataProvider')]
500  #[Test]
501  public function ‪renderEscapesEscapeCharacters(string $character): void
502  {
503  $subject = new ‪JsonView();
504  $subject->assign('value', $character);
505 
506  $actualResult = $subject->render();
507 
508  $expectedResult = '"\\' . $character . '"';
509  self::assertSame($expectedResult, $actualResult);
510  }
511 
512  #[Test]
514  {
515  $value = 'Foo';
516  $subject = new ‪JsonView();
517  $subject->assign('foo', $value);
518 
519  $expectedResult = 'null';
520  $actualResult = $subject->render();
521  self::assertSame($expectedResult, $actualResult);
522  }
523 
524  #[Test]
526  {
527  $subject = new ‪JsonView();
528  $subject
529  ->assign('value', 'Value')
530  ->assign('someOtherVariable', 'Foo');
531 
532  $expectedResult = '"Value"';
533  $actualResult = $subject->render();
534  self::assertSame($expectedResult, $actualResult);
535  }
536 
537  #[Test]
539  {
540  $value = 'Foo';
541  $subject = new ‪JsonView();
542  $subject->assign('foo', $value);
543  $subject->setVariablesToRender(['foo']);
544 
545  $expectedResult = '"Foo"';
546  $actualResult = $subject->render();
547  self::assertSame($expectedResult, $actualResult);
548  }
549 
550  #[Test]
552  {
553  $subject = new ‪JsonView();
554  $subject
555  ->assign('value', 'Value1')
556  ->assign('secondValue', 'Value2')
557  ->assign('someOtherVariable', 'Value3');
558  $subject->setVariablesToRender(['value', 'secondValue']);
559 
560  $expectedResult = '{"value":"Value1","secondValue":"Value2"}';
561  $actualResult = $subject->render();
562  self::assertSame($expectedResult, $actualResult);
563  }
564 
565  #[Test]
567  {
568  $array = ['foo' => ['bar' => 'Baz']];
569  $object = new \stdClass();
570  $object->foo = 'Foo';
571 
572  $subject = new ‪JsonView();
573  $subject
574  ->assign('array', $array)
575  ->assign('object', $object)
576  ->assign('someOtherVariable', 'Value3');
577  $subject->setVariablesToRender(['array', 'object']);
578 
579  $expectedResult = '{"array":{"foo":{"bar":"Baz"}},"object":{"foo":"Foo"}}';
580  $actualResult = $subject->render();
581  self::assertSame($expectedResult, $actualResult);
582  }
583 
584  #[Test]
585  public function ‪renderCanRenderPlainArray(): void
586  {
587  $array = [['name' => 'Foo', 'secret' => true], ['name' => 'Bar', 'secret' => true]];
588 
589  $subject = new ‪JsonView();
590  $subject->assign('value', $array);
591  $subject->setConfiguration([
592  'value' => [
593  '_descendAll' => [
594  '_only' => ['name'],
595  ],
596  ],
597  ]);
598 
599  $expectedResult = '[{"name":"Foo"},{"name":"Bar"}]';
600  $actualResult = $subject->render();
601  self::assertSame($expectedResult, $actualResult);
602  }
603 
604  #[Test]
606  {
607  $array = [
608  'items' => [
609  ['name' => 'Foo'],
610  ['name' => 'Bar'],
611  ],
612  ];
613 
614  $subject = new ‪JsonView();
615  $subject->assign('value', $array);
616  $subject->setConfiguration([
617  'value' => [
618  'items' => [
619  // note: this exclude is just here, and should have no effect as the items have numeric keys
620  '_exclude' => ['secret'],
621  ],
622  ],
623  ]);
624 
625  $expectedResult = '{"items":[{"name":"Foo"},{"name":"Bar"}]}';
626  $actualResult = $subject->render();
627  self::assertSame($expectedResult, $actualResult);
628  }
629 
630  #[Test]
631  public function ‪descendAllKeepsArrayIndexes(): void
632  {
633  $array = [['name' => 'Foo', 'secret' => true], ['name' => 'Bar', 'secret' => true]];
634 
635  $subject = new ‪JsonView();
636  $subject->assign('value', $array);
637  $subject->setConfiguration([
638  'value' => [
639  '_descendAll' => [
640  '_descendAll' => [],
641  ],
642  ],
643  ]);
644 
645  $expectedResult = '[{"name":"Foo","secret":true},{"name":"Bar","secret":true}]';
646  $actualResult = $subject->render();
647  self::assertSame($expectedResult, $actualResult);
648  }
649 }
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\recursiveDataProvider
‪static recursiveDataProvider()
Definition: JsonViewTest.php:168
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderReturnsJsonRepresentationOfAssignedArray
‪renderReturnsJsonRepresentationOfAssignedArray()
Definition: JsonViewTest.php:455
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderOnlyRendersVariableWithTheNameValue
‪renderOnlyRendersVariableWithTheNameValue()
Definition: JsonViewTest.php:525
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderKeepsUtf8CharactersUnescaped
‪renderKeepsUtf8CharactersUnescaped()
Definition: JsonViewTest.php:479
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\transformValueWithObjectIdentifierExposure
‪transformValueWithObjectIdentifierExposure(object $object, array $configuration, array $expected, string $dummyIdentifier, string $description)
Definition: JsonViewTest.php:364
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: JsonViewTest.php:32
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\descendAllKeepsArrayIndexes
‪descendAllKeepsArrayIndexes()
Definition: JsonViewTest.php:631
‪TYPO3\CMS\Core\Cache\Frontend\NullFrontend
Definition: NullFrontend.php:30
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderCanRenderPlainArray
‪renderCanRenderPlainArray()
Definition: JsonViewTest.php:585
‪TYPO3\CMS\Extbase\Reflection\ReflectionService
Definition: ReflectionService.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderReturnsJsonRepresentationOfAssignedObject
‪renderReturnsJsonRepresentationOfAssignedObject()
Definition: JsonViewTest.php:442
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\viewExposesClassNameFullyIfConfiguredSo
‪viewExposesClassNameFullyIfConfiguredSo(?int $exposeClassNameSetting, string $className, string $namespace, array $expected)
Definition: JsonViewTest.php:413
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\transformValueDataProvider
‪static transformValueDataProvider()
Definition: JsonViewTest.php:34
‪TYPO3\CMS\Extbase\Mvc\View\JsonView\EXPOSE_CLASSNAME_FULLY_QUALIFIED
‪const EXPOSE_CLASSNAME_FULLY_QUALIFIED
Definition: JsonView.php:38
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderRendersMultipleValuesIfTheyAreSpecifiedAsVariablesToRender
‪renderRendersMultipleValuesIfTheyAreSpecifiedAsVariablesToRender()
Definition: JsonViewTest.php:551
‪TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
Definition: PersistenceManager.php:30
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\recursive
‪recursive(object|array $object, array $configuration, object|array $expected, string $variableToRender, string $description)
Definition: JsonViewTest.php:323
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderReturnsNullIfNameOfAssignedVariableIsNotEqualToValue
‪renderReturnsNullIfNameOfAssignedVariableIsNotEqualToValue()
Definition: JsonViewTest.php:513
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\transformValueWithObjectIdentifierExposureDataProvider
‪static transformValueWithObjectIdentifierExposureDataProvider()
Definition: JsonViewTest.php:336
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderReturnsJsonRepresentationOfAssignedSimpleValue
‪renderReturnsJsonRepresentationOfAssignedSimpleValue()
Definition: JsonViewTest.php:467
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\setVariablesToRenderOverridesValueToRender
‪setVariablesToRenderOverridesValueToRender()
Definition: JsonViewTest.php:538
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderEscapesEscapeCharacters
‪renderEscapesEscapeCharacters(string $character)
Definition: JsonViewTest.php:501
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View
Definition: JsonViewTest.php:18
‪$output
‪$output
Definition: annotationChecker.php:114
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\escapeCharacterDataProvider
‪static escapeCharacterDataProvider()
Definition: JsonViewTest.php:491
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\viewExposesClassNameFullyIfConfiguredSoDataProvider
‪static viewExposesClassNameFullyIfConfiguredSoDataProvider()
Definition: JsonViewTest.php:385
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderCanRenderPlainArrayWithNumericKeys
‪renderCanRenderPlainArrayWithNumericKeys()
Definition: JsonViewTest.php:605
‪TYPO3\CMS\Extbase\Mvc\View\JsonView\EXPOSE_CLASSNAME_UNQUALIFIED
‪const EXPOSE_CLASSNAME_UNQUALIFIED
Definition: JsonView.php:44
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest
Definition: JsonViewTest.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:24
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\renderCanRenderMultipleComplexObjects
‪renderCanRenderMultipleComplexObjects()
Definition: JsonViewTest.php:566
‪TYPO3\CMS\Extbase\Mvc\View\JsonView
Definition: JsonView.php:29
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static getUniqueId(string $prefix='')
Definition: StringUtility.php:57
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\View\JsonViewTest\transformValue
‪transformValue(object|array $object, array $configuration, array|string $expected, string $description)
Definition: JsonViewTest.php:157