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

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

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

Referenced by testCriterionAlwaysCreateEmptyConfigValue(), and testNoFormUserInterfaceElementsAreBuilt().

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  }
appendOption(ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

ilTermsOfServiceNullCriterionTest::getInstance ( )
protected

Definition at line 45 of file ilTermsOfServiceNullCriterionTest.php.

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

46  {
47  return new ilTermsOfServiceNullCriterion();
48  }
Class ilTermsOfServiceNullCriterion.
+ Here is the caller graph for this function:

◆ setUp()

ilTermsOfServiceNullCriterionTest::setUp ( )
protected

Definition at line 34 of file ilTermsOfServiceNullCriterionTest.php.

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

34  : void
35  {
36  parent::setUp();
37 
38  $this->lng = $this->getLanguageMock();
39 
40  $this->lng
41  ->method('txt')
42  ->willReturn('dummy');
43  }
+ Here is the call graph for this function:

◆ testCriterionAlwaysCreateEmptyConfigValue()

ilTermsOfServiceNullCriterionTest::testCriterionAlwaysCreateEmptyConfigValue ( ilTermsOfServiceNullCriterion  $criterion)

testNoFormUserInterfaceElementsAreBuilt

Parameters
ilTermsOfServiceNullCriterion$criterion

Definition at line 105 of file ilTermsOfServiceNullCriterionTest.php.

References buildForm(), ilTermsOfServiceBaseTest\getCriterionConfig(), ILIAS\Repository\lng(), and ilTermsOfServiceNullCriterion\ui().

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

◆ testEvaluationAlwaysSucceeds()

ilTermsOfServiceNullCriterionTest::testEvaluationAlwaysSucceeds ( )

Definition at line 151 of file ilTermsOfServiceNullCriterionTest.php.

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

151  : void
152  {
153  $user = $this->getUserMock();
154  $criterion = $this->getInstance();
155 
156  $this->assertTrue($criterion->evaluate($user, $this->getCriterionConfig()));
157  }
+ Here is the call graph for this function:

◆ testInstanceCanBeCreated()

ilTermsOfServiceNullCriterionTest::testInstanceCanBeCreated ( )

Definition at line 50 of file ilTermsOfServiceNullCriterionTest.php.

References getInstance().

51  {
52  $criterion = $this->getInstance();
53 
54  $this->assertSame('null', $criterion->getTypeIdent());
55  $this->assertFalse($criterion->hasUniqueNature());
56 
57  return $criterion;
58  }
Class ilTermsOfServiceNullCriterion.
+ Here is the call graph for this function:

◆ testNoFormUserInterfaceElementsAreBuilt()

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

Definition at line 91 of file ilTermsOfServiceNullCriterionTest.php.

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

94  $gui = $criterion->ui($this->lng);
95 
96  $this->buildForm($gui);
97 
98  return $criterion;
99  }
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 125 of file ilTermsOfServiceNullCriterionTest.php.

References ilTermsOfServiceBaseTest\getCriterionConfig(), getInstance(), ilTermsOfServiceBaseTest\getUiFactoryMock(), ILIAS\Repository\lng(), and ilTermsOfServiceNullCriterion\ui().

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