19declare(strict_types=1);
23use PHPUnit\Framework\MockObject\MockObject;
34 protected function setUp(): void
42 ->willReturn(
'dummy');
54 $this->assertSame(
'null', $criterion->getTypeIdent());
55 $this->assertFalse($criterion->hasUniqueNature());
70 ->getMockBuilder(ilRadioGroupInputGUI::class)
71 ->disableOriginalConstructor()
72 ->onlyMethods([
'getPostVar',
'addOption'])
75 $form->addItem($radioGroup);
78 ->expects($this->never())
79 ->method(
'addOption');
94 $gui = $criterion->
ui($this->
lng);
96 $this->buildForm($gui);
107 $gui = $criterion->
ui($this->
lng);
109 $form = $this->buildForm($gui);
112 ->expects($this->never())
113 ->method(
'getInput');
117 $this->assertInstanceOf(ilTermsOfServiceCriterionConfig::class, $value);
118 $this->assertEquals($this->getCriterionConfig(), $value);
127 $gui = $criterion->
ui($this->
lng);
131 $this->assertIsString($actual);
132 $this->assertNotEmpty($actual);
135 public function testValuePresentationMatchesExpectation(): void
137 $criterion = $this->getInstance();
138 $gui = $criterion->ui($this->
lng);
142 $this->getCriterionConfig(),
143 $this->getUiFactoryMock()
146 $this->assertInstanceOf(Component::class, $actual);
147 $this->assertInstanceOf(Legacy::class, $actual);
148 $this->assertSame(
'-', $actual->getContent());
153 $user = $this->getUserMock();
154 $criterion = $this->getInstance();
156 $this->assertTrue($criterion->evaluate($user, $this->getCriterionConfig()));
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.
appendOption(ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
getConfigByForm(ilPropertyFormGUI $form)
getValuePresentation(ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)