ILIAS  release_8 Revision v8.24
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

Container $dic
 

Detailed Description

Member Function Documentation

◆ getCriterionConfig()

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

Definition at line 109 of file ilTermsOfServiceBaseTest.php.

110 {
111 if (null === $value) {
113 }
114
115 return new ilTermsOfServiceCriterionConfig($value);
116 }
Class ilTermsOfServiceCriterionConfig.

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

+ Here is the caller graph for this function:

◆ getLanguageMock()

◆ getUiFactoryMock()

ilTermsOfServiceBaseTest::getUiFactoryMock ( )
protected
Returns
MockObject&Factory

Definition at line 71 of file ilTermsOfServiceBaseTest.php.

71 : Factory
72 {
73 $ui = $this
74 ->getMockBuilder(Factory::class)
75 ->getMock();
76
77 $ui->method('legacy')->willReturnCallback(function ($content) {
78 $legacyMock = $this
79 ->getMockBuilder(Legacy::class)
80 ->getMock();
81 $legacyMock->method('getContent')->willReturn($content);
82
83 return $legacyMock;
84 });
85
86 return $ui;
87 }
This is how the factory for UI elements looks.
Definition: Factory.php:38

◆ setGlobalVariable()

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

◆ setUp()

ilTermsOfServiceBaseTest::setUp ( )
protected

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

Definition at line 36 of file ilTermsOfServiceBaseTest.php.

36 : void
37 {
38 $this->dic = new Container();
39 $GLOBALS['DIC'] = $this->dic;
40
41 $this->setGlobalVariable('lng', $this->getLanguageMock());
42 $this->setGlobalVariable(
43 'ilCtrl',
44 $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock()
45 );
46 $this->setGlobalVariable(
47 'upload',
48 $this->getMockBuilder(FileUpload::class)->disableOriginalConstructor()->getMock()
49 );
50
51 parent::setUp();
52 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
setGlobalVariable(string $name, $value)

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

+ Here is the call graph for this function:

Field Documentation

◆ $dic


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