ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
MarkdownShapeTest Class Reference
+ Inheritance diagram for MarkdownShapeTest:
+ Collaboration diagram for MarkdownShapeTest:

Public Member Functions

 testToHTML (string $markdown_string, HTML $expected_html)
 stringToHTMLDataProvider More...
 
 testToPlainText (string $markdown_string, PlainText $expected_text)
 stringToPlainDataProvider More...
 

Static Public Member Functions

static stringToHTMLDataProvider ()
 
static stringToPlainDataProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

Markdown $markdown_shape
 

Detailed Description

Definition at line 27 of file MarkdownShapeTest.php.

Member Function Documentation

◆ setUp()

MarkdownShapeTest::setUp ( )
protected

Definition at line 31 of file MarkdownShapeTest.php.

References ILIAS\UI\examples\Layout\Page\Standard\$refinery.

31  : void
32  {
33  $language = $this->createMock(ilLanguage::class);
34  $data_factory = new Data\Factory();
35  $refinery = new ILIAS\Refinery\Factory($data_factory, $language);
36  $this->markdown_shape = new Markdown(new \ILIAS\Refinery\String\MarkdownFormattingToHTML());
37  }
Interface Observer Contains several chained tasks and infos about them.

◆ stringToHTMLDataProvider()

static MarkdownShapeTest::stringToHTMLDataProvider ( )
static

Definition at line 39 of file MarkdownShapeTest.php.

39  : array
40  {
41  return [
42  ["lorem", new HTML("<p>lorem</p>\n")],
43  ["lorem **ipsum**", new HTML("<p>lorem <strong>ipsum</strong></p>\n")],
44  ["_lorem_ **ipsum**", new HTML("<p><em>lorem</em> <strong>ipsum</strong></p>\n")],
45  ["# Headline", new HTML("<h1>Headline</h1>\n")],
46  ["## Headline", new HTML("<h2>Headline</h2>\n")],
47  ["### Headline", new HTML("<h3>Headline</h3>\n")],
48  ["1. Lorem\n2. Ipsum", new HTML("<ol>\n<li>Lorem</li>\n<li>Ipsum</li>\n</ol>\n")],
49  ["- Lorem\n- Ipsum", new HTML("<ul>\n<li>Lorem</li>\n<li>Ipsum</li>\n</ul>\n")],
50  ["[Link Titel](https://www.ilias.de)", new HTML("<p><a href=\"https://www.ilias.de\">Link Titel</a></p>\n")]
51  ];
52  }
This class currently is a stub only.
Definition: HTML.php:27

◆ stringToPlainDataProvider()

static MarkdownShapeTest::stringToPlainDataProvider ( )
static

Definition at line 54 of file MarkdownShapeTest.php.

54  : array
55  {
56  return [
57  ["lorem", new PlainText("lorem")],
58  ["lorem **ipsum**", new PlainText("lorem **ipsum**")],
59  ["_lorem_ **ipsum**", new PlainText("_lorem_ **ipsum**")],
60  ["# Headline", new PlainText("# Headline")],
61  ["## Headline", new PlainText("## Headline")],
62  ["### Headline", new PlainText("### Headline")],
63  ["1. Lorem\n2. Ipsum", new PlainText("1. Lorem\n2. Ipsum")],
64  ["- Lorem\n- Ipsum", new PlainText("- Lorem\n- Ipsum")],
65  ["[Link Titel](https://www.ilias.de)", new PlainText("[Link Titel](https://www.ilias.de)")]
66  ];
67  }
This class currently is a stub only.
Definition: PlainText.php:27

◆ testToHTML()

MarkdownShapeTest::testToHTML ( string  $markdown_string,
HTML  $expected_html 
)

stringToHTMLDataProvider

Definition at line 72 of file MarkdownShapeTest.php.

72  : void
73  {
74  $text = $this->markdown_shape->fromString($markdown_string);
75  $this->assertEquals($expected_html, $this->markdown_shape->toHTML($text));
76  }

◆ testToPlainText()

MarkdownShapeTest::testToPlainText ( string  $markdown_string,
PlainText  $expected_text 
)

stringToPlainDataProvider

Definition at line 81 of file MarkdownShapeTest.php.

81  : void
82  {
83  $text = $this->markdown_shape->fromString($markdown_string);
84  $this->assertEquals($expected_text, $this->markdown_shape->toPlainText($text));
85  }

Field Documentation

◆ $markdown_shape

Markdown MarkdownShapeTest::$markdown_shape
protected

Definition at line 29 of file MarkdownShapeTest.php.


The documentation for this class was generated from the following file: