ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTermsOfServiceBaseTest Class Reference

Class ilTermsOfServiceBaseTest. More...

+ Inheritance diagram for ilTermsOfServiceBaseTest:
+ Collaboration diagram for ilTermsOfServiceBaseTest:

Protected Member Functions

 setUp ()
 
 getLanguageMock ()
 
 getUiFactoryMock ()
 
 setGlobalVariable (string $name, $value)
 
 getCriterionConfig ($value=null)
 

Protected Attributes

 $dic
 

Detailed Description

Member Function Documentation

◆ getCriterionConfig()

ilTermsOfServiceBaseTest::getCriterionConfig (   $value = null)
protected
Parameters
mixed$value
Returns
ilTermsOfServiceCriterionConfig

Definition at line 91 of file ilTermsOfServiceBaseTest.php.

92 {
93 if (null === $value) {
95 }
96
97 return new ilTermsOfServiceCriterionConfig($value);
98 }
Class ilTermsOfServiceCriterionConfig.

Referenced by ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\criteriaAssignmentProvider(), and ilTermsOfServiceDocumentTest\criteriaAssignmentProvider().

+ Here is the caller graph for this function:

◆ getLanguageMock()

ilTermsOfServiceBaseTest::getLanguageMock ( )
protected
Returns
MockObject|ilLanguage
Exceptions
ReflectionException

Definition at line 39 of file ilTermsOfServiceBaseTest.php.

40 {
41 $lng = $this
42 ->getMockBuilder(ilLanguage::class)
43 ->disableOriginalConstructor()
44 ->setMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
45 ->getMock();
46
47 return $lng;
48 }
language handling
$lng

References $lng.

Referenced by ilTermsOfServiceNullCriterionTest\setUp(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\setUp(), ilTermsOfServiceUserHasLanguageCriterionTest\setUp(), setUp(), ilTermsOfServiceSettingsFormGUITest\testFormCannotBeSavedWithEnabledServiceWhenNoDocumentsExistAndServiceIsCurrentlyDisabled(), ilTermsOfServiceCriterionFormGUITest\testFormForExistingAssignmentCannotBeSavedForInvalidInput(), and ilTermsOfServiceDocumentFormGUITest\testUploadIssuesAreHandledWhenDocumentFormIsSaved().

+ Here is the caller graph for this function:

◆ getUiFactoryMock()

ilTermsOfServiceBaseTest::getUiFactoryMock ( )
protected
Returns
MockObject|\ILIAS\UI\Factory

Definition at line 53 of file ilTermsOfServiceBaseTest.php.

54 {
55 $ui = $this
56 ->getMockBuilder(\ILIAS\UI\Factory::class)
57 ->getMock();
58
59 $ui->expects($this->any())->method('legacy')->will($this->returnCallback(function ($content) {
60 $legacyMock = $this
61 ->getMockBuilder(\ILIAS\UI\Component\Legacy\Legacy::class)
62 ->getMock();
63 $legacyMock->expects($this->any())->method('getContent')->willReturn($content);
64
65 return $legacyMock;
66 }));
67
68 return $ui;
69 }
This is how the factory for UI elements looks.
Definition: Factory.php:18
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.

◆ setGlobalVariable()

ilTermsOfServiceBaseTest::setGlobalVariable ( string  $name,
  $value 
)
protected

◆ setUp()

ilTermsOfServiceBaseTest::setUp ( )
protected

Exceptions
ReflectionException

Reimplemented in ilTermsOfServiceNullCriterionTest, ilTermsOfServiceUserHasGlobalRoleCriterionTest, ilTermsOfServiceUserHasLanguageCriterionTest, ilTermsOfServiceAcceptanceHistoryGUITest, and ilTermsOfServiceDocumentGUITest.

Definition at line 21 of file ilTermsOfServiceBaseTest.php.

21 : void
22 {
23 $this->dic = new Container();
24 $GLOBALS['DIC'] = $this->dic;
25
26 $this->setGlobalVariable('lng', $this->getLanguageMock());
27 $this->setGlobalVariable(
28 'ilCtrl',
29 $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock()
30 );
31
32 parent::setUp();
33 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
setGlobalVariable(string $name, $value)

References $dic, $GLOBALS, getLanguageMock(), and setGlobalVariable().

+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilTermsOfServiceBaseTest::$dic
protected

Definition at line 15 of file ilTermsOfServiceBaseTest.php.

Referenced by setUp().


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