aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Utils/ScannerTest.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-21 11:17:14 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 16:21:26 +0100
commit61f7f13bd81948f6179bb8f70b6711c002ddd70e (patch)
treef1238dd97d93203637bb203d4cf649b65c8fbc4a /tests/lib/Files/Utils/ScannerTest.php
parente8c1f75064ae008e50daa087924de5d29368747e (diff)
downloadnextcloud-server-61f7f13bd81948f6179bb8f70b6711c002ddd70e.tar.gz
nextcloud-server-61f7f13bd81948f6179bb8f70b6711c002ddd70e.zip
Migrate from ILogger to LoggerInterface where needed in the tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib/Files/Utils/ScannerTest.php')
-rw-r--r--tests/lib/Files/Utils/ScannerTest.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php
index 414d38bae06..eb0b9938886 100644
--- a/tests/lib/Files/Utils/ScannerTest.php
+++ b/tests/lib/Files/Utils/ScannerTest.php
@@ -15,6 +15,7 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Storage\IStorageFactory;
use OCP\IUser;
+use Psr\Log\LoggerInterface;
class TestScanner extends \OC\Files\Utils\Scanner {
/**
@@ -71,7 +72,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -93,7 +94,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -131,7 +132,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('foo.txt', 'qwerty');
$storage->file_put_contents('folder/bar.txt', 'qwerty');
- $scanner = new \OC\Files\Utils\Scanner($uid, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new \OC\Files\Utils\Scanner($uid, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$this->assertFalse($cache->inCache('folder/bar.txt'));
$scanner->scan('/' . $uid . '/files/foo');
@@ -163,7 +164,7 @@ class ScannerTest extends \Test\TestCase {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid path to scan');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->scan($invalidPath);
}
@@ -177,7 +178,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('folder/bar.txt', 'qwerty');
$storage->touch('folder/bar.txt', time() - 200);
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('');
@@ -203,7 +204,7 @@ class ScannerTest extends \Test\TestCase {
$storage->file_put_contents('folder/bar.txt', 'qwerty');
$storage->file_put_contents('folder/subfolder/foobar.txt', 'qwerty');
- $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->getLogger());
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), $this->createMock(IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
$scanner->addMount($mount);
$scanner->scan('', $recusive = false);