ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceNullCriterionTest Class Reference

Class ilTermsOfServiceNullCriterionTest. More...

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

Public Member Functions

 setUp ()
 
 testInstanceCanBeCreated ()
 
 testNoFormUserInterfaceElementsAreBuilt (ilTermsOfServiceNullCriterion $criterion)
 
 testCriterionAlwaysCreateEmptyConfigValue (ilTermsOfServiceNullCriterion $criterion)
 testNoFormUserInterfaceElementsAreBuilt More...
 
 testTypeIdentPresentationEqualsANonEmptyString (ilTermsOfServiceNullCriterion $criterion)
 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.

References ilTermsOfServiceCriterionTypeGUI\appendOption(), ilTermsOfServiceBaseTest\getCriterionConfig(), and ilTermsOfServiceCriterionBaseTest\getFormMock().

Referenced by testCriterionAlwaysCreateEmptyConfigValue(), and testNoFormUserInterfaceElementsAreBuilt().

63  $form = $this->getFormMock();
64 
65  $radioGroup = $this
66  ->getMockBuilder(ilRadioGroupInputGUI::class)
67  ->disableOriginalConstructor()
68  ->onlyMethods(['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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

ilTermsOfServiceNullCriterionTest::getInstance ( )
protected
Returns
ilTermsOfServiceNullCriterion

Definition at line 35 of file ilTermsOfServiceNullCriterionTest.php.

Referenced by testEvaluationAlwaysSucceeds(), testInstanceCanBeCreated(), and testTypeIdentPresentationEqualsANonEmptyString().

36  {
37  $criterion = new ilTermsOfServiceNullCriterion();
38 
39  return $criterion;
40  }
Class ilTermsOfServiceNullCriterion.
+ Here is the caller graph for this function:

◆ setUp()

ilTermsOfServiceNullCriterionTest::setUp ( )

Definition at line 20 of file ilTermsOfServiceNullCriterionTest.php.

References ilTermsOfServiceBaseTest\getLanguageMock().

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  }
+ Here is the call graph for this function:

◆ testCriterionAlwaysCreateEmptyConfigValue()

ilTermsOfServiceNullCriterionTest::testCriterionAlwaysCreateEmptyConfigValue ( ilTermsOfServiceNullCriterion  $criterion)

testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion
Exceptions
ReflectionException

Definition at line 103 of file ilTermsOfServiceNullCriterionTest.php.

References buildForm(), ilTermsOfServiceBaseTest\getCriterionConfig(), and ilTermsOfServiceCriterionType\ui().

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)
+ Here is the call graph for this function:

◆ testEvaluationAlwaysSucceeds()

ilTermsOfServiceNullCriterionTest::testEvaluationAlwaysSucceeds ( )
Exceptions
ReflectionException

Definition at line 155 of file ilTermsOfServiceNullCriterionTest.php.

References getInstance(), and ilTermsOfServiceCriterionBaseTest\getUserMock().

155  : void
156  {
157  $user = $this->getUserMock();
158  $criterion = $this->getInstance();
159 
160  $this->assertTrue($criterion->evaluate($user, $this->getCriterionConfig()));
161  }
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilTermsOfServiceNullCriterionTest::testInstanceCanBeCreated ( )
Returns
ilTermsOfServiceNullCriterion

Definition at line 45 of file ilTermsOfServiceNullCriterionTest.php.

References getInstance().

46  {
47  $criterion = $this->getInstance();
48 
49  $this->assertEquals('null', $criterion->getTypeIdent());
50  $this->assertEquals(false, $criterion->hasUniqueNature());
51 
52  return $criterion;
53  }
Class ilTermsOfServiceNullCriterion.
+ Here is the call graph for this function:

◆ testNoFormUserInterfaceElementsAreBuilt()

ilTermsOfServiceNullCriterionTest::testNoFormUserInterfaceElementsAreBuilt ( ilTermsOfServiceNullCriterion  $criterion)
Parameters
ilTermsOfServiceNullCriterion$criteriontestInstanceCanBeCreated
Returns
ilTermsOfServiceNullCriterion
Exceptions
ReflectionException

Definition at line 88 of file ilTermsOfServiceNullCriterionTest.php.

References buildForm(), and ilTermsOfServiceCriterionType\ui().

91  $gui = $criterion->ui($this->lng);
92 
93  $this->buildForm($gui);
94 
95  return $criterion;
96  }
buildForm(ilTermsOfServiceCriterionTypeGUI $gui)
Class ilTermsOfServiceNullCriterion.
+ Here is the call graph for this function:

◆ testTypeIdentPresentationEqualsANonEmptyString()

ilTermsOfServiceNullCriterionTest::testTypeIdentPresentationEqualsANonEmptyString ( ilTermsOfServiceNullCriterion  $criterion)

testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion

Definition at line 123 of file ilTermsOfServiceNullCriterionTest.php.

References ilTermsOfServiceBaseTest\getCriterionConfig(), getInstance(), ilTermsOfServiceBaseTest\getUiFactoryMock(), and ilTermsOfServiceCriterionType\ui().

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