-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (c) 2017 Victor Dubiniuk <[email protected]> | ||
* This file is licensed under the Affero General Public License version 3 or | ||
* later. | ||
* See the COPYING-README file. | ||
*/ | ||
|
||
|
||
namespace OCA\Files_antivirus\Tests; | ||
|
||
use OCA\Files_Antivirus\BackgroundScanner; | ||
use OCA\Files_Antivirus\ScannerFactory; | ||
use Doctrine\DBAL\Driver\PDOStatement; | ||
|
||
class BackgroundScannerTest extends TestBase { | ||
|
||
public function testGetFilesForScan(){ | ||
|
||
$scannerFactory = new Mock\ScannerFactory( | ||
new Mock\Config($this->container->query('CoreConfig')), | ||
$this->container->query('Logger') | ||
); | ||
|
||
$scannerMock = $this->getMockBuilder(BackgroundScanner::class) | ||
->setConstructorArgs([ | ||
$scannerFactory, | ||
$this->l10n, | ||
$this->config, | ||
\OC::$server->getRootFolder(), | ||
\OC::$server->getUserSession() | ||
]) | ||
->getMock(); | ||
|
||
$class = new \ReflectionClass($scannerMock); | ||
$method = $class->getMethod('getFilesForScan'); | ||
$method->setAccessible(true); | ||
$result = $method->invokeArgs($scannerMock, []); | ||
$this->assertEquals(PDOStatement::class, get_class($result)); | ||
} | ||
|
||
} |