Class TagInputTest.
More...
◆ setUp()
◆ testCommonRendering()
| TagInputTest::testCommonRendering |
( |
| ) |
|
Definition at line 83 of file TagInputTest.php.
References Vendor\Package\$e, and Vendor\Package\$f.
85 $f = $this->getFieldFactory();
86 $tag =
$f->tag(
'label', [], null)->withNameFrom($this->name_source);
88 $this->testWithError($tag);
89 $this->testWithNoByline($tag);
90 $this->testWithRequired($tag);
91 $this->testWithDisabled($tag);
92 $this->testWithAdditionalOnloadCodeRendersId($tag);
◆ testImplementsFactoryInterface()
| TagInputTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testMaxTaglengthTagsNotOk()
| TagInputTest::testMaxTaglengthTagsNotOk |
( |
| ) |
|
Definition at line 225 of file TagInputTest.php.
References Vendor\Package\$f.
227 $f = $this->getFieldFactory();
229 $this->expectException(InvalidArgumentException::class);
230 $f->tag(
"label", [])->withTagMaxLength(2)->withNameFrom($this->name_source)->withInput(
232 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testMaxTaglengthTagsOk()
| TagInputTest::testMaxTaglengthTagsOk |
( |
| ) |
|
Definition at line 214 of file TagInputTest.php.
References Vendor\Package\$f.
216 $f = $this->getFieldFactory();
218 $tag =
$f->tag(
"label", [])->withTagMaxLength(10)->withNameFrom($this->name_source)->withInput(
221 $value = $tag->getContent();
222 $this->assertTrue($value->isOk());
◆ testMaxTagsNotOk()
| TagInputTest::testMaxTagsNotOk |
( |
| ) |
|
Definition at line 202 of file TagInputTest.php.
References Vendor\Package\$f.
204 $f = $this->getFieldFactory();
206 $this->expectException(InvalidArgumentException::class);
207 $f->tag(
"label", [])->withMaxTags(2)->withNameFrom($this->name_source)->withInput(
209 [
"name_0" =>
"lorem,ipsum,dolor"]
◆ testMaxTagsOk()
| TagInputTest::testMaxTagsOk |
( |
| ) |
|
Definition at line 191 of file TagInputTest.php.
References Vendor\Package\$f.
193 $f = $this->getFieldFactory();
195 $tag =
$f->tag(
"label", [])->withMaxTags(3)->withNameFrom($this->name_source)->withInput(
198 $value = $tag->getContent();
199 $this->assertTrue($value->isOk());
◆ testNullValueLeadsToException()
| TagInputTest::testNullValueLeadsToException |
( |
| ) |
|
Definition at line 148 of file TagInputTest.php.
References Vendor\Package\$f.
150 $f = $this->getFieldFactory();
153 $tags = [
"lorem",
"ipsum",
"dolor",];
155 $tag =
$f->tag($label, $tags)->withNameFrom($this->name_source)->withRequired(
true);
156 $tag2 = $tag->withInput(
new DefInputData([$name => null]));
157 $value2 = $tag2->getContent();
158 $this->assertTrue($value2->isError());
◆ testRender()
| TagInputTest::testRender |
( |
| ) |
|
Definition at line 61 of file TagInputTest.php.
References Vendor\Package\$f.
63 $f = $this->getFieldFactory();
66 $tags = [
"lorem",
"ipsum",
"dolor",];
67 $tag =
$f->tag($label, $tags, $byline)->withNameFrom($this->name_source);
68 $expected = $this->getFormWrappedHtml(
72 <div class="c-field-tag__wrapper"> 73 <input id="id_1" name="name_0" class="c-field-tag" value=""/> 80 $this->assertEquals($expected, $this->render($tag));
◆ testUserCreatedNotAllowed()
| TagInputTest::testUserCreatedNotAllowed |
( |
| ) |
|
Definition at line 161 of file TagInputTest.php.
References Vendor\Package\$f.
163 $this->markTestSkipped(
"This is supposed to work, but currently does not.");
165 $f = $this->getFieldFactory();
166 $tags = [
"lorem",
"ipsum",
"dolor",];
167 $tag =
$f->tag(
"label", $tags)->withUserCreatedTagsAllowed(
false)->withNameFrom($this->name_source);
169 $tag1 = $tag->withInput(
171 [
"name_0" =>
"lorem,ipsum"]
174 $value1 = $tag1->getContent();
175 $this->assertTrue($value1->isOk());
176 $value = $value1->value();
182 $tag1 = $tag->withInput(
184 [
"name_0" =>
"conseptetuer,ipsum"]
187 $value1 = $tag1->getContent();
188 $this->assertTrue($value1->isError());
◆ $name_source
The documentation for this class was generated from the following file: