PhpMigration\Utils\TestHelper::fetchProperty PHP Méthode

fetchProperty() public static méthode

public static fetchProperty ( $object, $name )
    public static function fetchProperty($object, $name)
    {
        $reflection = new \ReflectionClass($object);
        $property = $reflection->getProperty($name);
        $property->setAccessible(true);
        return $property->getValue($object);
    }

Usage Example

 public function testMysqlFunc()
 {
     $table = TestHelper::fetchProperty($this->change, 'mysqlTable');
     foreach ($table as $name => $dummy) {
         $this->assertHasSpot($name . '();');
     }
 }
All Usage Examples Of PhpMigration\Utils\TestHelper::fetchProperty