1<?
php declare(strict_types=1);
6use PHPUnit\Framework\MockObject\MockObject;
27 ->expects($this->any())
29 ->willReturn(
'dummy');
49 $this->assertEquals(
'null', $criterion->getTypeIdent());
50 $this->assertEquals(
false, $criterion->hasUniqueNature());
66 ->getMockBuilder(ilRadioGroupInputGUI::class)
67 ->disableOriginalConstructor()
68 ->setMethods([
'getPostVar',
'addOption'])
71 $form->addItem($radioGroup);
74 ->expects($this->never())
75 ->method(
'addOption');
91 $gui = $criterion->
ui($this->lng);
93 $this->buildForm($gui);
105 $gui = $criterion->
ui($this->lng);
107 $form = $this->buildForm($gui);
110 ->expects($this->never())
111 ->method(
'getInput');
115 $this->assertInstanceOf(ilTermsOfServiceCriterionConfig::class, $value);
116 $this->assertEquals($this->getCriterionConfig(), $value);
125 $gui = $criterion->
ui($this->lng);
129 $this->assertIsString($actual);
130 $this->assertNotEmpty($actual);
136 public function testValuePresentationMatchesExpectation() : void
138 $criterion = $this->getInstance();
139 $gui = $criterion->ui($this->lng);
143 $this->getCriterionConfig(),
144 $this->getUiFactoryMock()
147 $this->assertInstanceOf(Component::class, $actual);
148 $this->assertInstanceOf(Legacy::class, $actual);
149 $this->assertEquals(
'-', $actual->getContent());
157 $user = $this->getUserMock();
158 $criterion = $this->getInstance();
160 $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.
testEvaluationAlwaysSucceeds()
testCriterionAlwaysCreateEmptyConfigValue(ilTermsOfServiceNullCriterion $criterion)
@depends testNoFormUserInterfaceElementsAreBuilt
testInstanceCanBeCreated()
buildForm(ilTermsOfServiceCriterionTypeGUI $gui)
testNoFormUserInterfaceElementsAreBuilt(ilTermsOfServiceNullCriterion $criterion)
testTypeIdentPresentationEqualsANonEmptyString(ilTermsOfServiceNullCriterion $criterion)
@depends testNoFormUserInterfaceElementsAreBuilt
Class ilTermsOfServiceNullCriterion.
A component is the most general form of an entity in the UI.
Interface ilTermsOfServiceCriterionTypeGUI.
getConfigByForm(ilPropertyFormGUI $form)
getValuePresentation(ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
appendOption(ilRadioGroupInputGUI $option, ilTermsOfServiceCriterionConfig $config)