diff --git a/bundle/Command/ConvertXmlTextToRichTextCommand.php b/bundle/Command/ConvertXmlTextToRichTextCommand.php
index 895deea2..be3600bd 100644
--- a/bundle/Command/ConvertXmlTextToRichTextCommand.php
+++ b/bundle/Command/ConvertXmlTextToRichTextCommand.php
@@ -5,8 +5,6 @@
namespace EzSystems\EzPlatformXmlTextFieldTypeBundle\Command;
use DOMDocument;
-use DOMXPath;
-use eZ\Publish\Core\FieldType\RichText\Converter;
use eZ\Publish\Core\Persistence\Database\DatabaseHandler;
use PDO;
use Psr\Log\LoggerInterface;
@@ -14,13 +12,8 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use eZ\Publish\Core\FieldType\RichText\Converter\Aggregate;
-use eZ\Publish\Core\FieldType\XmlText\Converter\Expanding;
-use eZ\Publish\Core\FieldType\RichText\Converter\Ezxml\ToRichTextPreNormalize;
-use eZ\Publish\Core\FieldType\XmlText\Converter\EmbedLinking;
-use eZ\Publish\Core\FieldType\RichText\Converter\Xslt;
-use eZ\Publish\Core\FieldType\RichText\Validator;
use eZ\Publish\Core\FieldType\XmlText\Value;
+use eZ\Publish\Core\FieldType\XmlText\Converter\RichText as RichTextConverter;
class ConvertXmlTextToRichTextCommand extends ContainerAwareCommand
{
@@ -29,16 +22,6 @@ class ConvertXmlTextToRichTextCommand extends ContainerAwareCommand
*/
private $db;
- /**
- * @var \eZ\Publish\Core\FieldType\RichText\Converter
- */
- private $converter;
-
- /**
- * @var \eZ\Publish\Core\FieldType\RichText\Validator
- */
- private $validator;
-
/**
* @var \Psr\Log\LoggerInterface
*/
@@ -50,28 +33,6 @@ public function __construct(DatabaseHandler $db, LoggerInterface $logger = null)
$this->db = $db;
$this->logger = $logger;
-
- $this->converter = new Aggregate(
- array(
- new ToRichTextPreNormalize(new Expanding(), new EmbedLinking()),
- new Xslt(
- './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/stylesheets/ezxml/docbook/docbook.xsl',
- array(
- array(
- 'path' => './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/stylesheets/ezxml/docbook/core.xsl',
- 'priority' => 99,
- ),
- )
- ),
- )
- );
-
- $this->validator = new Validator(
- array(
- './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/ezpublish.rng',
- './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl',
- )
- );
}
protected function configure()
@@ -92,6 +53,12 @@ protected function configure()
InputOption::VALUE_NONE,
'Run the converter without writing anything to the database'
)
+ ->addOption(
+ 'disable-duplicate-id-check',
+ null,
+ InputOption::VALUE_NONE,
+ 'Disable the check for duplicate html ids in every attribute. This might increase execution time on large databases'
+ )
->addOption(
'test-content-object',
null,
@@ -115,10 +82,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$dryRun = true;
}
- $this->convertFields($dryRun, $testContentObjectId, $output);
+ $this->convertFields($dryRun, $testContentObjectId, !$input->getOption('disable-duplicate-id-check'), $output);
}
- function convertFieldDefinitions($dryRun, OutputInterface $output)
+ protected function convertFieldDefinitions($dryRun, OutputInterface $output)
{
$query = $this->db->createSelectQuery();
$query->select($query->expr->count('*'));
@@ -174,8 +141,9 @@ function convertFieldDefinitions($dryRun, OutputInterface $output)
$output->writeln("Converted $count ezxmltext field definitions to ezrichtext");
}
- function convertFields($dryRun, $contentObjectId, OutputInterface $output)
+ protected function convertFields($dryRun, $contentObjectId, $checkDuplicateIds, OutputInterface $output)
{
+ $converter = new RichTextConverter($this->logger);
$query = $this->db->createSelectQuery();
$query->select($query->expr->count('*'));
$query->from('ezcontentobject_attribute');
@@ -238,7 +206,7 @@ function convertFields($dryRun, $contentObjectId, OutputInterface $output)
$inputValue = $row['data_text'];
}
- $converted = $this->convert($inputValue);
+ $converted = $converter->convert($this->createDocument($inputValue), $checkDuplicateIds, $row['id']);
$updateQuery = $this->db->createUpdateQuery();
$updateQuery->update($this->db->quoteIdentifier('ezcontentobject_attribute'));
@@ -279,7 +247,7 @@ function convertFields($dryRun, $contentObjectId, OutputInterface $output)
$output->writeln("Converted $count ezxmltext fields to richtext");
}
- function createDocument($xmlString)
+ protected function createDocument($xmlString)
{
$document = new DOMDocument();
@@ -290,40 +258,4 @@ function createDocument($xmlString)
return $document;
}
-
- function removeComments(DOMDocument $document)
- {
- $xpath = new DOMXpath($document);
- $nodes = $xpath->query('//comment()');
-
- for ($i = 0; $i < $nodes->length; ++$i) {
- $nodes->item($i)->parentNode->removeChild($nodes->item($i));
- }
- }
-
- function convert($xmlString)
- {
- $inputDocument = $this->createDocument($xmlString);
-
- $this->removeComments($inputDocument);
-
- $convertedDocument = $this->converter->convert($inputDocument);
-
- // Needed by some disabled output escaping (eg. legacy ezxml paragraph elements)
- $convertedDocumentNormalized = new DOMDocument();
- $convertedDocumentNormalized->loadXML($convertedDocument->saveXML());
-
- $errors = $this->validator->validate($convertedDocument);
-
- $result = $convertedDocumentNormalized->saveXML();
-
- if (!empty($errors)) {
- $this->logger->error(
- "Validation errors when converting xmlstring",
- ['result' => $result, 'errors' => $errors, 'xmlString' => $xmlString]
- );
- }
-
- return $result;
- }
}
diff --git a/lib/FieldType/XmlText/Converter/RichText.php b/lib/FieldType/XmlText/Converter/RichText.php
new file mode 100644
index 00000000..3f001b37
--- /dev/null
+++ b/lib/FieldType/XmlText/Converter/RichText.php
@@ -0,0 +1,110 @@
+logger = $logger;
+
+ $this->converter = new Aggregate(
+ array(
+ new ToRichTextPreNormalize(new Expanding(), new EmbedLinking()),
+ new Xslt(
+ './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/stylesheets/ezxml/docbook/docbook.xsl',
+ array(
+ array(
+ 'path' => './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/stylesheets/ezxml/docbook/core.xsl',
+ 'priority' => 99,
+ ),
+ )
+ ),
+ )
+ );
+
+ $this->validator = new Validator(
+ array(
+ './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/ezpublish.rng',
+ './vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl',
+ )
+ );
+ }
+
+ protected function removeComments(DOMDocument $document)
+ {
+ $xpath = new DOMXpath($document);
+ $nodes = $xpath->query('//comment()');
+
+ for ($i = 0; $i < $nodes->length; ++$i) {
+ $nodes->item($i)->parentNode->removeChild($nodes->item($i));
+ }
+ }
+
+ protected function reportNonUniqueIds(DOMDocument $document, $contentObjectAttributeId)
+ {
+ $xpath = new DOMXPath($document);
+ $ns = $document->documentElement->namespaceURI;
+ $nodes = $xpath->query("//*[contains(@xml:id, 'duplicated_id_')]");
+ foreach ($nodes as $node) {
+ $id=$node->attributes->getNamedItem('id')->nodeValue;
+ // id has format "duplicated_id_foo_bar_idm45226413447104" where "foo_bar" is the duplicated id
+ $duplicatedId = substr($id, strlen('duplicated_id_'), strrpos($id, '_') - strlen('duplicated_id_'));
+ if ($this->logger !== null) {
+ $this->logger->warning("Duplicated id in original ezxmltext for contentobject_attribute.id=$contentObjectAttributeId, automatically generated new id : $duplicatedId --> $id");
+ }
+ }
+ }
+
+ public function convert(DOMDocument $inputDocument, $checkDuplicateIds = false, $contentObjectAttributeId = null)
+ {
+ $this->removeComments($inputDocument);
+
+ $convertedDocument = $this->converter->convert($inputDocument);
+ if ($checkDuplicateIds) {
+ $this->reportNonUniqueIds($convertedDocument, $contentObjectAttributeId);
+ }
+
+ // Needed by some disabled output escaping (eg. legacy ezxml paragraph elements)
+ $convertedDocumentNormalized = new DOMDocument();
+ $convertedDocumentNormalized->loadXML($convertedDocument->saveXML());
+
+ $errors = $this->validator->validate($convertedDocument);
+
+ $result = $convertedDocumentNormalized->saveXML();
+
+ if (!empty($errors) && $this->logger !== null) {
+ $this->logger->error(
+ "Validation errors when converting ezxmltext for contentobject_attribute.id=$contentObjectAttributeId",
+ ['result' => $result, 'errors' => $errors, 'xmlString' => $inputDocument->saveXML()]
+ );
+ }
+
+ return $result;
+ }
+}
diff --git a/tests/lib/FieldType/Converter/RichTextTest.php b/tests/lib/FieldType/Converter/RichTextTest.php
new file mode 100644
index 00000000..eee381f4
--- /dev/null
+++ b/tests/lib/FieldType/Converter/RichTextTest.php
@@ -0,0 +1,95 @@
+preserveWhiteSpace = false;
+ $document->formatOutput = false;
+
+ if ($isPath === true) {
+ $xml = file_get_contents($xml);
+ }
+
+ $document->loadXml($xml);
+
+ return $document;
+ }
+
+ /**
+ * Provider for conversion test.
+ *
+ * @return array
+ */
+ public function providerForTestConvert()
+ {
+ $map = array();
+
+ foreach (glob(__DIR__ . '/_fixtures/richtext/input/*.xml') as $inputFilePath) {
+ $basename = basename($inputFilePath, '.xml');
+ $outputFilePath = __DIR__ . "/_fixtures/richtext/output/{$basename}.xml";
+
+ $map[] = array($inputFilePath, $outputFilePath);
+ }
+
+ return $map;
+ }
+
+ protected function normalizeRewrittenIds(DOMDocument $xmlDoc)
+ {
+ $counter = 0;
+ $xpath = new DOMXPath($xmlDoc);
+ $nodes = $xpath->query("//*[contains(@xml:id, 'duplicated_id_')]");
+ foreach ($nodes as $node) {
+ $id=$node->attributes->getNamedItem('id')->nodeValue;
+ $node->attributes->getNamedItem('id')->nodeValue = "duplicated_id_foobar$counter";
+ ++$counter;
+ }
+ }
+
+ /**
+ * @param string $inputFilePath
+ * @param string $outputFilePath
+ *
+ * @dataProvider providerForTestConvert
+ */
+ public function testConvert($inputFilePath, $outputFilePath)
+ {
+ $inputDocument = $this->createDocument($inputFilePath);
+ $richText = new RichText(null);
+
+ $result = $richText->convert($inputDocument, true);
+
+ $convertedDocument = $this->createDocument($result, false);
+ $expectedDocument = $this->createDocument($outputFilePath);
+
+ // since duplicate ids are rewritten with random values, we need to normalize those
+ $this->normalizeRewrittenIds($convertedDocument);
+
+ $this->assertEquals(
+ $expectedDocument,
+ $convertedDocument
+ );
+ }
+}
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/001-title-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/001-title-dupid.xml
new file mode 100644
index 00000000..c228d3a4
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/001-title-dupid.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ -
+
+ link with id inv5
+
+
+
+ -
+
+ another link with id inv5
+
+
+
+
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/002-embed-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/002-embed-dupid.xml
new file mode 100644
index 00000000..b9dc1f4b
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/002-embed-dupid.xml
@@ -0,0 +1,20 @@
+
+
+ foobar test : embed
+
+
+
+
+ qweqweqwe : embed inline
+
+
+ ezembedezembed
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/003-anchor-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/003-anchor-dupid.xml
new file mode 100644
index 00000000..5576f501
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/003-anchor-dupid.xml
@@ -0,0 +1,15 @@
+
+
+ This is some
+ here
+
+ And we have
+ here
+
+ And where we duplicate the first
+ indeed
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/004-embed-image-add-ez-embed-type-image.xml_ignore b/tests/lib/FieldType/Converter/_fixtures/richtext/input/004-embed-image-add-ez-embed-type-image.xml_ignore
new file mode 100644
index 00000000..b1154f44
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/004-embed-image-add-ez-embed-type-image.xml_ignore
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/010-align.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/010-align.xml
new file mode 100644
index 00000000..87605f7b
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/010-align.xml
@@ -0,0 +1,10 @@
+
+
+ align left
+ aligne center
+ align right
+ align fullheader align fullheaderalign fullheaderalign fullheaderalign fullheaderalign fullheaderalign fullheader
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/020-bold.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/020-bold.xml
new file mode 100644
index 00000000..460284f9
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/020-bold.xml
@@ -0,0 +1,9 @@
+
+
+ Some text
+ in bold here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/030-emphasized.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/030-emphasized.xml
new file mode 100644
index 00000000..d97d3bd2
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/030-emphasized.xml
@@ -0,0 +1,9 @@
+
+
+ some
+ emphasized text here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/040-link.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/040-link.xml
new file mode 100644
index 00000000..cc1e40c3
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/040-link.xml
@@ -0,0 +1,21 @@
+
+
+ Here is an anchor
+
+
+ Let's link to
+ the anchor
+
+ Link to
+ site
+
+ Link to
+ node
+
+ link to
+ object
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/050-literal_implicit.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/050-literal_implicit.xml
new file mode 100644
index 00000000..97f0a3dc
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/050-literal_implicit.xml
@@ -0,0 +1,11 @@
+
+
+
+ line1
+ line2
+
+ line3
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/051-literal.xml_ignore b/tests/lib/FieldType/Converter/_fixtures/richtext/input/051-literal.xml_ignore
new file mode 100644
index 00000000..93739544
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/051-literal.xml_ignore
@@ -0,0 +1,9 @@
+
+
+ test
+
+ literal text
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/060-list_ordered.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/060-list_ordered.xml
new file mode 100644
index 00000000..cf2f22a4
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/060-list_ordered.xml
@@ -0,0 +1,2 @@
+
+- ordered list 1
- ordered list 2
- ordered bold italic underlined all
- indented ordered bullet
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/070-list_unordered.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/070-list_unordered.xml
new file mode 100644
index 00000000..9ee27d8c
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/070-list_unordered.xml
@@ -0,0 +1,2 @@
+
+- unordered bullet 1
- unordered bullet 2
- unordered bold italic underlined all
- indented unordered bullet
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/080-header.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/080-header.xml
new file mode 100644
index 00000000..faf16929
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/080-header.xml
@@ -0,0 +1,30 @@
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/090-table.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/090-table.xml
new file mode 100644
index 00000000..50b32a0a
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/090-table.xml
@@ -0,0 +1,42 @@
+
+
+ some table
+
+
+
+
+ column1
+ |
+
+ column2
+ |
+
+ column3
+ |
+
+ column4
+ |
+
+
+
+ text1
+ |
+ |
+ |
+ |
+
+
+ |
+ |
+
+ text2
+ |
+ |
+
+
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/100-underline.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/100-underline.xml
new file mode 100644
index 00000000..c13481ea
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/100-underline.xml
@@ -0,0 +1,9 @@
+
+
+ some
+ underline test here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/input/110-subscript-superscript.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/input/110-subscript-superscript.xml
new file mode 100644
index 00000000..3ec68fd8
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/input/110-subscript-superscript.xml
@@ -0,0 +1,10 @@
+
+
+ x
+ subscript and y
+ superscript
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/001-title-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/001-title-dupid.xml
new file mode 100644
index 00000000..105b642a
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/001-title-dupid.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ link with id inv5
+
+
+
+
+ another link with id inv5
+
+
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/002-embed-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/002-embed-dupid.xml
new file mode 100644
index 00000000..ff9364f8
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/002-embed-dupid.xml
@@ -0,0 +1,25 @@
+
+
+ foobar test : embed
+
+
+
+ medium
+ 0
+ 5
+
+
+ qweqweqwe : embed inline
+
+
+
+
+ medium
+
+ ezembedezembed
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/003-anchor-dupid.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/003-anchor-dupid.xml
new file mode 100644
index 00000000..6e76db8a
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/003-anchor-dupid.xml
@@ -0,0 +1,16 @@
+
+
+ This is some
+ here
+
+ And we have
+ here
+
+ And where we duplicate the first
+ indeed
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/004-embed-image-add-ez-embed-type-image.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/004-embed-image-add-ez-embed-type-image.xml
new file mode 100644
index 00000000..d7193ee9
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/004-embed-image-add-ez-embed-type-image.xml
@@ -0,0 +1,23 @@
+
+
+ Here we have a nice image
+
+
+ medium
+ 0
+ 5
+
+
+ And here we have a file
+
+
+ medium
+ 0
+ 5
+
+
+
\ No newline at end of file
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/010-align.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/010-align.xml
new file mode 100644
index 00000000..487648b4
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/010-align.xml
@@ -0,0 +1,11 @@
+
+
+ align left
+ aligne center
+ align right
+ align fullheader align fullheaderalign fullheaderalign fullheaderalign fullheaderalign fullheaderalign fullheader
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/020-bold.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/020-bold.xml
new file mode 100644
index 00000000..b2066e97
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/020-bold.xml
@@ -0,0 +1,10 @@
+
+
+ Some text
+ in bold here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/030-emphasized.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/030-emphasized.xml
new file mode 100644
index 00000000..ffc2d487
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/030-emphasized.xml
@@ -0,0 +1,10 @@
+
+
+ some
+ emphasized text here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/040-link.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/040-link.xml
new file mode 100644
index 00000000..47c737a7
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/040-link.xml
@@ -0,0 +1,22 @@
+
+
+ Here is an anchor
+
+
+ Let's link to
+ the anchor
+
+ Link to
+ site
+
+ Link to
+ node
+
+ link to
+ object
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/050-literal_implicit.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/050-literal_implicit.xml
new file mode 100644
index 00000000..7fa943a5
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/050-literal_implicit.xml
@@ -0,0 +1,12 @@
+
+
+
+ line1
+line2
+
+ line3
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/051-literal.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/051-literal.xml
new file mode 100644
index 00000000..9ab4aa03
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/051-literal.xml
@@ -0,0 +1,9 @@
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/060-list_ordered.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/060-list_ordered.xml
new file mode 100644
index 00000000..9c4d698e
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/060-list_ordered.xml
@@ -0,0 +1,2 @@
+
+ordered list 1ordered list 2ordered bold italic underlined allindented ordered bullet
\ No newline at end of file
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/070-list_unordered.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/070-list_unordered.xml
new file mode 100644
index 00000000..55711a2d
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/070-list_unordered.xml
@@ -0,0 +1,2 @@
+
+unordered bullet 1unordered bullet 2unordered bold italic underlined allindented unordered bullet
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/080-header.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/080-header.xml
new file mode 100644
index 00000000..6275e6cd
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/080-header.xml
@@ -0,0 +1,19 @@
+
+
+ header1text
+ some paragraph
+ header2text
+ paragraph2
+ header3text
+ paragraph3
+ header4text
+ paragraph4
+ header5text
+ paragraph5
+ header6text
+ paragraph6
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml
new file mode 100644
index 00000000..6782c344
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/090-table.xml
@@ -0,0 +1,43 @@
+
+
+ some table
+
+ custom caption
+
+
+
+ column1
+ |
+
+ column2
+ |
+
+ column3
+ |
+
+ column4
+ |
+
+
+
+ text1
+ |
+ |
+ |
+ |
+
+
+ |
+ |
+
+ text2
+ |
+ |
+
+
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/100-underline.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/100-underline.xml
new file mode 100644
index 00000000..8a2936e2
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/100-underline.xml
@@ -0,0 +1,10 @@
+
+
+ some
+ underline test here
+
+
diff --git a/tests/lib/FieldType/Converter/_fixtures/richtext/output/110-subscript-superscript.xml b/tests/lib/FieldType/Converter/_fixtures/richtext/output/110-subscript-superscript.xml
new file mode 100644
index 00000000..0dea75a4
--- /dev/null
+++ b/tests/lib/FieldType/Converter/_fixtures/richtext/output/110-subscript-superscript.xml
@@ -0,0 +1,11 @@
+
+
+ x
+ subscript and y
+ superscript
+
+