ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateActiveValidatorTest Class Reference
+ Inheritance diagram for ilCertificateActiveValidatorTest:
+ Collaboration diagram for ilCertificateActiveValidatorTest:

Public Member Functions

 testCertificatesAreActiveAndJavaServerIsActive ()
 
 testValidationReturnFalseBecauseGlobalCertificatesAreInactive ()
 
 testValidationReturnFalseBecauseJavaServerIsInactive ()
 

Detailed Description

Member Function Documentation

◆ testCertificatesAreActiveAndJavaServerIsActive()

ilCertificateActiveValidatorTest::testCertificatesAreActiveAndJavaServerIsActive ( )

Definition at line 9 of file ilCertificateActiveValidatorTest.php.

References $result.

10  {
11  $settings = $this->getMockBuilder('ilSetting')
12  ->disableOriginalConstructor()
13  ->getMock();
14 
15  $settings->method('get')
16  ->with('active')
17  ->willReturn(true);
18 
19  $rpcSettings = $this->getMockBuilder('ilRPCServerSettings')
20  ->disableOriginalConstructor()
21  ->getMock();
22 
23  $rpcSettings->method('isEnabled')
24  ->willReturn(true);
25 
26  $validator = new ilCertificateActiveValidator($settings, $rpcSettings);
27 
28  $result = $validator->validate();
29 
30  $this->assertTrue($result);
31  }
$result

◆ testValidationReturnFalseBecauseGlobalCertificatesAreInactive()

ilCertificateActiveValidatorTest::testValidationReturnFalseBecauseGlobalCertificatesAreInactive ( )

Definition at line 33 of file ilCertificateActiveValidatorTest.php.

References $result.

34  {
35  $settings = $this->getMockBuilder('ilSetting')
36  ->disableOriginalConstructor()
37  ->getMock();
38 
39  $settings->method('get')
40  ->with('active')
41  ->willReturn(false);
42 
43  $rpcSettings = $this->getMockBuilder('ilRPCServerSettings')
44  ->disableOriginalConstructor()
45  ->getMock();
46 
47  $rpcSettings
48  ->expects($this->never())
49  ->method('isEnabled')
50  ->willReturn(true);
51 
52  $validator = new ilCertificateActiveValidator($settings, $rpcSettings);
53 
54  $result = $validator->validate();
55 
56  $this->assertFalse($result);
57  }
$result

◆ testValidationReturnFalseBecauseJavaServerIsInactive()

ilCertificateActiveValidatorTest::testValidationReturnFalseBecauseJavaServerIsInactive ( )

Definition at line 59 of file ilCertificateActiveValidatorTest.php.

References $result, and Sabre\Event\once().

60  {
61  $settings = $this->getMockBuilder('ilSetting')
62  ->disableOriginalConstructor()
63  ->getMock();
64 
65  $settings->method('get')
66  ->with('active')
67  ->willReturn(true);
68 
69  $rpcSettings = $this->getMockBuilder('ilRPCServerSettings')
70  ->disableOriginalConstructor()
71  ->getMock();
72 
73  $rpcSettings
74  ->expects($this->once())
75  ->method('isEnabled')
76  ->willReturn(false);
77 
78  $validator = new ilCertificateActiveValidator($settings, $rpcSettings);
79 
80  $result = $validator->validate();
81 
82  $this->assertFalse($result);
83  }
$result
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
+ Here is the call graph for this function:

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