ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
SimpleDocumentMarkdownShapeTest Class Reference
+ Inheritance diagram for SimpleDocumentMarkdownShapeTest:
+ Collaboration diagram for SimpleDocumentMarkdownShapeTest:

Public Member Functions

 testGetSupportedStructure (Structure $dp_bold, Structure $dp_italic, Structure $dp_heading_1, Structure $dp_heading_2, Structure $dp_heading_3, Structure $dp_heading_4, Structure $dp_heading_5, Structure $dp_heading_6, Structure $dp_unordered_list, Structure $dp_ordered_list, Structure $dp_paragraph, Structure $dp_link, Structure $dp_blockquote, Structure $dp_code)
 
 testIsRawStringCompliant (string $markdown_string, bool $compliance)
 

Static Public Member Functions

static constructDataProvider ()
 
static stringComplianceDataProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

SimpleDocumentMarkdown $simple_doc_markdown_shape
 

Detailed Description

Definition at line 28 of file SimpleDocumentMarkdownShapeTest.php.

Member Function Documentation

◆ constructDataProvider()

static SimpleDocumentMarkdownShapeTest::constructDataProvider ( )
static

Definition at line 40 of file SimpleDocumentMarkdownShapeTest.php.

References ILIAS\Data\Text\CODE.

40  : array
41  {
42  return [
43  [
44  Structure::BOLD,
45  Structure::ITALIC,
46  Structure::HEADING_1,
47  Structure::HEADING_2,
48  Structure::HEADING_3,
49  Structure::HEADING_4,
50  Structure::HEADING_5,
51  Structure::HEADING_6,
52  Structure::UNORDERED_LIST,
53  Structure::ORDERED_LIST,
54  Structure::PARAGRAPH,
55  Structure::LINK,
56  Structure::BLOCKQUOTE,
58  ]
59  ];
60  }

◆ setUp()

SimpleDocumentMarkdownShapeTest::setUp ( )
protected

Definition at line 32 of file SimpleDocumentMarkdownShapeTest.php.

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

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

◆ stringComplianceDataProvider()

static SimpleDocumentMarkdownShapeTest::stringComplianceDataProvider ( )
static

Definition at line 62 of file SimpleDocumentMarkdownShapeTest.php.

62  : array
63  {
64  return [
65  ["### Heading 3", true],
66  ["> Quote block", true],
67  ["![Image text](https://www.ilias.de)", false]
68  ];
69  }

◆ testGetSupportedStructure()

SimpleDocumentMarkdownShapeTest::testGetSupportedStructure ( Structure  $dp_bold,
Structure  $dp_italic,
Structure  $dp_heading_1,
Structure  $dp_heading_2,
Structure  $dp_heading_3,
Structure  $dp_heading_4,
Structure  $dp_heading_5,
Structure  $dp_heading_6,
Structure  $dp_unordered_list,
Structure  $dp_ordered_list,
Structure  $dp_paragraph,
Structure  $dp_link,
Structure  $dp_blockquote,
Structure  $dp_code 
)

Definition at line 72 of file SimpleDocumentMarkdownShapeTest.php.

87  : void {
88  $supported_structure = $this->simple_doc_markdown_shape->getSupportedStructure();
89 
90  $expected = [
91  $dp_bold,
92  $dp_italic,
93  $dp_heading_1,
94  $dp_heading_2,
95  $dp_heading_3,
96  $dp_heading_4,
97  $dp_heading_5,
98  $dp_heading_6,
99  $dp_unordered_list,
100  $dp_ordered_list,
101  $dp_paragraph,
102  $dp_link,
103  $dp_blockquote,
104  $dp_code
105  ];
106 
107  $this->assertEquals($expected, $supported_structure);
108  }

◆ testIsRawStringCompliant()

SimpleDocumentMarkdownShapeTest::testIsRawStringCompliant ( string  $markdown_string,
bool  $compliance 
)

Definition at line 111 of file SimpleDocumentMarkdownShapeTest.php.

111  : void
112  {
113  $this->assertEquals($this->simple_doc_markdown_shape->isRawStringCompliant($markdown_string), $compliance);
114  }

Field Documentation

◆ $simple_doc_markdown_shape

SimpleDocumentMarkdown SimpleDocumentMarkdownShapeTest::$simple_doc_markdown_shape
protected

Definition at line 30 of file SimpleDocumentMarkdownShapeTest.php.


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