◆ buildButtonFactory()
| MarkdownTest::buildButtonFactory |
( |
| ) |
|
|
protected |
◆ buildMinimalFieldFactory()
| MarkdownTest::buildMinimalFieldFactory |
( |
| ) |
|
|
protected |
◆ getGlyphStub()
| MarkdownTest::getGlyphStub |
( |
string |
$name | ) |
|
|
protected |
Definition at line 540 of file MarkdownTest.php.
Referenced by setUp().
542 $glyph = $this->createMock(Glyph::class);
543 $glyph->method(
'getCanonicalName')->willReturn($name);
545 $glyph->method(
'withUnavailableAction')->willReturnSelf();
◆ getMarkdownRendererMock()
| MarkdownTest::getMarkdownRendererMock |
( |
| ) |
|
|
protected |
◆ getRendererWithStubs()
| MarkdownTest::getRendererWithStubs |
( |
| ) |
|
|
protected |
Definition at line 465 of file MarkdownTest.php.
References ILIAS_UI_TestBase\getDefaultRenderer().
Referenced by testRender(), testRenderWithByline(), testRenderWithDisabled(), testRenderWithError(), testRenderWithLimits(), and testRenderWithRequired().
468 $this->view_control_mock,
469 $this->header_glyph_mock,
470 $this->italic_glyph_mock,
471 $this->bold_glyph_mock,
472 $this->link_glyph_mock,
473 $this->numberedlist_glyph_mock,
474 $this->bulledpoint_glyph_mock,
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
◆ getSymbolFactoryMock()
| MarkdownTest::getSymbolFactoryMock |
( |
| ) |
|
|
protected |
Definition at line 508 of file MarkdownTest.php.
Referenced by getUIFactory().
510 $glyph_factory = $this->createMock(GlyphFactory::class);
511 $glyph_factory->method(
'header')->willReturn($this->header_glyph_mock);
512 $glyph_factory->method(
'italic')->willReturn($this->italic_glyph_mock);
513 $glyph_factory->method(
'bold')->willReturn($this->bold_glyph_mock);
514 $glyph_factory->method(
'link')->willReturn($this->link_glyph_mock);
515 $glyph_factory->method(
'numberedlist')->willReturn($this->numberedlist_glyph_mock);
516 $glyph_factory->method(
'bulletlist')->willReturn($this->bulledpoint_glyph_mock);
518 $symbol_factory = $this->createMock(SymbolFactory::class);
519 $symbol_factory->method(
'glyph')->willReturn($glyph_factory);
521 return $symbol_factory;
◆ getUIFactory()
| MarkdownTest::getUIFactory |
( |
| ) |
|
◆ getViewControlFactoryMock()
| MarkdownTest::getViewControlFactoryMock |
( |
| ) |
|
|
protected |
◆ getViewControlModeStub()
| MarkdownTest::getViewControlModeStub |
( |
| ) |
|
|
protected |
Definition at line 532 of file MarkdownTest.php.
Referenced by getViewControlFactoryMock(), and setUp().
534 $view_control = $this->createMock(ViewControlMode::class);
535 $view_control->method(
'getCanonicalName')->willReturn(
'view_control_mode');
537 return $view_control;
◆ setUp()
◆ testRender()
| MarkdownTest::testRender |
( |
| ) |
|
Definition at line 124 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
126 $label =
'test_label';
128 $input = $this->factory->markdown($this->markdown_renderer, $label)->withNameFrom($this->name_source);
132 <div class=\"form-group row\"> 133 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 134 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 135 <div class=\"c-input-markdown\"> 136 <div class=\"c-input-markdown__controls\"> 138 <div class=\"c-input-markdown__actions\"> 139 <span data-action=\"insert-heading\"> 140 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_2\">header</button> 142 <span data-action=\"insert-link\"> 143 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_3\">link</button> 145 <span data-action=\"insert-bold\"> 146 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_4\">bold</button> 148 <span data-action=\"insert-italic\"> 149 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_5\">italic</button> 151 <span data-action=\"insert-bullet-points\"> 152 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_7\">bulletpoint</button> 154 <span data-action=\"insert-enumeration\"> 155 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_6\">numberedlist</button> 159 <div class=\"ui-input-textarea\"> 160 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\"></textarea> 162 <div class=\"c-input-markdown__preview hidden\"> 172 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderWithByline()
| MarkdownTest::testRenderWithByline |
( |
| ) |
|
Definition at line 175 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
177 $label =
'test_label';
178 $byline =
'test_byline';
180 $input = $this->factory->markdown(
181 $this->markdown_renderer,
184 )->withNameFrom($this->name_source);
188 <div class=\"form-group row\"> 189 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 190 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 191 <div class=\"c-input-markdown\"> 192 <div class=\"c-input-markdown__controls\"> 194 <div class=\"c-input-markdown__actions\"> 195 <span data-action=\"insert-heading\"> 196 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_2\">header</button> 198 <span data-action=\"insert-link\"> 199 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_3\">link</button> 201 <span data-action=\"insert-bold\"> 202 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_4\">bold</button> 204 <span data-action=\"insert-italic\"> 205 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_5\">italic</button> 207 <span data-action=\"insert-bullet-points\"> 208 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_7\">bulletpoint</button> 210 <span data-action=\"insert-enumeration\"> 211 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_6\">numberedlist</button> 215 <div class=\"ui-input-textarea\"> 216 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\"></textarea> 218 <div class=\"c-input-markdown__preview hidden\"> 221 <div class=\"help-block\">$byline</div> 229 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderWithDisabled()
| MarkdownTest::testRenderWithDisabled |
( |
| ) |
|
Definition at line 292 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
294 $label =
'test_label';
295 $byline =
'test_byline';
297 $input = $this->factory->markdown(
298 $this->markdown_renderer,
301 )->withDisabled(
true)->withNameFrom($this->name_source);
305 <div class=\"form-group row\"> 306 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 307 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 308 <div class=\"c-input-markdown\"> 309 <div class=\"c-input-markdown__controls\"> 311 <div class=\"c-input-markdown__actions\"> 312 <span data-action=\"insert-heading\"> 313 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">header</button> 315 <span data-action=\"insert-link\"> 316 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">link</button> 318 <span data-action=\"insert-bold\"> 319 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">bold</button> 321 <span data-action=\"insert-italic\"> 322 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">italic</button> 324 <span data-action=\"insert-bullet-points\"> 325 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">bulletpoint</button> 327 <span data-action=\"insert-enumeration\"> 328 <button class=\"btn btn-default\" data-action=\"#\" disabled=\"disabled\">numberedlist</button> 332 <div class=\"ui-input-textarea\"> 333 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\" disabled=\"disabled\"></textarea> 335 <div class=\"c-input-markdown__preview hidden\"> 338 <div class=\"help-block\">$byline</div> 346 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderWithError()
| MarkdownTest::testRenderWithError |
( |
| ) |
|
Definition at line 406 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
408 $label =
'test_label';
409 $byline =
'test_byline';
410 $error =
'test_error';
412 $input = $this->factory->markdown(
413 $this->markdown_renderer,
416 )->withError($error)->withNameFrom($this->name_source);
420 <div class=\"form-group row\"> 421 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 422 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 423 <div class=\"help-block alert alert-danger\" aria-describedby=\"id_1\" role=\"alert\">$error</div> 424 <div class=\"c-input-markdown\"> 425 <div class=\"c-input-markdown__controls\"> 427 <div class=\"c-input-markdown__actions\"> 428 <span data-action=\"insert-heading\"> 429 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_2\">header</button> 431 <span data-action=\"insert-link\"> 432 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_3\">link</button> 434 <span data-action=\"insert-bold\"> 435 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_4\">bold</button> 437 <span data-action=\"insert-italic\"> 438 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_5\">italic</button> 440 <span data-action=\"insert-bullet-points\"> 441 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_7\">bulletpoint</button> 443 <span data-action=\"insert-enumeration\"> 444 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_6\">numberedlist</button> 448 <div class=\"ui-input-textarea\"> 449 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\"></textarea> 451 <div class=\"c-input-markdown__preview hidden\"> 454 <div class=\"help-block\">$byline</div> 462 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderWithLimits()
| MarkdownTest::testRenderWithLimits |
( |
| ) |
|
Definition at line 232 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
234 $label =
'test_label';
235 $byline =
'test_byline';
239 $input = $this->factory->markdown(
240 $this->markdown_renderer,
243 )->withMinLimit($min)->withMaxLimit($max)->withNameFrom($this->name_source);
247 <div class=\"form-group row\"> 248 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label</label> 249 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 250 <div class=\"c-input-markdown\"> 251 <div class=\"c-input-markdown__controls\"> 253 <div class=\"c-input-markdown__actions\"> 254 <span data-action=\"insert-heading\"> 255 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_2\">header</button> 257 <span data-action=\"insert-link\"> 258 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_3\">link</button> 260 <span data-action=\"insert-bold\"> 261 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_4\">bold</button> 263 <span data-action=\"insert-italic\"> 264 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_5\">italic</button> 266 <span data-action=\"insert-bullet-points\"> 267 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_7\">bulletpoint</button> 269 <span data-action=\"insert-enumeration\"> 270 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_6\">numberedlist</button> 274 <div class=\"ui-input-textarea\"> 275 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\" minlength=\"$min\" maxlength=\"$max\"></textarea> 276 <div class=\"ui-input-textarea-remainder\"> ui_chars_remaining<span data-action=\"remainder\">$max</span></div> 278 <div class=\"c-input-markdown__preview hidden\"> 281 <div class=\"help-block\">$byline</div> 289 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderWithRequired()
| MarkdownTest::testRenderWithRequired |
( |
| ) |
|
Definition at line 349 of file MarkdownTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), and getRendererWithStubs().
351 $label =
'test_label';
352 $byline =
'test_byline';
354 $input = $this->factory->markdown(
355 $this->markdown_renderer,
358 )->withRequired(
true)->withNameFrom($this->name_source);
362 <div class=\"form-group row\"> 363 <label for=\"id_1\" class=\"control-label col-sm-4 col-md-3 col-lg-2\">$label<span class=\"asterisk\">*</span></label> 364 <div class=\"col-sm-8 col-md-9 col-lg-10\"> 365 <div class=\"c-input-markdown\"> 366 <div class=\"c-input-markdown__controls\"> 368 <div class=\"c-input-markdown__actions\"> 369 <span data-action=\"insert-heading\"> 370 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_2\">header</button> 372 <span data-action=\"insert-link\"> 373 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_3\">link</button> 375 <span data-action=\"insert-bold\"> 376 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_4\">bold</button> 378 <span data-action=\"insert-italic\"> 379 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_5\">italic</button> 381 <span data-action=\"insert-bullet-points\"> 382 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_7\">bulletpoint</button> 384 <span data-action=\"insert-enumeration\"> 385 <button class=\"btn btn-default\" data-action=\"#\" id=\"id_6\">numberedlist</button> 389 <div class=\"ui-input-textarea\"> 390 <textarea id=\"id_1\" class=\"form-control form-control-sm\" name=\"name_0\"></textarea> 392 <div class=\"c-input-markdown__preview hidden\"> 395 <div class=\"help-block\">$byline</div> 403 $this->assertEquals($expected, $html);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ $bold_glyph_mock
| Glyph MarkdownTest::$bold_glyph_mock |
|
protected |
◆ $bulledpoint_glyph_mock
| Glyph MarkdownTest::$bulledpoint_glyph_mock |
|
protected |
◆ $factory
| FieldFactory MarkdownTest::$factory |
|
protected |
◆ $header_glyph_mock
| Glyph MarkdownTest::$header_glyph_mock |
|
protected |
◆ $italic_glyph_mock
| Glyph MarkdownTest::$italic_glyph_mock |
|
protected |
◆ $link_glyph_mock
| Glyph MarkdownTest::$link_glyph_mock |
|
protected |
◆ $markdown_renderer
◆ $name_source
◆ $numberedlist_glyph_mock
| Glyph MarkdownTest::$numberedlist_glyph_mock |
|
protected |
◆ $view_control_mock
| ViewControlMode MarkdownTest::$view_control_mock |
|
protected |
◆ TEST_ASYNC_URL
| const MarkdownTest::TEST_ASYNC_URL = 'https://localhost' |
|
protected |
◆ TEST_PARAMETER_NAME
| const MarkdownTest::TEST_PARAMETER_NAME = 'preview' |
|
protected |
The documentation for this class was generated from the following file: