◆ setGlobalVariable()
PCParagraphTest::setGlobalVariable |
( |
string |
$name, |
|
|
|
$value |
|
) |
| |
|
protected |
◆ setUp()
PCParagraphTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 25 of file PCParagraphTest.php.
References $dic, $GLOBALS, and setGlobalVariable().
30 if (!defined(
"COPAGE_TEST")) {
31 define(
"COPAGE_TEST",
"1");
35 $def_mock = $this->getMockBuilder(ilObjectDefinition::class)
36 ->disableOriginalConstructor()
40 ->method(
'getAllRepositoryTypes')
41 ->willReturn([
"crs",
"grp",
"cat"]);
setGlobalVariable(string $name, $value)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
◆ tearDown()
PCParagraphTest::tearDown |
( |
| ) |
|
|
protected |
◆ test_input2xmlEmpty()
PCParagraphTest::test_input2xmlEmpty |
( |
| ) |
|
Test _input2xml (empty)
Definition at line 55 of file PCParagraphTest.php.
References $res, and ilPCParagraph\_input2xml().
static _input2xml(string $a_text, string $a_lang, bool $a_wysiwyg=false, bool $a_handle_lists=true)
Converts user input to xml User input comes as bb code information, e.g.
◆ test_input2xmlResult()
PCParagraphTest::test_input2xmlResult |
( |
| ) |
|
Test _input2xml.
Definition at line 96 of file PCParagraphTest.php.
References $out, and ilPCParagraph\_input2xml().
105 'xx [str]xx[/str] xx' 106 =>
'xx <Strong>xx</Strong> xx',
107 'xx [com]xx[/com] xx' 108 =>
'xx <Comment>xx</Comment> xx',
109 'xx [emp]xx[/emp] xx' 110 =>
'xx <Emph>xx</Emph> xx',
112 =>
'xx <Footnote>xx</Footnote> xx',
113 'xx [code]xx[/code] xx' 114 =>
'xx <Code>xx</Code> xx',
115 'xx [acc]xx[/acc] xx' 116 =>
'xx <Accent>xx</Accent> xx',
117 'xx [imp]xx[/imp] xx' 118 =>
'xx <Important>xx</Important> xx',
120 =>
'xx <Keyw>xx</Keyw> xx',
121 'xx [sub]xx[/sub] xx' 122 =>
'xx <Sub>xx</Sub> xx',
123 'xx [sup]xx[/sup] xx' 124 =>
'xx <Sup>xx</Sup> xx',
125 'xx [quot]xx[/quot] xx' 126 =>
'xx <Quotation>xx</Quotation> xx',
129 'xx [iln cat="106"] xx [/iln] xx' 130 =>
'xx <IntLink Target="il__obj_106" Type="RepositoryItem"> xx </IntLink> xx',
131 'xx [iln page="106"] xx [/iln] xx' 132 =>
'xx <IntLink Target="il__pg_106" Type="PageObject"> xx </IntLink> xx',
133 'xx [iln page="106"] xx xx' 136 =>
'xx xx [/iln] xx',
137 'xx [iln chap="106"] xx [/iln] xx' 138 =>
'xx <IntLink Target="il__st_106" Type="StructureObject"> xx </IntLink> xx',
139 'xx [iln inst="123" page="106"] xx [/iln] xx' 140 =>
'xx <IntLink Target="il_123_pg_106" Type="PageObject"> xx </IntLink> xx',
141 'xx [iln page="106" target="FAQ"] xx [/iln] xx' 142 =>
'xx <IntLink Target="il__pg_106" Type="PageObject" TargetFrame="FAQ"> xx </IntLink> xx',
143 'xx [iln page="106" target="New" anchor="test"] xx [/iln] xx' 144 =>
'xx <IntLink Target="il__pg_106" Type="PageObject" TargetFrame="New" Anchor="test"> xx </IntLink> xx',
145 'xx [iln term="106"] xx [/iln] xx' 146 =>
'xx <IntLink Target="il__git_106" Type="GlossaryItem" TargetFrame="Glossary"> xx </IntLink> xx',
147 'xx [iln term="106" target="New"] xx [/iln] xx' 148 =>
'xx <IntLink Target="il__git_106" Type="GlossaryItem" TargetFrame="New"> xx </IntLink> xx',
149 'xx [iln wpage="106"] xx [/iln] xx' 150 =>
'xx <IntLink Target="il__wpage_106" Type="WikiPage"> xx </IntLink> xx',
151 'xx [iln wpage="106" anchor="test"] xx [/iln] xx' 152 =>
'xx <IntLink Target="il__wpage_106" Type="WikiPage" Anchor="test"> xx </IntLink> xx',
153 'xx [iln ppage="106"] xx [/iln] xx' 154 =>
'xx <IntLink Target="il__ppage_106" Type="PortfolioPage"> xx </IntLink> xx',
155 'xx [iln media="545"/] xx ' 156 =>
'xx <IntLink Target="il__mob_545" Type="MediaObject"/> xx',
157 'xx [iln media="108" target="New"] xx [/iln] xx' 158 =>
'xx <IntLink Target="il__mob_108" Type="MediaObject" TargetFrame="New"> xx </IntLink> xx',
159 'xx [iln media="108" target="Media"] xx [/iln] xx' 160 =>
'xx <IntLink Target="il__mob_108" Type="MediaObject" TargetFrame="Media"> xx </IntLink> xx',
161 'xx [iln dfile="546"] xx [/iln] xx' 162 =>
'xx <IntLink Target="il__dfile_546" Type="File"> xx </IntLink> xx',
165 'xx' . chr(13) . chr(10) .
'yy' 167 'xx' . chr(13) .
'yy' 169 'xx' . chr(10) .
'yy' 173 '<ul class="ilc_list_u_BulletedList"><li class="ilc_list_item_StandardListItem">aa</li><li class="ilc_list_item_StandardListItem">bb</li><li class="ilc_list_item_StandardListItem">cc</li></ul>' 174 =>
'<ul class="ilc_list_u_BulletedList"><li class="ilc_list_item_StandardListItem">aa</li><li class="ilc_list_item_StandardListItem">bb</li><li class="ilc_list_item_StandardListItem">cc</li></ul>',
177 'xx [xln url="http://"][/xln] xxxx' 179 'xx [xln url="http://ilias.de"]www[/xln] xxxx' 180 =>
'xx <ExtLink Href="http://ilias.de">www</ExtLink> xxxx',
181 'xx [xln url="http://ilias.php?x=1&y=2"]www[/xln] xxxx' 182 =>
'xx <ExtLink Href="http://ilias.php?x=1&y=2">www</ExtLink> xxxx',
183 'xx [xln url="http://ilias.de/my+document.pdf"]doc[/xln] xxxx' 184 =>
'xx <ExtLink Href="http://ilias.de/my+document.pdf">doc</ExtLink> xxxx',
187 'xx [anc name="test"]test[/anc] xxxx' 188 =>
'xx <Anchor Name="test">test</Anchor> xxxx',
191 'xx [marked class="test"]test[/marked] xxxx' 192 =>
'xx <Marked Class="test">test</Marked> xxxx',
201 foreach ($cases as $in => $expected) {
static _input2xml(string $a_text, string $a_lang, bool $a_wysiwyg=false, bool $a_handle_lists=true)
Converts user input to xml User input comes as bb code information, e.g.
◆ test_input2xmlValidXml()
PCParagraphTest::test_input2xmlValidXml |
( |
| ) |
|
Test _input2xml for validity.
Definition at line 67 of file PCParagraphTest.php.
References $res, and ilPCParagraph\_input2xml().
72 'xx [str]xx[/str] xx',
73 'xx [iln cat="106"] xx',
77 foreach ($cases as $case) {
79 $use_internal_errors = libxml_use_internal_errors(
true);
80 $sxe = simplexml_load_string(
"<?xml version='1.0'?><dummy>" . $text .
"</dummy>");
81 libxml_use_internal_errors($use_internal_errors);
static _input2xml(string $a_text, string $a_lang, bool $a_wysiwyg=false, bool $a_handle_lists=true)
Converts user input to xml User input comes as bb code information, e.g.
◆ testHandleAjaxContentPost()
PCParagraphTest::testHandleAjaxContentPost |
( |
| ) |
|
Test handleAjaxContentPost.
Definition at line 213 of file PCParagraphTest.php.
References $out, and ilPCParagraph\handleAjaxContentPost().
216 '<ul class="ilc_list_u_BulletedList"><li class="ilc_list_item_StandardListItem">aa</li><li class="ilc_list_item_StandardListItem">bb</li><li class="ilc_list_item_StandardListItem">cc</li></ul>' 217 =>
'<SimpleBulletList><SimpleListItem>aa</SimpleListItem><SimpleListItem>bb</SimpleListItem><SimpleListItem>cc</SimpleListItem></SimpleBulletList>' 220 foreach ($cases as $in => $expected) {
static handleAjaxContentPost(string $text)
Post input2xml handling of ajax content.
The documentation for this class was generated from the following file: