public function testSetLockedProperty()
 {
     $instance = new ReflectionUtilsTestClass();
     ReflectionUtils::setLockedProperty($instance, 'id', 5);
     $value = ReflectionUtils::getLockedProperty($instance, 'id');
     $this->assertEquals(5, $value);
 }
Ejemplo n.º 2
0
 /**
  * @param \stdClass $data
  *
  * @return File
  */
 public static function createFileFromData(\stdClass $data)
 {
     $file = new File();
     ReflectionUtils::setLockedProperty($file, 'ID', $data->ID);
     $file->setName($data->filename);
     $file->setNameSys($data->filenamesys);
     $file->setSend($data->send == 1);
     $file->setType($data->filetype);
     $file->setCategory($data->category);
     $file->setOtherInfo($data->otherinfo);
     $file->setSize((int) $data->filesize);
     return $file;
 }