/** * 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); }
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']); }