コード例 #1
0
 /**
  * Test for EZP-21986
  * Make sure the custom tag underline is transformed into a <u> tag
  *
  * @link https://jira.ez.no/browse/EZP-21986
  */
 public function testCustomUnderlineToU()
 {
     ezpINIHelper::setINISetting('content.ini', 'CustomTagSettings', 'AvailableCustomTags', array('underline'));
     ezpINIHelper::setINISetting('content.ini', 'CustomTagSettings', 'IsInline', array('underline' => 'true'));
     $xmlData = '<?xml version="1.0" encoding="utf-8"?>';
     $xmlData .= '<section xmlns:image="http://ez.no/namespaces/ezpublish3/image/"
         xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/"
         xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/">
         <paragraph>If I could <custom name="underline">sleep</custom> forever</paragraph>
     </section>';
     $folder = new ezpObject('folder', 2);
     $folder->name = 'The Dandy Warhols - Sleep';
     $folder->short_description = '';
     $oeHandler = new eZOEXMLInput($xmlData, false, $folder->short_description);
     $xhtml = $oeHandler->attribute('input_xml');
     self::assertEquals('&lt;p&gt;If I could &lt;u class=&quot;ezoeItemCustomTag underline&quot; type=&quot;custom&quot;&gt;sleep&lt;/u&gt; forever&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;', $xhtml);
     ezpINIHelper::restoreINISettings();
 }
コード例 #2
0
 /**
  * Test for issue #18220: non breaking spaces are wrongly encoded
  *
  * Check that utf8 non breaking spaces are correctly decoded to be use in
  * Online Editor.
  *
  * @group issue_18220
  * @link http://issues.ez.no/18220
  */
 public function testNonBreakingSpaceDecodingUtf8Encoding()
 {
     $xmlData = '<?xml version="1.0" encoding="utf-8"?>';
     $xmlData .= '<section xmlns:image="http://ez.no/namespaces/ezpublish3/image/" xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/" xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/">';
     $xmlData .= "<paragraph>French typography :</paragraph>";
     $xmlData .= "</section>";
     $folder = new ezpObject('folder', 2);
     $folder->name = 'Non breaking space decoding of utf8 encoding';
     $folder->short_description = '';
     $oeHandler = new eZOEXMLInput($xmlData, false, $folder->short_description);
     $xhtml = $oeHandler->attribute('input_xml');
     self::assertEquals('&lt;p&gt;French typography&amp;nbsp;:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;', $xhtml);
 }