/** * 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('<p>If I could <u class="ezoeItemCustomTag underline" type="custom">sleep</u> forever</p><p><br /></p>', $xhtml); ezpINIHelper::restoreINISettings(); }
/** * 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('<p>French typography&nbsp;:</p><p><br /></p>', $xhtml); }