ILIAS  release_8 Revision v8.24
VirusScannerFactoryTest Class Reference

@runTestsInSeparateProcesses @preserveGlobalState disabled More...

+ Inheritance diagram for VirusScannerFactoryTest:
+ Collaboration diagram for VirusScannerFactoryTest:

Public Member Functions

 testSophosScanStrategyCanBeRetrievedAccordingToGlobalSetting ()
 
 testAntiVirScanStrategyCanBeRetrievedAccordingToGlobalSetting ()
 
 testClamAvScanStrategyCanBeRetrievedAccordingToGlobalSetting ()
 
 testIcapClientScanStrategyCanBeRetrievedAccordingToGlobalSetting ()
 

Static Public Attributes

static ilLogger $logger
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from VirusScannerBaseTest
 setUp ()
 
 setGlobalVariable (string $name, $value)
 

Detailed Description

@runTestsInSeparateProcesses @preserveGlobalState disabled

Definition at line 27 of file VirusScannerFactoryTest.php.

Member Function Documentation

◆ setUp()

VirusScannerFactoryTest::setUp ( )
protected

Reimplemented from VirusScannerBaseTest.

Definition at line 31 of file VirusScannerFactoryTest.php.

31 : void
32 {
33 parent::setUp();
34
35 if (!defined('IL_VIRUS_SCAN_COMMAND')) {
36 define("IL_VIRUS_SCAN_COMMAND", 'phpunitscan');
37 }
38
39 if (!defined('IL_VIRUS_CLEAN_COMMAND')) {
40 define("IL_VIRUS_CLEAN_COMMAND", 'phpunitclean');
41 }
42
43 $logger = $this->getMockBuilder(ilLogger::class)->disableOriginalConstructor()->getMock();
44 self::$logger = $logger;
45
46 $logger_factory = new class () extends ilLoggerFactory {
47 public function __construct()
48 {
49 }
50
51 public static function getRootLogger(): ilLogger
52 {
54 }
55
56 public function getComponentLogger(string $a_component_id): ilLogger
57 {
59 }
60 };
61
62 $this->setGlobalVariable('ilias', $this->getMockBuilder(ILIAS::class)->disableOriginalConstructor()->getMock());
63 $this->setGlobalVariable(
64 'lng',
65 $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()
66 );
67
68 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
69
70 $this->setGlobalVariable('ilErr', $this->getMockBuilder(ilErrorHandling::class)->disableOriginalConstructor()->getMock());
71 }
setGlobalVariable(string $name, $value)
Component logger with individual log levels by component id.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $logger, ILIAS\GlobalScreen\Provider\__construct(), and VirusScannerBaseTest\setGlobalVariable().

+ Here is the call graph for this function:

◆ testAntiVirScanStrategyCanBeRetrievedAccordingToGlobalSetting()

VirusScannerFactoryTest::testAntiVirScanStrategyCanBeRetrievedAccordingToGlobalSetting ( )

Definition at line 80 of file VirusScannerFactoryTest.php.

80 : void
81 {
82 define("IL_VIRUS_SCANNER", 'AntiVir');
83
84 self::assertInstanceOf(ilVirusScannerAntiVir::class, ilVirusScannerFactory::_getInstance());
85 }

References ilVirusScannerFactory\_getInstance().

+ Here is the call graph for this function:

◆ testClamAvScanStrategyCanBeRetrievedAccordingToGlobalSetting()

VirusScannerFactoryTest::testClamAvScanStrategyCanBeRetrievedAccordingToGlobalSetting ( )

Definition at line 87 of file VirusScannerFactoryTest.php.

87 : void
88 {
89 define("IL_VIRUS_SCANNER", 'ClamAV');
90
91 self::assertInstanceOf(ilVirusScannerClamAV::class, ilVirusScannerFactory::_getInstance());
92 }

References ilVirusScannerFactory\_getInstance().

+ Here is the call graph for this function:

◆ testIcapClientScanStrategyCanBeRetrievedAccordingToGlobalSetting()

VirusScannerFactoryTest::testIcapClientScanStrategyCanBeRetrievedAccordingToGlobalSetting ( )

Definition at line 94 of file VirusScannerFactoryTest.php.

94 : void
95 {
96 define("IL_VIRUS_SCANNER", 'icap');
97 define("IL_ICAP_CLIENT", 'phpunit');
98
99 self::assertInstanceOf(ilVirusScannerICapClient::class, ilVirusScannerFactory::_getInstance());
100 }

References ilVirusScannerFactory\_getInstance().

+ Here is the call graph for this function:

◆ testSophosScanStrategyCanBeRetrievedAccordingToGlobalSetting()

VirusScannerFactoryTest::testSophosScanStrategyCanBeRetrievedAccordingToGlobalSetting ( )

Definition at line 73 of file VirusScannerFactoryTest.php.

73 : void
74 {
75 define("IL_VIRUS_SCANNER", 'Sophos');
76
77 self::assertInstanceOf(ilVirusScannerSophos::class, ilVirusScannerFactory::_getInstance());
78 }

References ilVirusScannerFactory\_getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger VirusScannerFactoryTest::$logger
static

Definition at line 29 of file VirusScannerFactoryTest.php.

Referenced by setUp().


The documentation for this class was generated from the following file: