‪TYPO3CMS  10.4
ObjectAccessTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
28 class ‪ObjectAccessTest extends UnitTestCase
29 {
33  protected ‪$resetSingletonInstances = true;
34 
38  protected ‪$dummyObject;
39 
43  protected function ‪setUp(): void
44  {
45  parent::setUp();
46  $this->dummyObject = new ‪DummyClassWithGettersAndSetters();
47  $this->dummyObject->setProperty('string1');
48  $this->dummyObject->setAnotherProperty(42);
49  $this->dummyObject->shouldNotBePickedUp = true;
50  }
51 
56  {
57  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'property');
58  self::assertEquals($property, 'string1');
59  }
60 
65  {
66  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'publicProperty2');
67  self::assertEquals($property, 42, 'A property of a given object was not returned correctly.');
68  }
69 
74  {
75  $this->expectException(PropertyNotAccessibleException::class);
76  $this->expectExceptionCode(1476109666);
77  ‪ObjectAccess::getProperty($this->dummyObject, 'notExistingProperty');
78  }
79 
84  {
85  $result = ‪ObjectAccess::getProperty([], 'notExistingProperty');
86  self::assertNull($result);
87  }
88 
93  {
94  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'booleanProperty');
95  self::assertTrue($property);
96  }
97 
102  {
103  self::assertFalse(‪ObjectAccess::setProperty($this->dummyObject, 'protectedProperty', 42));
104  }
105 
110  {
111  ‪ObjectAccess::setProperty($this->dummyObject, 'property', 4242);
112  self::assertEquals($this->dummyObject->getProperty(), 4242, 'setProperty does not work with setter.');
113  }
114 
118  public function ‪setPropertyWorksWithPublicProperty()
119  {
120  ‪ObjectAccess::setProperty($this->dummyObject, 'publicProperty', 4242);
121  self::assertEquals($this->dummyObject->publicProperty, 4242, 'setProperty does not work with public property.');
122  }
123 
128  {
129  $arrayObject = new \ArrayObject();
130  $array = [];
131  ‪ObjectAccess::setProperty($arrayObject, 'publicProperty', 4242);
132  ‪ObjectAccess::setProperty($array, 'key', 'value');
133  self::assertEquals(4242, $arrayObject['publicProperty']);
134  self::assertEquals('value', $array['key']);
135  }
136 
141  {
142  $arrayObject = new \ArrayObject(['key' => 'value']);
143  $actual = ‪ObjectAccess::getProperty($arrayObject, 'key');
144  self::assertEquals('value', $actual, 'getProperty does not work with ArrayObject property.');
145  }
146 
151  {
152  $objectStorage = new ‪ObjectStorage();
153  $object = new \stdClass();
154  $objectStorage->attach($object);
155  $actual = ‪ObjectAccess::getProperty($objectStorage, 0);
156  self::assertSame($object, $actual, 'getProperty does not work with ObjectStorage property.');
157  }
158 
163  {
164  $arrayAccessInstance = new ‪ArrayAccessClass(['key' => 'value']);
165  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'key');
166  self::assertEquals('value', $actual, 'getProperty does not work with Array Access property.');
167  }
168 
173  {
174  $arrayAccessInstance = new ‪ArrayAccessClass([]);
175  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'virtual');
176  self::assertEquals('default-value', $actual, 'getProperty does not work with Array Access property.');
177  }
178 
183  {
184  $arrayAccessInstance = new ‪ArrayAccessClass(['virtual' => 'overridden-value']);
185  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'virtual');
186  self::assertEquals('overridden-value', $actual, 'getProperty does not work with Array Access property.');
187  }
188 
193  {
194  $array = ['key' => 'value'];
195  $expected = ‪ObjectAccess::getProperty($array, 'key');
196  self::assertEquals($expected, 'value', 'getProperty does not work with Array property.');
197  }
198 
203  {
204  $array = ['parent' => ['key' => 'value']];
205  $actual = ‪ObjectAccess::getPropertyPath($array, 'parent.key');
206  self::assertEquals('value', $actual, 'getPropertyPath does not work with Array property.');
207  }
208 
213  {
214  $array = ['parent' => new \ArrayObject(['key' => 'value'])];
215  $actual = ‪ObjectAccess::getPropertyPath($array, 'parent.key');
216  self::assertEquals('value', $actual, 'getPropertyPath does not work with Array Access property.');
217  }
218 
223  {
224  $objectStorage = $this->‪setUpObjectStorageWithTwoItems();
225  $array = [
226  'parent' => $objectStorage,
227  ];
228  self::assertSame('value', ‪ObjectAccess::getPropertyPath($array, 'parent.0.key'));
229  self::assertSame('value2', ‪ObjectAccess::getPropertyPath($array, 'parent.1.key'));
230  }
231 
236  {
237  $objectStorage = $this->‪setUpObjectStorageWithTwoItems();
238  $i = 0;
239  foreach ($objectStorage as $object) {
240  ‪ObjectAccess::getPropertyPath($objectStorage, '0.key');
241  $i++;
242  }
243  self::assertSame(2, $i);
244  }
245 
249  protected function ‪setUpObjectStorageWithTwoItems()
250  {
251  $objectStorage = new ‪ObjectStorage();
252  $exampleObject = new \stdClass();
253  $exampleObject->key = 'value';
254  $exampleObject2 = new \stdClass();
255  $exampleObject2->key = 'value2';
256  $objectStorage->attach($exampleObject);
257  $objectStorage->attach($exampleObject2);
258  return $objectStorage;
259  }
260 
265  {
266  $objectStorage = $this->‪setUpSplObjectStorageWithTwoItems();
267  $array = [
268  'parent' => $objectStorage,
269  ];
270  self::assertSame('value', ‪ObjectAccess::getPropertyPath($array, 'parent.0.key'));
271  self::assertSame('value2', ‪ObjectAccess::getPropertyPath($array, 'parent.1.key'));
272  }
273 
278  {
279  $objectStorage = $this->‪setUpSplObjectStorageWithTwoItems();
280  $i = 0;
281  foreach ($objectStorage as $object) {
282  ‪ObjectAccess::getPropertyPath($objectStorage, '0.key');
283  $i++;
284  }
285  self::assertSame(2, $i);
286  }
287 
291  protected function ‪setUpSplObjectStorageWithTwoItems()
292  {
293  $objectStorage = new \SplObjectStorage();
294  $exampleObject = new \stdClass();
295  $exampleObject->key = 'value';
296  $exampleObject2 = new \stdClass();
297  $exampleObject2->key = 'value2';
298  $objectStorage->attach($exampleObject);
299  $objectStorage->attach($exampleObject2);
300  return $objectStorage;
301  }
302 
307  {
308  $gettablePropertyNames = ‪ObjectAccess::getGettablePropertyNames($this->dummyObject);
309  $expectedPropertyNames = ['anotherBooleanProperty', 'anotherProperty', 'booleanProperty', 'property', 'property2', 'publicProperty', 'publicProperty2', 'someValue'];
310  self::assertEquals($gettablePropertyNames, $expectedPropertyNames, 'getGettablePropertyNames returns not all gettable properties.');
311  }
312 
317  {
318  $dateTimeZone = new \DateTimeZone('+2');
319  $gettablePropertyNames = ‪ObjectAccess::getGettablePropertyNames($dateTimeZone);
320  $expectedPropertyNames = ['location', 'name'];
321  foreach ($expectedPropertyNames as $expectedPropertyName) {
322  self::assertContains($expectedPropertyName, $gettablePropertyNames);
323  }
324  }
325 
330  {
331  $settablePropertyNames = ‪ObjectAccess::getSettablePropertyNames($this->dummyObject);
332  $expectedPropertyNames = ['anotherBooleanProperty', 'anotherProperty', 'property', 'property2', 'publicProperty', 'publicProperty2', 'writeOnlyMagicProperty'];
333  self::assertEquals($settablePropertyNames, $expectedPropertyNames, 'getSettablePropertyNames returns not all settable properties.');
334  }
335 
340  {
341  $stdClassObject = new \stdClass();
342  $stdClassObject->property = 'string1';
343  $stdClassObject->property2 = null;
344  $settablePropertyNames = ‪ObjectAccess::getSettablePropertyNames($stdClassObject);
345  $expectedPropertyNames = ['property', 'property2'];
346  self::assertEquals($expectedPropertyNames, $settablePropertyNames, 'getSettablePropertyNames returns not all settable properties.');
347  }
348 
353  {
354  $allProperties = ‪ObjectAccess::getGettableProperties($this->dummyObject);
355  $expectedProperties = [
356  'anotherBooleanProperty' => true,
357  'anotherProperty' => 42,
358  'booleanProperty' => true,
359  'property' => 'string1',
360  'property2' => null,
361  'publicProperty' => null,
362  'publicProperty2' => 42,
363  'someValue' => true,
364  ];
365  self::assertEquals($allProperties, $expectedProperties, 'expectedProperties did not return the right values for the properties.');
366  }
367 
372  {
373  $stdClassObject = new \stdClass();
374  $stdClassObject->property = 'string1';
375  $stdClassObject->property2 = null;
376  $stdClassObject->publicProperty2 = 42;
377  $allProperties = ‪ObjectAccess::getGettableProperties($stdClassObject);
378  $expectedProperties = [
379  'property' => 'string1',
380  'property2' => null,
381  'publicProperty2' => 42
382  ];
383  self::assertEquals($expectedProperties, $allProperties, 'expectedProperties did not return the right values for the properties.');
384  }
385 
390  {
391  self::assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'writeOnlyMagicProperty'));
392  self::assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'publicProperty'));
393  self::assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'property'));
394  self::assertFalse(‪ObjectAccess::isPropertySettable($this->dummyObject, 'privateProperty'));
395  self::assertFalse(‪ObjectAccess::isPropertySettable($this->dummyObject, 'shouldNotBePickedUp'));
396  }
397 
401  public function ‪isPropertySettableWorksOnStdClass()
402  {
403  $stdClassObject = new \stdClass();
404  $stdClassObject->property = 'foo';
405  self::assertTrue(‪ObjectAccess::isPropertySettable($stdClassObject, 'property'));
406  self::assertFalse(‪ObjectAccess::isPropertySettable($stdClassObject, 'undefinedProperty'));
407  }
408 
416  public function ‪isPropertyGettableTellsIfAPropertyCanBeRetrieved($property, $expected)
417  {
418  self::assertEquals($expected, ‪ObjectAccess::isPropertyGettable($this->dummyObject, $property));
419  }
420 
424  public function ‪propertyGettableTestValues()
425  {
426  return [
427  ['publicProperty', true],
428  ['property', true],
429  ['booleanProperty', true],
430  ['anotherBooleanProperty', true],
431  ['privateProperty', false],
432  ['writeOnlyMagicProperty', false]
433  ];
434  }
435 
440  {
441  $arrayObject = new \ArrayObject();
442  $arrayObject['key'] = 'v';
443  self::assertTrue(‪ObjectAccess::isPropertyGettable($arrayObject, 'key'));
444  self::assertFalse(‪ObjectAccess::isPropertyGettable($arrayObject, 'undefinedKey'));
445  }
446 
450  public function ‪isPropertyGettableWorksOnStdClass()
451  {
452  $stdClassObject = new \stdClass();
453  $stdClassObject->property = 'foo';
454  self::assertTrue(‪ObjectAccess::isPropertyGettable($stdClassObject, 'property'));
455  self::assertFalse(‪ObjectAccess::isPropertyGettable($stdClassObject, 'undefinedProperty'));
456  }
457 
462  {
463  $alternativeObject = new ‪DummyClassWithGettersAndSetters();
464  $alternativeObject->setProperty('test');
465  $this->dummyObject->setProperty2($alternativeObject);
466  $expected = 'test';
467  $actual = ‪ObjectAccess::getPropertyPath($this->dummyObject, 'property2.property');
468  self::assertEquals($expected, $actual);
469  }
470 
475  {
476  $alternativeObject = new ‪DummyClassWithGettersAndSetters();
477  $alternativeObject->setProperty(new \stdClass());
478  $this->dummyObject->setProperty2($alternativeObject);
479  self::assertNull(‪ObjectAccess::getPropertyPath($this->dummyObject, 'property2.property.not.existing'));
480  }
481 
486  {
487  $string = 'Hello world';
488  self::assertNull(‪ObjectAccess::getPropertyPath($string, 'property2'));
489  }
490 
495  {
496  $object = new \stdClass();
497  $object->foo = 'Hello World';
498  self::assertNull(‪ObjectAccess::getPropertyPath($object, 'foo.bar'));
499  }
500 }
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertySettableWorksOnStdClass
‪isPropertySettableWorksOnStdClass()
Definition: ObjectAccessTest.php:399
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyWorksWithPublicProperty
‪setPropertyWorksWithPublicProperty()
Definition: ObjectAccessTest.php:116
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfArrayAccessWithPriorityForOffsetIfOffsetExists
‪getPropertyCanAccessPropertiesOfArrayAccessWithPriorityForOffsetIfOffsetExists()
Definition: ObjectAccessTest.php:180
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getSettablePropertyNamesReturnsAllPropertiesWhichAreAvailable
‪getSettablePropertyNamesReturnsAllPropertiesWhichAreAvailable()
Definition: ObjectAccessTest.php:327
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnObjectImplementingArrayAccess
‪getPropertyCanAccessPropertiesOfAnObjectImplementingArrayAccess()
Definition: ObjectAccessTest.php:160
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\setProperty
‪static bool setProperty(&$subject, string $propertyName, $propertyValue, bool $forceDirectAccess=false)
Definition: ObjectAccess.php:170
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getSettablePropertyNamesReturnsPropertyNamesOfStdClass
‪getSettablePropertyNamesReturnsPropertyNamesOfStdClass()
Definition: ObjectAccessTest.php:337
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathOnSplObjectStorageDoesNotAffectOngoingLoop
‪getPropertyPathOnSplObjectStorageDoesNotAffectOngoingLoop()
Definition: ObjectAccessTest.php:275
‪TYPO3\CMS\Extbase\Reflection\Exception\PropertyNotAccessibleException
Definition: PropertyNotAccessibleException.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnExtbaseObjectStorageObject
‪getPropertyPathCanAccessPropertiesOfAnExtbaseObjectStorageObject()
Definition: ObjectAccessTest.php:220
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertyNamesRespectsMethodArguments
‪getGettablePropertyNamesRespectsMethodArguments()
Definition: ObjectAccessTest.php:314
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableTellsIfAPropertyCanBeRetrieved
‪isPropertyGettableTellsIfAPropertyCanBeRetrieved($property, $expected)
Definition: ObjectAccessTest.php:414
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUpObjectStorageWithTwoItems
‪ObjectStorage setUpObjectStorageWithTwoItems()
Definition: ObjectAccessTest.php:247
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getGettablePropertyNames
‪static array getGettablePropertyNames(object $object)
Definition: ObjectAccess.php:217
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanRecursivelyGetPropertiesOfAnObject
‪getPropertyPathCanRecursivelyGetPropertiesOfAnObject()
Definition: ObjectAccessTest.php:459
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyClassWithGettersAndSetters
Definition: DummyClassWithGettersAndSetters.php:22
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess
Definition: ObjectAccess.php:38
‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
Definition: ObjectStorage.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyThrowsExceptionIfPropertyDoesNotExist
‪getPropertyThrowsExceptionIfPropertyDoesNotExist()
Definition: ObjectAccessTest.php:71
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnArray
‪getPropertyCanAccessPropertiesOfAnArray()
Definition: ObjectAccessTest.php:190
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullForNonExistingPropertyPath
‪getPropertyPathReturnsNullForNonExistingPropertyPath()
Definition: ObjectAccessTest.php:472
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\propertyGettableTestValues
‪array propertyGettableTestValues()
Definition: ObjectAccessTest.php:422
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForPublicProperty
‪getPropertyReturnsExpectedValueForPublicProperty()
Definition: ObjectAccessTest.php:62
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertiesReturnsPropertiesOfStdClass
‪getGettablePropertiesReturnsPropertiesOfStdClass()
Definition: ObjectAccessTest.php:369
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUp
‪setUp()
Definition: ObjectAccessTest.php:41
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyTriesToCallABooleanGetterMethodIfItExists
‪getPropertyTriesToCallABooleanGetterMethodIfItExists()
Definition: ObjectAccessTest.php:90
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableWorksOnArrayAccessObjects
‪isPropertyGettableWorksOnArrayAccessObjects()
Definition: ObjectAccessTest.php:437
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyCallsASetterMethodToSetThePropertyValueIfOneIsAvailable
‪setPropertyCallsASetterMethodToSetThePropertyValueIfOneIsAvailable()
Definition: ObjectAccessTest.php:107
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnArray
‪getPropertyPathCanAccessPropertiesOfAnArray()
Definition: ObjectAccessTest.php:200
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsNullIfArrayKeyDoesNotExist
‪getPropertyReturnsNullIfArrayKeyDoesNotExist()
Definition: ObjectAccessTest.php:81
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\isPropertyGettable
‪static bool isPropertyGettable($object, $propertyName)
Definition: ObjectAccess.php:333
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: ObjectAccessTest.php:32
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnObjectStorageObject
‪getPropertyCanAccessPropertiesOfAnObjectStorageObject()
Definition: ObjectAccessTest.php:148
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertiesReturnsTheCorrectValuesForAllProperties
‪getGettablePropertiesReturnsTheCorrectValuesForAllProperties()
Definition: ObjectAccessTest.php:350
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getGettableProperties
‪static array getGettableProperties(object $object)
Definition: ObjectAccess.php:356
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableWorksOnStdClass
‪isPropertyGettableWorksOnStdClass()
Definition: ObjectAccessTest.php:448
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getSettablePropertyNames
‪static array getSettablePropertyNames(object $object)
Definition: ObjectAccess.php:277
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\$dummyObject
‪DummyClassWithGettersAndSetters $dummyObject
Definition: ObjectAccessTest.php:36
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForGetterProperty
‪getPropertyReturnsExpectedValueForGetterProperty()
Definition: ObjectAccessTest.php:53
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUpSplObjectStorageWithTwoItems
‪SplObjectStorage setUpSplObjectStorageWithTwoItems()
Definition: ObjectAccessTest.php:289
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\ArrayAccessClass
Definition: ArrayAccessClass.php:22
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnArrayObject
‪getPropertyCanAccessPropertiesOfAnArrayObject()
Definition: ObjectAccessTest.php:138
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getPropertyPath
‪static mixed getPropertyPath($subject, string $propertyPath)
Definition: ObjectAccess.php:139
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullIfSubjectOnPathIsNoObject
‪getPropertyPathReturnsNullIfSubjectOnPathIsNoObject()
Definition: ObjectAccessTest.php:492
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyReturnsFalseIfPropertyIsNotAccessible
‪setPropertyReturnsFalseIfPropertyIsNotAccessible()
Definition: ObjectAccessTest.php:99
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnObjectImplementingArrayAccess
‪getPropertyPathCanAccessPropertiesOfAnObjectImplementingArrayAccess()
Definition: ObjectAccessTest.php:210
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\isPropertySettable
‪static bool isPropertySettable(object $object, $propertyName)
Definition: ObjectAccess.php:313
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyCanDirectlySetValuesInAnArrayObjectOrArray
‪setPropertyCanDirectlySetValuesInAnArrayObjectOrArray()
Definition: ObjectAccessTest.php:125
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertyNamesReturnsAllPropertiesWhichAreAvailable
‪getGettablePropertyNamesReturnsAllPropertiesWhichAreAvailable()
Definition: ObjectAccessTest.php:304
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathOnObjectStorageDoesNotAffectOngoingLoop
‪getPropertyPathOnObjectStorageDoesNotAffectOngoingLoop()
Definition: ObjectAccessTest.php:233
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullIfSubjectIsNoObject
‪getPropertyPathReturnsNullIfSubjectIsNoObject()
Definition: ObjectAccessTest.php:483
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest
Definition: ObjectAccessTest.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnSplObjectStorageObject
‪getPropertyPathCanAccessPropertiesOfAnSplObjectStorageObject()
Definition: ObjectAccessTest.php:262
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfArrayAccessWithGetterMethodWhenOffsetNotExists
‪getPropertyCanAccessPropertiesOfArrayAccessWithGetterMethodWhenOffsetNotExists()
Definition: ObjectAccessTest.php:170
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertySettableTellsIfAPropertyCanBeSet
‪isPropertySettableTellsIfAPropertyCanBeSet()
Definition: ObjectAccessTest.php:387
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getProperty
‪static mixed getProperty($subject, string $propertyName, bool $forceDirectAccess=false)
Definition: ObjectAccess.php:62