26 ->expects($this->any())
28 ->willReturn(
'dummy');
36 $criterion = new \ilTermsOfServiceNullCriterion();
48 $this->assertEquals(
'null', $criterion->getTypeIdent());
49 $this->assertEquals(
false, $criterion->hasUniqueNature());
64 ->getMockBuilder(\ilRadioGroupInputGUI::class)
65 ->disableOriginalConstructor()
66 ->setMethods([
'getPostVar',
'addOption'])
69 $form->addItem($radioGroup);
72 ->expects($this->never())
73 ->method(
'addOption');
87 $gui = $criterion->
ui($this->lng);
89 $this->buildForm($gui);
100 $gui = $criterion->
ui($this->lng);
102 $form = $this->buildForm($gui);
105 ->expects($this->never())
106 ->method(
'getInput');
110 $this->assertInstanceOf(\ilTermsOfServiceCriterionConfig::class, $value);
111 $this->assertEquals($this->getCriterionConfig(), $value);
120 $gui = $criterion->
ui($this->lng);
124 $this->assertInternalType(
'string', $actual);
125 $this->assertNotEmpty($actual);
131 public function testValuePresentationMatchesExpectation()
133 $criterion = $this->getInstance();
134 $gui = $criterion->ui($this->lng);
138 $this->getCriterionConfig(),
139 $this->dic->ui()->factory()
142 $this->assertInstanceOf(Component::class, $actual);
143 $this->assertInstanceOf(Legacy::class, $actual);
144 $this->assertEquals(
'-', $actual->getContent());
152 $user = $this->getUserMock();
153 $criterion = $this->getInstance();
155 $this->assertTrue($criterion->evaluate(
$user, $this->getCriterionConfig()));
An exception for terminatinating execution or to throw for unit testing.
getCriterionConfig($value=null)
Class ilTermsOfServiceCriterionBaseTest.
Class ilTermsOfServiceNullCriterionTest.
testNoFormUserInterfaceElementsAreBuilt(\ilTermsOfServiceNullCriterion $criterion)
testTypeIdentPresentatioEqualsANonEmptyString(\ilTermsOfServiceNullCriterion $criterion)
@depends testNoFormUserInterfaceElementsAreBuilt
testCriterionAlwaysCreateEmptyConfigValue(\ilTermsOfServiceNullCriterion $criterion)
@depends testNoFormUserInterfaceElementsAreBuilt
testEvaluationAlwaysSucceeds()
buildForm(\ilTermsOfServiceCriterionTypeGUI $gui)
testInstanceCanBeCreated()
Class ilTermsOfServiceNullCriterion.
A component is the most general form of an entity in the UI.
Interface ilTermsOfServiceCriterionTypeGUI.
appendOption(\ilRadioGroupInputGUI $option, \ilTermsOfServiceCriterionConfig $config)
getValuePresentation(\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
getConfigByForm(\ilPropertyFormGUI $form)
if(isset($_POST['submit'])) $form