Definition at line 32 of file ColorPickerInputTest.php.
◆ setUp()
| ColorPickerInputTest::setUp |
( |
| ) |
|
◆ testCommonRendering()
| ColorPickerInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 68 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
70 $f = $this->getFieldFactory();
72 $colorpicker =
$f->colorpicker($label, null)->withNameFrom($this->name_source);
74 $this->testWithError($colorpicker);
75 $this->testWithNoByline($colorpicker);
76 $this->testWithRequired($colorpicker);
77 $this->testWithDisabled($colorpicker);
78 $this->testWithAdditionalOnloadCodeRendersId($colorpicker);
◆ testImplementsFactoryInterface()
| ColorPickerInputTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 43 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
45 $f = $this->getFieldFactory();
46 $cp =
$f->colorpicker(
"label",
"byline");
47 $this->assertInstanceOf(\
ILIAS\
UI\
Component\Input\Container\Form\FormInput::class, $cp);
48 $this->assertInstanceOf(Field\ColorPicker::class, $cp);
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testNullValue()
| ColorPickerInputTest::testNullValue |
( |
| ) |
|
Definition at line 124 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
126 $f = $this->getFieldFactory();
127 $colorpicker =
$f->colorpicker(
"label",
"byline");
128 $this->expectException(\InvalidArgumentException::class);
129 $colorpicker->withValue(null);
◆ testRender()
| ColorPickerInputTest::testRender |
( |
| ) |
|
Definition at line 51 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
53 $f = $this->getFieldFactory();
56 $cp =
$f->colorpicker($label, $byline)->withNameFrom($this->name_source);
58 $expected = $this->getFormWrappedHtml(
59 'color-picker-field-input',
61 '<input id="id_1" type="color" name="name_0" value="" class="c-field-color-picker"/>',
65 $this->assertEquals($expected, $this->render($cp));
◆ testRenderValue()
| ColorPickerInputTest::testRenderValue |
( |
| ) |
|
Definition at line 81 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
83 $f = $this->getFieldFactory();
87 $cp =
$f->colorpicker($label, $byline)
89 ->withNameFrom($this->name_source);
91 $expected = $this->getFormWrappedHtml(
92 'color-picker-field-input',
94 '<input id="id_1" type="color" name="name_0" value="value_0" class="c-field-color-picker"/>',
98 $this->assertEquals($expected, $this->render($cp));
◆ testValueRequired()
| ColorPickerInputTest::testValueRequired |
( |
| ) |
|
Definition at line 101 of file ColorPickerInputTest.php.
References Vendor\Package\$f.
103 $f = $this->getFieldFactory();
107 $cp =
$f->colorpicker($label, $byline)
108 ->withNameFrom($this->name_source)
109 ->withRequired(
true);
111 $cp1 = $cp->withInput(
new DefInputData([$name =>
"#FFF"]));
112 $value1 = $cp1->getContent();
113 $this->assertTrue($value1->isOk());
115 $cp2 = $cp->withInput(
new DefInputData([$name =>
"#00"]));
116 $value2 = $cp2->getContent();
117 $this->assertTrue($value2->isError());
120 $value2 = $cp3->getContent();
121 $this->assertTrue($value2->isError());
◆ $name_source
The documentation for this class was generated from the following file: