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

Class ilTermsOfServiceNullCriterionTest. More...

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

Public Member Functions

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

Protected Member Functions

 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

 $lng
 
- Protected Attributes inherited from ilTermsOfServiceBaseTest
 $dic
 

Detailed Description

Member Function Documentation

◆ buildForm()

ilTermsOfServiceNullCriterionTest::buildForm ( ilTermsOfServiceCriterionTypeGUI  $gui)
protected
Parameters
ilTermsOfServiceCriterionTypeGUI$gui
Returns
MockObject|ilPropertyFormGUI
Exceptions
ReflectionException

Definition at line 60 of file ilTermsOfServiceNullCriterionTest.php.

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

◆ getInstance()

ilTermsOfServiceNullCriterionTest::getInstance ( )
protected
Returns
ilTermsOfServiceNullCriterion

Definition at line 35 of file ilTermsOfServiceNullCriterionTest.php.

36 {
37 $criterion = new ilTermsOfServiceNullCriterion();
38
39 return $criterion;
40 }
Class ilTermsOfServiceNullCriterion.

Referenced by testInstanceCanBeCreated().

+ Here is the caller graph for this function:

◆ setUp()

ilTermsOfServiceNullCriterionTest::setUp ( )

@inheritDoc

Reimplemented from ilTermsOfServiceBaseTest.

Definition at line 20 of file ilTermsOfServiceNullCriterionTest.php.

20 : void
21 {
22 parent::setUp();
23
24 $this->lng = $this->getLanguageMock();
25
26 $this->lng
27 ->expects($this->any())
28 ->method('txt')
29 ->willReturn('dummy');
30 }

References ilTermsOfServiceBaseTest\getLanguageMock().

+ Here is the call graph for this function:

◆ testCriterionAlwaysCreateEmptyConfigValue()

ilTermsOfServiceNullCriterionTest::testCriterionAlwaysCreateEmptyConfigValue ( ilTermsOfServiceNullCriterion  $criterion)

@depends testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion
Exceptions
ReflectionException

Definition at line 103 of file ilTermsOfServiceNullCriterionTest.php.

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

References ilTermsOfServiceCriterionTypeGUI\getConfigByForm(), and ilTermsOfServiceCriterionType\ui().

+ Here is the call graph for this function:

◆ testEvaluationAlwaysSucceeds()

ilTermsOfServiceNullCriterionTest::testEvaluationAlwaysSucceeds ( )
Exceptions
ReflectionException

Definition at line 155 of file ilTermsOfServiceNullCriterionTest.php.

155 : void
156 {
157 $user = $this->getUserMock();
158 $criterion = $this->getInstance();
159
160 $this->assertTrue($criterion->evaluate($user, $this->getCriterionConfig()));
161 }

◆ testInstanceCanBeCreated()

ilTermsOfServiceNullCriterionTest::testInstanceCanBeCreated ( )
Returns
ilTermsOfServiceNullCriterion

Definition at line 45 of file ilTermsOfServiceNullCriterionTest.php.

46 {
47 $criterion = $this->getInstance();
48
49 $this->assertEquals('null', $criterion->getTypeIdent());
50 $this->assertEquals(false, $criterion->hasUniqueNature());
51
52 return $criterion;
53 }

References getInstance().

+ Here is the call graph for this function:

◆ testNoFormUserInterfaceElementsAreBuilt()

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

Definition at line 88 of file ilTermsOfServiceNullCriterionTest.php.

91 $gui = $criterion->ui($this->lng);
92
93 $this->buildForm($gui);
94
95 return $criterion;
96 }

◆ testTypeIdentPresentationEqualsANonEmptyString()

ilTermsOfServiceNullCriterionTest::testTypeIdentPresentationEqualsANonEmptyString ( ilTermsOfServiceNullCriterion  $criterion)

@depends testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion

Definition at line 123 of file ilTermsOfServiceNullCriterionTest.php.

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

References ilTermsOfServiceCriterionTypeGUI\getIdentPresentation(), and ilTermsOfServiceCriterionType\ui().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilTermsOfServiceNullCriterionTest::$lng
protected

Definition at line 15 of file ilTermsOfServiceNullCriterionTest.php.


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