Reflection > getPropertyValue() method > look for the property in parent classes

This commit is contained in:
Meritoo
2019-04-13 18:28:53 +02:00
parent 6f90f5a249
commit eb8fa110ad
3 changed files with 68 additions and 39 deletions

View File

@@ -309,6 +309,12 @@ class ReflectionTest extends BaseTestCase
self::assertEquals($username, Reflection::getPropertyValue($f, 'username'));
}
public function testGetPropertyValueFromParentClass(): void
{
$c = new C();
self::assertEquals(1, Reflection::getPropertyValue($c, 'count', true));
}
public function testGetPropertyValuesFromEmptySource()
{
self::assertEquals([], Reflection::getPropertyValues([], 'something'));