Class TagInputTest.
More...
◆ setUp()
◆ testCommonRendering()
TagInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 81 of file TagInputTest.php.
References Vendor\Package\$e, Vendor\Package\$f, and null.
83 $f = $this->getFieldFactory();
84 $tag =
$f->tag(
'label', [],
null)->withNameFrom($this->name_source);
86 $this->testWithError($tag);
87 $this->testWithNoByline($tag);
88 $this->testWithRequired($tag);
89 $this->testWithDisabled($tag);
90 $this->testWithAdditionalOnloadCodeRendersId($tag);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testImplementsFactoryInterface()
TagInputTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testMaxTaglengthTagsNotOk()
TagInputTest::testMaxTaglengthTagsNotOk |
( |
| ) |
|
Definition at line 223 of file TagInputTest.php.
References Vendor\Package\$f.
225 $f = $this->getFieldFactory();
227 $this->expectException(InvalidArgumentException::class);
228 $f->tag(
"label", [])->withTagMaxLength(2)->withNameFrom($this->name_source)->withInput(
230 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testMaxTaglengthTagsOk()
TagInputTest::testMaxTaglengthTagsOk |
( |
| ) |
|
Definition at line 212 of file TagInputTest.php.
References Vendor\Package\$f.
214 $f = $this->getFieldFactory();
216 $tag =
$f->tag(
"label", [])->withTagMaxLength(10)->withNameFrom($this->name_source)->withInput(
219 $value = $tag->getContent();
220 $this->assertTrue($value->isOk());
◆ testMaxTagsNotOk()
TagInputTest::testMaxTagsNotOk |
( |
| ) |
|
Definition at line 200 of file TagInputTest.php.
References Vendor\Package\$f.
202 $f = $this->getFieldFactory();
204 $this->expectException(InvalidArgumentException::class);
205 $f->tag(
"label", [])->withMaxTags(2)->withNameFrom($this->name_source)->withInput(
207 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testMaxTagsOk()
TagInputTest::testMaxTagsOk |
( |
| ) |
|
Definition at line 189 of file TagInputTest.php.
References Vendor\Package\$f.
191 $f = $this->getFieldFactory();
193 $tag =
$f->tag(
"label", [])->withMaxTags(3)->withNameFrom($this->name_source)->withInput(
196 $value = $tag->getContent();
197 $this->assertTrue($value->isOk());
◆ testNullValueLeadsToException()
TagInputTest::testNullValueLeadsToException |
( |
| ) |
|
Definition at line 146 of file TagInputTest.php.
References Vendor\Package\$f, and null.
148 $f = $this->getFieldFactory();
151 $tags = [
"lorem",
"ipsum",
"dolor",];
153 $tag =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
155 $value2 = $tag2->getContent();
156 $this->assertTrue($value2->isError());
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testRender()
TagInputTest::testRender |
( |
| ) |
|
Definition at line 59 of file TagInputTest.php.
References Vendor\Package\$f.
61 $f = $this->getFieldFactory();
64 $tags = [
"lorem",
"ipsum",
"dolor",];
65 $tag =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source);
66 $expected = $this->getFormWrappedHtml(
70 <div class="c-field-tag__wrapper"> 71 <input id="id_1" name="name_0" class="c-field-tag" value=""/> 78 $this->assertEquals($expected, $this->render($tag));
◆ testUserCreatedNotAllowed()
TagInputTest::testUserCreatedNotAllowed |
( |
| ) |
|
Definition at line 159 of file TagInputTest.php.
References Vendor\Package\$f.
161 $this->markTestSkipped(
"This is supposed to work, but currently does not.");
163 $f = $this->getFieldFactory();
164 $tags = [
"lorem",
"ipsum",
"dolor",];
165 $tag =
$f->tag(
"label", $tags)->withUserCreatedTagsAllowed(
false)->withNameFrom($this->name_source);
167 $tag1 = $tag->withInput(
169 [
"name_0" =>
"lorem,ipsum"]
172 $value1 = $tag1->getContent();
173 $this->assertTrue($value1->isOk());
174 $value = $value1->value();
180 $tag1 = $tag->withInput(
182 [
"name_0" =>
"conseptetuer,ipsum"]
185 $value1 = $tag1->getContent();
186 $this->assertTrue($value1->isError());
◆ $name_source
The documentation for this class was generated from the following file: