ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
SelectTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2018 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5require_once(__DIR__ . "/../../../Base.php");
6
8{
9 public function _isClientSideValueOk($value)
10 {
11 return $this->isClientSideValueOk($value);
12 }
13}
14
16{
18 {
19 $options = ["one" => "Eins", "two" => "Zwei", "three" => "Drei"];
20 $select = new SelectForTest(
21 $this->createMock(ILIAS\Data\Factory::class),
22 $this->createMock(ILIAS\Refinery\Factory::class),
23 "",
24 $options,
25 ""
26 );
27
28 $this->assertTrue($select->_isClientSideValueOk("one"));
29 $this->assertTrue($select->_isClientSideValueOk("two"));
30 $this->assertTrue($select->_isClientSideValueOk("three"));
31 $this->assertFalse($select->_isClientSideValueOk("four"));
32 }
33
35 {
36 $options = [];
37 $select = new SelectForTest(
38 $this->createMock(ILIAS\Data\Factory::class),
39 $this->createMock(ILIAS\Refinery\Factory::class),
40 "",
41 $options,
42 ""
43 );
44
45 $this->assertTrue($select->_isClientSideValueOk(""));
46 }
47
49 {
50 $options = [];
51 $select = (new SelectForTest(
52 $this->createMock(ILIAS\Data\Factory::class),
53 $this->createMock(ILIAS\Refinery\Factory::class),
54 "",
55 $options,
56 ""
57 ))->withRequired(true);
58
59 $this->assertTrue($select->_isClientSideValueOk(""));
60 }
61}
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
Definition: Base.php:225
_isClientSideValueOk($value)
Definition: SelectTest.php:9
testEmptyStringIsAcceptableClientSideValueIfSelectIsNotRequired()
Definition: SelectTest.php:34
testEmptyStringIsAnAcceptableClientSideValueEvenIfSelectIsRequired()
Definition: SelectTest.php:48
testOnlyValuesFromOptionsAreAcceptableClientSideValues()
Definition: SelectTest.php:17
This describes select field.
Definition: Select.php:11
Class ChatMainBarProvider \MainMenu\Provider.