Ejemplo n.º 1
0
 /**
  * Test GetReflection properties with an example of a filter.
  */
 public function testGetReflectionPropertiesWithFilter()
 {
     $reflectedClass = new ClassReflection('TRex\\Reflection\\resources\\Foo');
     $reflectedProperties = $reflectedClass->getReflectionProperties(AttributeReflection::PUBLIC_FILTER | AttributeReflection::PROTECTED_FILTER);
     $this->assertTrue(is_array($reflectedProperties));
     $this->assertCount(2, $reflectedProperties);
     $this->assertInstanceOf('TRex\\Reflection\\PropertyReflection', $reflectedProperties[0]);
     $this->assertSame('TRex\\Reflection\\resources\\Foo::foo', $reflectedProperties[0]->getName(true));
     $this->assertInstanceOf('TRex\\Reflection\\PropertyReflection', $reflectedProperties[1]);
     $this->assertSame('TRex\\Reflection\\resources\\Foo::bar', $reflectedProperties[1]->getName(true));
 }