Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_antivirus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-12-05 16:13:35 +0300
committerJoas Schilling <coding@schilljs.com>2019-12-05 16:13:35 +0300
commitb0faf8f773c46359191520699e0767c904ee92ce (patch)
tree6ccd233c14bce8994818b571505dc85b800a6077 /tests
parent29ba9045e33969a5727211ce5f1fbc08e31f5b87 (diff)
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/BackgroundScannerTest.php14
-rw-r--r--tests/Db/RuleTest.php4
-rw-r--r--tests/TestBase.php2
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/BackgroundScannerTest.php b/tests/BackgroundScannerTest.php
index 57dea74..15fa442 100644
--- a/tests/BackgroundScannerTest.php
+++ b/tests/BackgroundScannerTest.php
@@ -10,22 +10,28 @@
namespace OCA\Files_Antivirus\Tests;
-use OCA\Files_Antivirus\BackgroundScanner;
+use OCA\Files_Antivirus\BackgroundJob\BackgroundScanner;
use OCA\Files_Antivirus\Scanner\ScannerFactory;
use Doctrine\DBAL\Driver\PDOStatement;
use OCP\ILogger;
+/**
+ * Class BackgroundScannerTest
+ *
+ * @package OCA\Files_Antivirus\Tests
+ * @group DB
+ */
class BackgroundScannerTest extends TestBase {
public function testGetFilesForScan(){
$this->assertTrue(true);
return;
-
+
$scannerFactory = new Mock\ScannerFactory(
new Mock\Config($this->container->query('CoreConfig')),
$this->container->query('Logger')
);
-
+
$scannerMock = $this->getMockBuilder(BackgroundScanner::class)
->setConstructorArgs([
$scannerFactory,
@@ -39,7 +45,7 @@ class BackgroundScannerTest extends TestBase {
\OC::$server->getMimeTypeLoader()
])
->getMock();
-
+
$class = new \ReflectionClass($scannerMock);
$method = $class->getMethod('getFilesForScan');
$method->setAccessible(true);
diff --git a/tests/Db/RuleTest.php b/tests/Db/RuleTest.php
index 2a8620e..9c28a1f 100644
--- a/tests/Db/RuleTest.php
+++ b/tests/Db/RuleTest.php
@@ -10,7 +10,7 @@ namespace OCA\Files_Antivirus\Tests\Db;
use OCA\Files_Antivirus\Db\Rule;
use OCA\Files_Antivirus\Status;
-use OCA\Files_antivirus\Tests\TestBase;
+use OCA\Files_Antivirus\Tests\TestBase;
/**
* @group DB
@@ -33,7 +33,7 @@ class RuleTest extends TestBase {
'description' => "",
'status' => Status::SCANRESULT_CLEAN
];
-
+
$rule = Rule::fromParams($data);
$actual = $rule->jsonSerialize();
$this->assertArrayHasKey('id', $actual);
diff --git a/tests/TestBase.php b/tests/TestBase.php
index 3f56bb5..9d16bc3 100644
--- a/tests/TestBase.php
+++ b/tests/TestBase.php
@@ -29,7 +29,7 @@ abstract class TestBase extends TestCase {
protected $l10n;
- public function setUp() {
+ protected function setUp(): void {
parent::setUp();
\OC_App::loadApp('files_antivirus');