summaryrefslogtreecommitdiffstats
path: root/tests/lib/LoggerTest.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-24 22:14:00 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-04-26 12:00:06 +0200
commit5fbf184134f34633bc150b2e0210c4a97ec285a9 (patch)
treebdc4d79196f1268cf8d5df488c9b31705ceb82a0 /tests/lib/LoggerTest.php
parentb7e8ab97e731b77ef2ec519bfb98019516b7f682 (diff)
downloadnextcloud-server-5fbf184134f34633bc150b2e0210c4a97ec285a9.tar.gz
nextcloud-server-5fbf184134f34633bc150b2e0210c4a97ec285a9.zip
destaticfy Log classes
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests/lib/LoggerTest.php')
-rw-r--r--tests/lib/LoggerTest.php33
1 files changed, 7 insertions, 26 deletions
diff --git a/tests/lib/LoggerTest.php b/tests/lib/LoggerTest.php
index 6b9c9af8639..3d0847d6c8a 100644
--- a/tests/lib/LoggerTest.php
+++ b/tests/lib/LoggerTest.php
@@ -11,7 +11,7 @@ namespace Test;
use OC\Log;
use OCP\ILogger;
-class LoggerTest extends TestCase {
+class LoggerTest extends TestCase implements Log\IWritable {
/** @var \OC\SystemConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
@@ -23,15 +23,15 @@ class LoggerTest extends TestCase {
private $logger;
/** @var array */
- static private $logs = array();
+ private $logs = [];
protected function setUp() {
parent::setUp();
- self::$logs = array();
+ $this->logs = [];
$this->config = $this->createMock(\OC\SystemConfig::class);
$this->registry = $this->createMock(\OCP\Support\CrashReport\IRegistry::class);
- $this->logger = new Log('Test\LoggerTest', $this->config, null, $this->registry);
+ $this->logger = new Log($this, $this->config, null, $this->registry);
}
public function testInterpolation() {
@@ -63,11 +63,11 @@ class LoggerTest extends TestCase {
}
private function getLogs() {
- return self::$logs;
+ return $this->logs;
}
- public static function write($app, $message, $level) {
- self::$logs[]= "$level $message";
+ public function write($app, $message, $level) {
+ $this->logs[]= "$level $message";
}
public function userAndPasswordData() {
@@ -202,23 +202,4 @@ class LoggerTest extends TestCase {
$this->assertContains('*** sensitive parameters replaced ***', $logLine);
}
}
-
- public function dataGetLogClass() {
- return [
- ['file', \OC\Log\File::class],
- ['errorlog', \OC\Log\Errorlog::class],
- ['syslog', \OC\Log\Syslog::class],
-
- ['owncloud', \OC\Log\File::class],
- ['nextcloud', \OC\Log\File::class],
- ['foobar', \OC\Log\File::class],
- ];
- }
-
- /**
- * @dataProvider dataGetLogClass
- */
- public function testGetLogClass($type, $class) {
- $this->assertEquals($class, Log::getLogClass($type));
- }
}