ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 constructDataProvider More...
 
 testIsRawStringCompliant (string $markdown_string, bool $compliance)
 stringComplianceDataProvider More...
 

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 
)

constructDataProvider

Definition at line 74 of file SimpleDocumentMarkdownShapeTest.php.

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

◆ testIsRawStringCompliant()

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

stringComplianceDataProvider

Definition at line 115 of file SimpleDocumentMarkdownShapeTest.php.

115  : void
116  {
117  $this->assertEquals($this->simple_doc_markdown_shape->isRawStringCompliant($markdown_string), $compliance);
118  }

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: