Пример #1
0
 /**
  * Registers a custom temporary file
  * @param temporary file $tmp
  */
 public function registerTmpFile($tmp)
 {
     $configuration = new Configuration();
     $configuration->setAttribute('configFilePath', sys_get_temp_dir());
     $configuration->setAttribute('configFileName', basename($tmp));
     JsonDriver::register($configuration);
 }
Пример #2
0
 public function testRegisterFileValid()
 {
     $tmp = $this->createGoodTmpFile('json');
     $instance = JsonDriver::create([sys_get_temp_dir() . '/' . basename($tmp)]);
     $classes = $instance->getAllClassNames();
     $this->assertSame($classes, ['DrestTests\\Entities\\NoAnnotation\\User']);
 }