$logClass = 'OC\\Log\\' . ucfirst($logType);
if (!class_exists($logClass)) {
- $logClass = 'OC\\Log\\File';
+ $logClass = \OC\Log\File::class;
}
return $logClass;
}
}
+ public function dataGetLogClass() {
+ return [
+ ['owncloud', \OC\Log\File::class],
+ ['nextcloud', \OC\Log\File::class],
+ ['file', \OC\Log\File::class],
+ ['errorlog', \OC\Log\Errorlog::class],
+ ['syslog', \OC\Log\Syslog::class],
+ ];
+ }
+
+ /**
+ * @dataProvider dataGetLogClass
+ */
+ public function testGetLogClass($type, $class) {
+ $this->assertEquals($class, Log::getLogClass($type));
+ }
}