ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilTermsOfServiceNullCriterionTest Class Reference

Class ilTermsOfServiceNullCriterionTest. More...

+ Inheritance diagram for ilTermsOfServiceNullCriterionTest:
+ Collaboration diagram for ilTermsOfServiceNullCriterionTest:

Public Member Functions

 testInstanceCanBeCreated ()
 
 testNoFormUserInterfaceElementsAreBuilt (ilTermsOfServiceNullCriterion $criterion)
 
 testCriterionAlwaysCreateEmptyConfigValue (ilTermsOfServiceNullCriterion $criterion)
 @depends testNoFormUserInterfaceElementsAreBuilt More...
 
 testTypeIdentPresentationEqualsANonEmptyString (ilTermsOfServiceNullCriterion $criterion)
 @depends testNoFormUserInterfaceElementsAreBuilt More...
 
 testEvaluationAlwaysSucceeds ()
 

Protected Member Functions

 setUp ()
 
 getInstance ()
 
 buildForm (ilTermsOfServiceCriterionTypeGUI $gui)
 
- Protected Member Functions inherited from ilTermsOfServiceCriterionBaseTest
 getRbacReviewMock ()
 
 getObjectDataCacheMock ()
 
 getRadioGroupMock ()
 
 getFormMock ()
 
 getUserMock ()
 
- Protected Member Functions inherited from ilTermsOfServiceBaseTest
 setUp ()
 
 getLanguageMock ()
 
 getUiFactoryMock ()
 
 setGlobalVariable (string $name, $value)
 
 getCriterionConfig ($value=null)
 

Protected Attributes

ilLanguage $lng
 
- Protected Attributes inherited from ilTermsOfServiceBaseTest
Container $dic
 

Detailed Description

Member Function Documentation

◆ buildForm()

ilTermsOfServiceNullCriterionTest::buildForm ( ilTermsOfServiceCriterionTypeGUI  $gui)
protected
Parameters
ilTermsOfServiceCriterionTypeGUI$gui
Returns
MockObject&ilPropertyFormGUI

Definition at line 64 of file ilTermsOfServiceNullCriterionTest.php.

67 $form = $this->getFormMock();
68
69 $radioGroup = $this
70 ->getMockBuilder(ilRadioGroupInputGUI::class)
71 ->disableOriginalConstructor()
72 ->onlyMethods(['getPostVar', 'addOption'])
73 ->getMock();
74
75 $form->addItem($radioGroup);
76
77 $radioGroup
78 ->expects($this->never())
79 ->method('addOption');
80
81 $gui->appendOption($radioGroup, $this->getCriterionConfig());
82
83 return $form;
84 }
This class represents a property form user interface.
appendOption(ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)

◆ getInstance()

ilTermsOfServiceNullCriterionTest::getInstance ( )
protected

Definition at line 45 of file ilTermsOfServiceNullCriterionTest.php.

Referenced by testInstanceCanBeCreated().

+ Here is the caller graph for this function:

◆ setUp()

ilTermsOfServiceNullCriterionTest::setUp ( )
protected

Reimplemented from ilTermsOfServiceBaseTest.

Definition at line 34 of file ilTermsOfServiceNullCriterionTest.php.

34 : void
35 {
36 parent::setUp();
37
38 $this->lng = $this->getLanguageMock();
39
40 $this->lng
41 ->method('txt')
42 ->willReturn('dummy');
43 }

References ilTermsOfServiceBaseTest\getLanguageMock(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testCriterionAlwaysCreateEmptyConfigValue()

ilTermsOfServiceNullCriterionTest::testCriterionAlwaysCreateEmptyConfigValue ( ilTermsOfServiceNullCriterion  $criterion)

@depends testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion

Definition at line 105 of file ilTermsOfServiceNullCriterionTest.php.

105 : void
106 {
107 $gui = $criterion->ui($this->lng);
108
109 $form = $this->buildForm($gui);
110
111 $form
112 ->expects($this->never())
113 ->method('getInput');
114
115 $value = $gui->getConfigByForm($form);
116
117 $this->assertInstanceOf(ilTermsOfServiceCriterionConfig::class, $value);
118 $this->assertEquals($this->getCriterionConfig(), $value);
119 }
buildForm(ilTermsOfServiceCriterionTypeGUI $gui)

References ilTermsOfServiceCriterionTypeGUI\getConfigByForm(), ILIAS\Repository\lng(), and ilTermsOfServiceNullCriterion\ui().

+ Here is the call graph for this function:

◆ testEvaluationAlwaysSucceeds()

ilTermsOfServiceNullCriterionTest::testEvaluationAlwaysSucceeds ( )

Definition at line 151 of file ilTermsOfServiceNullCriterionTest.php.

151 : void
152 {
153 $user = $this->getUserMock();
154 $criterion = $this->getInstance();
155
156 $this->assertTrue($criterion->evaluate($user, $this->getCriterionConfig()));
157 }

◆ testInstanceCanBeCreated()

ilTermsOfServiceNullCriterionTest::testInstanceCanBeCreated ( )

Definition at line 50 of file ilTermsOfServiceNullCriterionTest.php.

51 {
52 $criterion = $this->getInstance();
53
54 $this->assertSame('null', $criterion->getTypeIdent());
55 $this->assertFalse($criterion->hasUniqueNature());
56
57 return $criterion;
58 }

References getInstance().

+ Here is the call graph for this function:

◆ testNoFormUserInterfaceElementsAreBuilt()

ilTermsOfServiceNullCriterionTest::testNoFormUserInterfaceElementsAreBuilt ( ilTermsOfServiceNullCriterion  $criterion)
Parameters
ilTermsOfServiceNullCriterion$criterion@depends testInstanceCanBeCreated
Returns
ilTermsOfServiceNullCriterion

Definition at line 91 of file ilTermsOfServiceNullCriterionTest.php.

94 $gui = $criterion->ui($this->lng);
95
96 $this->buildForm($gui);
97
98 return $criterion;
99 }

◆ testTypeIdentPresentationEqualsANonEmptyString()

ilTermsOfServiceNullCriterionTest::testTypeIdentPresentationEqualsANonEmptyString ( ilTermsOfServiceNullCriterion  $criterion)

@depends testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion

Definition at line 125 of file ilTermsOfServiceNullCriterionTest.php.

125 : void
126 {
127 $gui = $criterion->ui($this->lng);
128
129 $actual = $gui->getIdentPresentation();
130
131 $this->assertIsString($actual);
132 $this->assertNotEmpty($actual);
133 }

References ilTermsOfServiceCriterionTypeGUI\getIdentPresentation(), ILIAS\Repository\lng(), and ilTermsOfServiceNullCriterion\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilTermsOfServiceNullCriterionTest::$lng
protected

Definition at line 32 of file ilTermsOfServiceNullCriterionTest.php.


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