Definition at line 32 of file TextInputTest.php.
◆ setUp()
◆ testCommonRendering()
| TextInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 69 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
71 $f = $this->getFieldFactory();
73 $text =
$f->text($label)->withNameFrom($this->name_source);
75 $this->testWithError(
$text);
76 $this->testWithNoByline(
$text);
77 $this->testWithRequired(
$text);
78 $this->testWithDisabled(
$text);
79 $this->testWithAdditionalOnloadCodeRendersId(
$text);
◆ testImplementsFactoryInterface()
| TextInputTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 43 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
45 $f = $this->getFieldFactory();
47 $text =
$f->text(
"label",
"byline");
50 $this->assertInstanceOf(Field\Text::class,
$text);
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...
◆ testMaxLength()
| TextInputTest::testMaxLength |
( |
| ) |
|
Definition at line 98 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
100 $f = $this->getFieldFactory();
105 $this->assertEquals(4,
$text->getMaxLength());
107 $text1 =
$text->withValue(
"1234");
108 $this->assertEquals(
"1234", $text1->getValue());
110 $this->expectException(InvalidArgumentException::class);
111 $this->expectExceptionMessage(
"Argument 'value': Display value does not match input type.");
112 $text->withValue(
"12345");
◆ testRender()
| TextInputTest::testRender |
( |
| ) |
|
Definition at line 53 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
55 $f = $this->getFieldFactory();
58 $text =
$f->text($label, $byline)->withNameFrom($this->name_source);
59 $expected = $this->getFormWrappedHtml(
62 '<input id="id_1" type="text" name="name_0" class="c-field-text" />',
66 $this->assertEquals($expected, $this->render(
$text));
◆ testRenderMaxValue()
| TextInputTest::testRenderMaxValue |
( |
| ) |
|
Definition at line 115 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
117 $f = $this->getFieldFactory();
119 $text =
$f->text($label)->withNameFrom($this->name_source)->withMaxLength(8);
120 $expected = $this->getFormWrappedHtml(
123 '<input id="id_1" type="text" name="name_0" maxlength="8" class="c-field-text" />',
127 $this->assertEquals($expected, $this->render(
$text));
◆ testRenderValue()
| TextInputTest::testRenderValue |
( |
| ) |
|
Definition at line 82 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
84 $f = $this->getFieldFactory();
87 $text =
$f->text($label)->withValue($value)->withNameFrom($this->name_source);
88 $expected = $this->getFormWrappedHtml(
91 '<input id="id_1" type="text" value="value" name="name_0" class="c-field-text" />',
95 $this->assertEquals($expected, $this->render(
$text));
◆ testStripsTags()
| TextInputTest::testStripsTags |
( |
| ) |
|
Definition at line 147 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
149 $f = $this->getFieldFactory();
152 ->withNameFrom($this->name_source)
153 ->withInput(
new DefInputData([$name =>
"<script>alert()</script>"]));
155 $content =
$text->getContent();
156 $this->assertEquals(
"alert()", $content->value());
◆ testValueRequired()
| TextInputTest::testValueRequired |
( |
| ) |
|
Definition at line 130 of file TextInputTest.php.
References Vendor\Package\$f, and $text.
132 $f = $this->getFieldFactory();
135 $text =
$f->text($label)->withNameFrom($this->name_source)->withRequired(
true);
138 $value1 = $text1->getContent();
139 $this->assertTrue($value1->isOk());
140 $this->assertEquals(
"0", $value1->value());
143 $value2 = $text2->getContent();
144 $this->assertTrue($value2->isError());
◆ $name_source
The documentation for this class was generated from the following file: