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

Public Member Functions

 testGetSupportedStructure (Structure $dp_bold, Structure $dp_italic)
 
 testIsRawStringCompliant (string $markdown_string, bool $compliance)
 

Static Public Member Functions

static constructDataProvider ()
 
static stringComplianceDataProvider ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

WordOnlyMarkdown $word_only_markdown_shape
 

Detailed Description

Definition at line 28 of file WordOnlyMarkdownShapeTest.php.

Member Function Documentation

◆ constructDataProvider()

static WordOnlyMarkdownShapeTest::constructDataProvider ( )
static

Definition at line 41 of file WordOnlyMarkdownShapeTest.php.

41  : array
42  {
43  return [
44  [Structure::BOLD, Structure::ITALIC]
45  ];
46  }

◆ setUp()

WordOnlyMarkdownShapeTest::setUp ( )
protected

Definition at line 32 of file WordOnlyMarkdownShapeTest.php.

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

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

◆ stringComplianceDataProvider()

static WordOnlyMarkdownShapeTest::stringComplianceDataProvider ( )
static

Definition at line 48 of file WordOnlyMarkdownShapeTest.php.

48  : array
49  {
50  return [
51  ["This text has **bold** and _italic_ content", true],
52  ["> Quote block is not allowed", false],
53  ["Paragraphs\n\nare not allowed.", false],
54  ["Line breaks\\\nare not allowed.", false],
55  ["Also these \nline breaks are not allowed.", false]
56  ];
57  }

◆ testGetSupportedStructure()

WordOnlyMarkdownShapeTest::testGetSupportedStructure ( Structure  $dp_bold,
Structure  $dp_italic 
)

Definition at line 60 of file WordOnlyMarkdownShapeTest.php.

60  : void
61  {
62  $supported_structure = $this->word_only_markdown_shape->getSupportedStructure();
63  $exptected = [
64  $dp_bold,
65  $dp_italic
66  ];
67 
68  $this->assertEquals($exptected, $supported_structure);
69  }

◆ testIsRawStringCompliant()

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

Definition at line 72 of file WordOnlyMarkdownShapeTest.php.

72  : void
73  {
74  $this->assertEquals($compliance, $this->word_only_markdown_shape->isRawStringCompliant($markdown_string));
75  }

Field Documentation

◆ $word_only_markdown_shape

WordOnlyMarkdown WordOnlyMarkdownShapeTest::$word_only_markdown_shape
protected

Definition at line 30 of file WordOnlyMarkdownShapeTest.php.


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