‪TYPO3CMS  9.5
ObjectAccessTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
25 class ‪ObjectAccessTest extends UnitTestCase
26 {
30  protected ‪$dummyObject;
31 
35  protected function ‪setUp()
36  {
37  $this->dummyObject = new ‪DummyClassWithGettersAndSetters();
38  $this->dummyObject->setProperty('string1');
39  $this->dummyObject->setAnotherProperty(42);
40  $this->dummyObject->shouldNotBePickedUp = true;
41  }
42 
47  {
48  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'property');
49  $this->assertEquals($property, 'string1');
50  }
51 
56  {
57  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'publicProperty2');
58  $this->assertEquals($property, 42, 'A property of a given object was not returned correctly.');
59  }
60 
65  {
66  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'unexposedProperty', true);
67  $this->assertEquals($property, 'unexposed', 'A property of a given object was not returned correctly.');
68  }
69 
74  {
75  $this->dummyObject->unknownProperty = 'unknown';
76  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'unknownProperty', true);
77  $this->assertEquals($property, 'unknown', 'A property of a given object was not returned correctly.');
78  }
79 
84  {
85  $this->expectException(PropertyNotAccessibleException::class);
86  $this->expectExceptionCode(1302855001);
87  ‪ObjectAccess::getProperty($this->dummyObject, 'notExistingProperty', true);
88  }
89 
94  {
95  $this->expectException(PropertyNotAccessibleException::class);
96  $this->expectExceptionCode(1476109666);
97  ‪ObjectAccess::getProperty($this->dummyObject, 'notExistingProperty');
98  }
99 
104  {
105  $result = ‪ObjectAccess::getProperty([], 'notExistingProperty');
106  $this->assertNull($result);
107  }
108 
113  {
114  $property = ‪ObjectAccess::getProperty($this->dummyObject, 'booleanProperty');
115  $this->assertTrue($property);
116  }
117 
122  {
123  $this->expectException(\InvalidArgumentException::class);
124  $this->expectExceptionCode(1231178303);
125  ‪ObjectAccess::getProperty($this->dummyObject, new \ArrayObject());
126  }
127 
132  {
133  $this->expectException(\InvalidArgumentException::class);
134  $this->expectExceptionCode(1231178878);
135  ‪ObjectAccess::setProperty($this->dummyObject, new \ArrayObject(), 42);
136  }
137 
142  {
143  $this->assertFalse(‪ObjectAccess::setProperty($this->dummyObject, 'protectedProperty', 42));
144  }
145 
150  {
151  $this->assertTrue(‪ObjectAccess::setProperty($this->dummyObject, 'unexposedProperty', 'was set anyway', true));
152  $this->assertAttributeEquals('was set anyway', 'unexposedProperty', $this->dummyObject);
153  }
154 
159  {
160  $this->assertTrue(‪ObjectAccess::setProperty($this->dummyObject, 'unknownProperty', 'was set anyway', true));
161  $this->assertAttributeEquals('was set anyway', 'unknownProperty', $this->dummyObject);
162  }
163 
168  {
169  ‪ObjectAccess::setProperty($this->dummyObject, 'property', 4242);
170  $this->assertEquals($this->dummyObject->getProperty(), 4242, 'setProperty does not work with setter.');
171  }
172 
176  public function ‪setPropertyWorksWithPublicProperty()
177  {
178  ‪ObjectAccess::setProperty($this->dummyObject, 'publicProperty', 4242);
179  $this->assertEquals($this->dummyObject->publicProperty, 4242, 'setProperty does not work with public property.');
180  }
181 
186  {
187  $arrayObject = new \ArrayObject();
188  $array = [];
189  ‪ObjectAccess::setProperty($arrayObject, 'publicProperty', 4242);
190  ‪ObjectAccess::setProperty($array, 'key', 'value');
191  $this->assertEquals(4242, $arrayObject['publicProperty']);
192  $this->assertEquals('value', $array['key']);
193  }
194 
199  {
200  $arrayObject = new \ArrayObject(['key' => 'value']);
201  $actual = ‪ObjectAccess::getProperty($arrayObject, 'key');
202  $this->assertEquals('value', $actual, 'getProperty does not work with ArrayObject property.');
203  }
204 
209  {
210  $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
211  $object = new \stdClass();
212  $objectStorage->attach($object);
213  $actual = ‪ObjectAccess::getProperty($objectStorage, 0);
214  $this->assertSame($object, $actual, 'getProperty does not work with ObjectStorage property.');
215  }
216 
221  {
222  $arrayAccessInstance = new \TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\ArrayAccessClass(['key' => 'value']);
223  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'key');
224  $this->assertEquals('value', $actual, 'getProperty does not work with Array Access property.');
225  }
226 
231  {
232  $arrayAccessInstance = new \TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\ArrayAccessClass([]);
233  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'virtual');
234  $this->assertEquals('default-value', $actual, 'getProperty does not work with Array Access property.');
235  }
236 
241  {
242  $arrayAccessInstance = new \TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\ArrayAccessClass(['virtual' => 'overridden-value']);
243  $actual = ‪ObjectAccess::getProperty($arrayAccessInstance, 'virtual');
244  $this->assertEquals('overridden-value', $actual, 'getProperty does not work with Array Access property.');
245  }
246 
251  {
252  $array = ['key' => 'value'];
253  $expected = ‪ObjectAccess::getProperty($array, 'key');
254  $this->assertEquals($expected, 'value', 'getProperty does not work with Array property.');
255  }
256 
261  {
262  $array = ['parent' => ['key' => 'value']];
263  $actual = ‪ObjectAccess::getPropertyPath($array, 'parent.key');
264  $this->assertEquals('value', $actual, 'getPropertyPath does not work with Array property.');
265  }
266 
271  {
272  $array = ['parent' => new \ArrayObject(['key' => 'value'])];
273  $actual = ‪ObjectAccess::getPropertyPath($array, 'parent.key');
274  $this->assertEquals('value', $actual, 'getPropertyPath does not work with Array Access property.');
275  }
276 
281  {
282  $objectStorage = $this->‪setUpObjectStorageWithTwoItems();
283  $array = [
284  'parent' => $objectStorage,
285  ];
286  $this->assertSame('value', ‪ObjectAccess::getPropertyPath($array, 'parent.0.key'));
287  $this->assertSame('value2', ‪ObjectAccess::getPropertyPath($array, 'parent.1.key'));
288  }
289 
294  {
295  $objectStorage = $this->‪setUpObjectStorageWithTwoItems();
296  $i = 0;
297  foreach ($objectStorage as $object) {
298  ‪ObjectAccess::getPropertyPath($objectStorage, '0.key');
299  $i++;
300  }
301  $this->assertSame(2, $i);
302  }
303 
307  protected function ‪setUpObjectStorageWithTwoItems()
308  {
309  $objectStorage = new ‪ObjectStorage();
310  $exampleObject = new \stdClass();
311  $exampleObject->key = 'value';
312  $exampleObject2 = new \stdClass();
313  $exampleObject2->key = 'value2';
314  $objectStorage->attach($exampleObject);
315  $objectStorage->attach($exampleObject2);
316  return $objectStorage;
317  }
318 
323  {
324  $objectStorage = $this->‪setUpSplObjectStorageWithTwoItems();
325  $array = [
326  'parent' => $objectStorage,
327  ];
328  $this->assertSame('value', ‪ObjectAccess::getPropertyPath($array, 'parent.0.key'));
329  $this->assertSame('value2', ‪ObjectAccess::getPropertyPath($array, 'parent.1.key'));
330  }
331 
336  {
337  $objectStorage = $this->‪setUpSplObjectStorageWithTwoItems();
338  $i = 0;
339  foreach ($objectStorage as $object) {
340  ‪ObjectAccess::getPropertyPath($objectStorage, '0.key');
341  $i++;
342  }
343  $this->assertSame(2, $i);
344  }
345 
349  protected function ‪setUpSplObjectStorageWithTwoItems()
350  {
351  $objectStorage = new \SplObjectStorage();
352  $exampleObject = new \stdClass();
353  $exampleObject->key = 'value';
354  $exampleObject2 = new \stdClass();
355  $exampleObject2->key = 'value2';
356  $objectStorage->attach($exampleObject);
357  $objectStorage->attach($exampleObject2);
358  return $objectStorage;
359  }
360 
365  {
366  $gettablePropertyNames = ‪ObjectAccess::getGettablePropertyNames($this->dummyObject);
367  $expectedPropertyNames = ['anotherBooleanProperty', 'anotherProperty', 'booleanProperty', 'property', 'property2', 'publicProperty', 'publicProperty2', 'someValue'];
368  $this->assertEquals($gettablePropertyNames, $expectedPropertyNames, 'getGettablePropertyNames returns not all gettable properties.');
369  }
370 
375  {
376  $dateTimeZone = new \DateTimeZone('+2');
377  $gettablePropertyNames = ‪ObjectAccess::getGettablePropertyNames($dateTimeZone);
378  $expectedPropertyNames = ['location', 'name'];
379  $this->assertArraySubset($expectedPropertyNames, $gettablePropertyNames);
380  }
381 
386  {
387  $settablePropertyNames = ‪ObjectAccess::getSettablePropertyNames($this->dummyObject);
388  $expectedPropertyNames = ['anotherBooleanProperty', 'anotherProperty', 'property', 'property2', 'publicProperty', 'publicProperty2', 'writeOnlyMagicProperty'];
389  $this->assertEquals($settablePropertyNames, $expectedPropertyNames, 'getSettablePropertyNames returns not all settable properties.');
390  }
391 
396  {
397  $stdClassObject = new \stdClass();
398  $stdClassObject->property = 'string1';
399  $stdClassObject->property2 = null;
400  $settablePropertyNames = ‪ObjectAccess::getSettablePropertyNames($stdClassObject);
401  $expectedPropertyNames = ['property', 'property2'];
402  $this->assertEquals($expectedPropertyNames, $settablePropertyNames, 'getSettablePropertyNames returns not all settable properties.');
403  }
404 
409  {
410  $allProperties = ‪ObjectAccess::getGettableProperties($this->dummyObject);
411  $expectedProperties = [
412  'anotherBooleanProperty' => true,
413  'anotherProperty' => 42,
414  'booleanProperty' => true,
415  'property' => 'string1',
416  'property2' => null,
417  'publicProperty' => null,
418  'publicProperty2' => 42,
419  'someValue' => true,
420  ];
421  $this->assertEquals($allProperties, $expectedProperties, 'expectedProperties did not return the right values for the properties.');
422  }
423 
428  {
429  $stdClassObject = new \stdClass();
430  $stdClassObject->property = 'string1';
431  $stdClassObject->property2 = null;
432  $stdClassObject->publicProperty2 = 42;
433  $allProperties = ‪ObjectAccess::getGettableProperties($stdClassObject);
434  $expectedProperties = [
435  'property' => 'string1',
436  'property2' => null,
437  'publicProperty2' => 42
438  ];
439  $this->assertEquals($expectedProperties, $allProperties, 'expectedProperties did not return the right values for the properties.');
440  }
441 
446  {
447  $this->assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'writeOnlyMagicProperty'));
448  $this->assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'publicProperty'));
449  $this->assertTrue(‪ObjectAccess::isPropertySettable($this->dummyObject, 'property'));
450  $this->assertFalse(‪ObjectAccess::isPropertySettable($this->dummyObject, 'privateProperty'));
451  $this->assertFalse(‪ObjectAccess::isPropertySettable($this->dummyObject, 'shouldNotBePickedUp'));
452  }
453 
457  public function ‪isPropertySettableWorksOnStdClass()
458  {
459  $stdClassObject = new \stdClass();
460  $stdClassObject->property = 'foo';
461  $this->assertTrue(‪ObjectAccess::isPropertySettable($stdClassObject, 'property'));
462  $this->assertFalse(‪ObjectAccess::isPropertySettable($stdClassObject, 'undefinedProperty'));
463  }
464 
472  public function ‪isPropertyGettableTellsIfAPropertyCanBeRetrieved($property, $expected)
473  {
474  $this->assertEquals($expected, ‪ObjectAccess::isPropertyGettable($this->dummyObject, $property));
475  }
476 
480  public function ‪propertyGettableTestValues()
481  {
482  return [
483  ['publicProperty', true],
484  ['property', true],
485  ['booleanProperty', true],
486  ['anotherBooleanProperty', true],
487  ['privateProperty', false],
488  ['writeOnlyMagicProperty', false]
489  ];
490  }
491 
496  {
497  $arrayObject = new \ArrayObject();
498  $arrayObject['key'] = 'v';
499  $this->assertTrue(‪ObjectAccess::isPropertyGettable($arrayObject, 'key'));
500  $this->assertFalse(‪ObjectAccess::isPropertyGettable($arrayObject, 'undefinedKey'));
501  }
502 
506  public function ‪isPropertyGettableWorksOnStdClass()
507  {
508  $stdClassObject = new \stdClass();
509  $stdClassObject->property = 'foo';
510  $this->assertTrue(‪ObjectAccess::isPropertyGettable($stdClassObject, 'property'));
511  $this->assertFalse(‪ObjectAccess::isPropertyGettable($stdClassObject, 'undefinedProperty'));
512  }
513 
518  {
519  $alternativeObject = new ‪DummyClassWithGettersAndSetters();
520  $alternativeObject->setProperty('test');
521  $this->dummyObject->setProperty2($alternativeObject);
522  $expected = 'test';
523  $actual = ‪ObjectAccess::getPropertyPath($this->dummyObject, 'property2.property');
524  $this->assertEquals($expected, $actual);
525  }
526 
531  {
532  $alternativeObject = new ‪DummyClassWithGettersAndSetters();
533  $alternativeObject->setProperty(new \stdClass());
534  $this->dummyObject->setProperty2($alternativeObject);
535  $this->assertNull(‪ObjectAccess::getPropertyPath($this->dummyObject, 'property2.property.not.existing'));
536  }
537 
542  {
543  $string = 'Hello world';
544  $this->assertNull(‪ObjectAccess::getPropertyPath($string, 'property2'));
545  }
546 
551  {
552  $object = new \stdClass();
553  $object->foo = 'Hello World';
554  $this->assertNull(‪ObjectAccess::getPropertyPath($object, 'foo.bar'));
555  }
556 }
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertySetsValueIfPropertyDoesNotExistWhenForceDirectAccessIsTrue
‪setPropertySetsValueIfPropertyDoesNotExistWhenForceDirectAccessIsTrue()
Definition: ObjectAccessTest.php:157
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertySettableWorksOnStdClass
‪isPropertySettableWorksOnStdClass()
Definition: ObjectAccessTest.php:456
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyWorksWithPublicProperty
‪setPropertyWorksWithPublicProperty()
Definition: ObjectAccessTest.php:175
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfArrayAccessWithPriorityForOffsetIfOffsetExists
‪getPropertyCanAccessPropertiesOfArrayAccessWithPriorityForOffsetIfOffsetExists()
Definition: ObjectAccessTest.php:239
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\isPropertySettable
‪static bool isPropertySettable($object, $propertyName)
Definition: ObjectAccess.php:312
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\setProperty
‪static bool setProperty(&$subject, $propertyName, $propertyValue, $forceDirectAccess=false)
Definition: ObjectAccess.php:176
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getSettablePropertyNamesReturnsAllPropertiesWhichAreAvailable
‪getSettablePropertyNamesReturnsAllPropertiesWhichAreAvailable()
Definition: ObjectAccessTest.php:384
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnObjectImplementingArrayAccess
‪getPropertyCanAccessPropertiesOfAnObjectImplementingArrayAccess()
Definition: ObjectAccessTest.php:219
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getSettablePropertyNamesReturnsPropertyNamesOfStdClass
‪getSettablePropertyNamesReturnsPropertyNamesOfStdClass()
Definition: ObjectAccessTest.php:394
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathOnSplObjectStorageDoesNotAffectOngoingLoop
‪getPropertyPathOnSplObjectStorageDoesNotAffectOngoingLoop()
Definition: ObjectAccessTest.php:334
‪TYPO3\CMS\Extbase\Reflection\Exception\PropertyNotAccessibleException
Definition: PropertyNotAccessibleException.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnExtbaseObjectStorageObject
‪getPropertyPathCanAccessPropertiesOfAnExtbaseObjectStorageObject()
Definition: ObjectAccessTest.php:279
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertyNamesRespectsMethodArguments
‪getGettablePropertyNamesRespectsMethodArguments()
Definition: ObjectAccessTest.php:373
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableTellsIfAPropertyCanBeRetrieved
‪isPropertyGettableTellsIfAPropertyCanBeRetrieved($property, $expected)
Definition: ObjectAccessTest.php:471
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getSettablePropertyNames
‪static array getSettablePropertyNames($object)
Definition: ObjectAccess.php:283
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUpObjectStorageWithTwoItems
‪ObjectStorage setUpObjectStorageWithTwoItems()
Definition: ObjectAccessTest.php:306
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanRecursivelyGetPropertiesOfAnObject
‪getPropertyPathCanRecursivelyGetPropertiesOfAnObject()
Definition: ObjectAccessTest.php:516
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyClassWithGettersAndSetters
Definition: DummyClassWithGettersAndSetters.php:21
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess
Definition: ObjectAccess.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForUnknownPropertyIfForceDirectAccessIsTrue
‪getPropertyReturnsExpectedValueForUnknownPropertyIfForceDirectAccessIsTrue()
Definition: ObjectAccessTest.php:72
‪TYPO3\CMS\Extbase\Persistence\ObjectStorage
Definition: ObjectStorage.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyThrowsExceptionIfPropertyDoesNotExist
‪getPropertyThrowsExceptionIfPropertyDoesNotExist()
Definition: ObjectAccessTest.php:92
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnArray
‪getPropertyCanAccessPropertiesOfAnArray()
Definition: ObjectAccessTest.php:249
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullForNonExistingPropertyPath
‪getPropertyPathReturnsNullForNonExistingPropertyPath()
Definition: ObjectAccessTest.php:529
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyThrowsExceptionIfThePropertyNameIsNotAString
‪setPropertyThrowsExceptionIfThePropertyNameIsNotAString()
Definition: ObjectAccessTest.php:130
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\propertyGettableTestValues
‪array propertyGettableTestValues()
Definition: ObjectAccessTest.php:479
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForPublicProperty
‪getPropertyReturnsExpectedValueForPublicProperty()
Definition: ObjectAccessTest.php:54
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getGettableProperties
‪static array getGettableProperties($object)
Definition: ObjectAccess.php:372
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertiesReturnsPropertiesOfStdClass
‪getGettablePropertiesReturnsPropertiesOfStdClass()
Definition: ObjectAccessTest.php:426
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUp
‪setUp()
Definition: ObjectAccessTest.php:34
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyTriesToCallABooleanGetterMethodIfItExists
‪getPropertyTriesToCallABooleanGetterMethodIfItExists()
Definition: ObjectAccessTest.php:111
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableWorksOnArrayAccessObjects
‪isPropertyGettableWorksOnArrayAccessObjects()
Definition: ObjectAccessTest.php:494
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForUnexposedPropertyIfForceDirectAccessIsTrue
‪getPropertyReturnsExpectedValueForUnexposedPropertyIfForceDirectAccessIsTrue()
Definition: ObjectAccessTest.php:63
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyCallsASetterMethodToSetThePropertyValueIfOneIsAvailable
‪setPropertyCallsASetterMethodToSetThePropertyValueIfOneIsAvailable()
Definition: ObjectAccessTest.php:166
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnArray
‪getPropertyPathCanAccessPropertiesOfAnArray()
Definition: ObjectAccessTest.php:259
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsNullIfArrayKeyDoesNotExist
‪getPropertyReturnsNullIfArrayKeyDoesNotExist()
Definition: ObjectAccessTest.php:102
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\isPropertyGettable
‪static bool isPropertyGettable($object, $propertyName)
Definition: ObjectAccess.php:335
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnObjectStorageObject
‪getPropertyCanAccessPropertiesOfAnObjectStorageObject()
Definition: ObjectAccessTest.php:207
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertiesReturnsTheCorrectValuesForAllProperties
‪getGettablePropertiesReturnsTheCorrectValuesForAllProperties()
Definition: ObjectAccessTest.php:407
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertyGettableWorksOnStdClass
‪isPropertyGettableWorksOnStdClass()
Definition: ObjectAccessTest.php:505
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\$dummyObject
‪DummyClassWithGettersAndSetters $dummyObject
Definition: ObjectAccessTest.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyThrowsExceptionIfThePropertyNameIsNotAString
‪getPropertyThrowsExceptionIfThePropertyNameIsNotAString()
Definition: ObjectAccessTest.php:120
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyReturnsExpectedValueForGetterProperty
‪getPropertyReturnsExpectedValueForGetterProperty()
Definition: ObjectAccessTest.php:45
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setUpSplObjectStorageWithTwoItems
‪SplObjectStorage setUpSplObjectStorageWithTwoItems()
Definition: ObjectAccessTest.php:348
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getProperty
‪static mixed getProperty($subject, $propertyName, $forceDirectAccess=false)
Definition: ObjectAccess.php:54
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getPropertyPath
‪static mixed getPropertyPath($subject, $propertyPath)
Definition: ObjectAccess.php:144
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfAnArrayObject
‪getPropertyCanAccessPropertiesOfAnArrayObject()
Definition: ObjectAccessTest.php:197
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullIfSubjectOnPathIsNoObject
‪getPropertyPathReturnsNullIfSubjectOnPathIsNoObject()
Definition: ObjectAccessTest.php:549
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyReturnsFalseIfPropertyIsNotAccessible
‪setPropertyReturnsFalseIfPropertyIsNotAccessible()
Definition: ObjectAccessTest.php:140
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnObjectImplementingArrayAccess
‪getPropertyPathCanAccessPropertiesOfAnObjectImplementingArrayAccess()
Definition: ObjectAccessTest.php:269
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertyCanDirectlySetValuesInAnArrayObjectOrArray
‪setPropertyCanDirectlySetValuesInAnArrayObjectOrArray()
Definition: ObjectAccessTest.php:184
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getGettablePropertyNamesReturnsAllPropertiesWhichAreAvailable
‪getGettablePropertyNamesReturnsAllPropertiesWhichAreAvailable()
Definition: ObjectAccessTest.php:363
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathOnObjectStorageDoesNotAffectOngoingLoop
‪getPropertyPathOnObjectStorageDoesNotAffectOngoingLoop()
Definition: ObjectAccessTest.php:292
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyThrowsPropertyNotAccessibleExceptionForNotExistingPropertyIfForceDirectAccessIsTrue
‪getPropertyThrowsPropertyNotAccessibleExceptionForNotExistingPropertyIfForceDirectAccessIsTrue()
Definition: ObjectAccessTest.php:82
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\setPropertySetsValueIfPropertyIsNotAccessibleWhenForceDirectAccessIsTrue
‪setPropertySetsValueIfPropertyIsNotAccessibleWhenForceDirectAccessIsTrue()
Definition: ObjectAccessTest.php:148
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathReturnsNullIfSubjectIsNoObject
‪getPropertyPathReturnsNullIfSubjectIsNoObject()
Definition: ObjectAccessTest.php:540
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest
Definition: ObjectAccessTest.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyPathCanAccessPropertiesOfAnSplObjectStorageObject
‪getPropertyPathCanAccessPropertiesOfAnSplObjectStorageObject()
Definition: ObjectAccessTest.php:321
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\getPropertyCanAccessPropertiesOfArrayAccessWithGetterMethodWhenOffsetNotExists
‪getPropertyCanAccessPropertiesOfArrayAccessWithGetterMethodWhenOffsetNotExists()
Definition: ObjectAccessTest.php:229
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection
Definition: ClassSchemaTest.php:2
‪TYPO3\CMS\Extbase\Reflection\ObjectAccess\getGettablePropertyNames
‪static array getGettablePropertyNames($object)
Definition: ObjectAccess.php:227
‪TYPO3\CMS\Extbase\Tests\Unit\Reflection\ObjectAccessTest\isPropertySettableTellsIfAPropertyCanBeSet
‪isPropertySettableTellsIfAPropertyCanBeSet()
Definition: ObjectAccessTest.php:444