Skip to content

Commit

Permalink
Updated dependencies and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kmadejski committed Apr 21, 2020
1 parent a2e56c4 commit 3e3af63
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -21,9 +21,10 @@
"GPL-2.0"
],
"require": {
"php": "^7.1",
"php": "^7.3",
"guzzlehttp/guzzle": "^6.3.0",
"ezsystems/ezplatform-kernel": "^1.0"
"ezsystems/ezplatform-kernel": "^1.0",
"ezsystems/ezplatform-richtext": "^2.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.2",
Expand Down
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
<response><field_1_richtext type="eZ\Publish\Core\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.</para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_1_richtext><field_2_richtext type="eZ\Publish\Core\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">XXXEOLXXX <p>Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish. TheXXXEOLXXX basic staples are native foods such as corn, beans and chili peppers.</p>XXXEOLXXX <h2>Main Features</h2>XXXEOLXXX <div data-ezelement="ezembed" data-href="ezcontent://192" data-ezview="embed" class="ez-embed-type-image" data-ezalign="right"><span data-ezelement="ezconfig"><span data-ezelement="ezvalue" data-ezvalue-key="size">large</span> </span></div>XXXEOLXXX <p>The ability to cook well, called "saz&#xF3;n" (lit. seasoning) is considered to be a gift generally gained fromXXXEOLXXX experience and a sense of commitment to the diners.</p>XXXEOLXXX <div data-ezelement="ezembed" data-href="ezcontent://191" data-ezview="embed" class="ez-embed-type-image" data-ezalign="left"><span data-ezelement="ezconfig"><span data-ezelement="ezvalue" data-ezvalue-key="size">large</span> </span></div>XXXEOLXXX <p>Mexican regional home cooking is completely different from the food served in most Mexican restaurants outsideXXXEOLXXX Mexico, which is usually some variety of Tex-Mex.</p>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_2_richtext></response>
<response><field_1_richtext type="EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.</para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_1_richtext><field_2_richtext type="EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit">XXXEOLXXX <p>Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish. TheXXXEOLXXX basic staples are native foods such as corn, beans and chili peppers.</p>XXXEOLXXX <h2>Main Features</h2>XXXEOLXXX <div data-ezelement="ezembed" data-href="ezcontent://192" data-ezview="embed" class="ez-embed-type-image" data-ezalign="right"><span data-ezelement="ezconfig"><span data-ezelement="ezvalue" data-ezvalue-key="size">large</span> </span></div>XXXEOLXXX <p>The ability to cook well, called "saz&#xF3;n" (lit. seasoning) is considered to be a gift generally gained fromXXXEOLXXX experience and a sense of commitment to the diners.</p>XXXEOLXXX <div data-ezelement="ezembed" data-href="ezcontent://191" data-ezview="embed" class="ez-embed-type-image" data-ezalign="left"><span data-ezelement="ezconfig"><span data-ezelement="ezvalue" data-ezvalue-key="size">large</span> </span></div>XXXEOLXXX <p>Mexican regional home cooking is completely different from the food served in most Mexican restaurants outsideXXXEOLXXX Mexico, which is usually some variety of Tex-Mex.</p>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_2_richtext></response>
@@ -1,2 +1,2 @@
<?xml version="1.0"?>
<response><field_1_richtext type="eZ\Publish\Core\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>XXXEOLXXX Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.XXXEOLXXX </para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_1_richtext><field_2_richtext type="eZ\Publish\Core\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>XXXEOLXXX Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.XXXEOLXXX </para>XXXEOLXXX <para>File 2</para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_2_richtext></response>
<response><field_1_richtext type="EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>XXXEOLXXX Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.XXXEOLXXX </para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_1_richtext><field_2_richtext type="EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Value"><fakecdata>XXXEOLXXX<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0">XXXEOLXXX <para>XXXEOLXXX Mexican cuisine is primarily a fusion of indigenous Mesoamerican cooking with European, especially Spanish.XXXEOLXXX </para>XXXEOLXXX <para>File 2</para>XXXEOLXXX</section>XXXEOLXXX</fakecdata></field_2_richtext></response>
12 changes: 6 additions & 6 deletions tests/lib/EncoderTest.php
Expand Up @@ -12,6 +12,7 @@

namespace EzSystems\EzPlatformAutomatedTranslation;

use eZ\Publish\Core\MVC\ConfigResolverInterface;
use PHPUnit\Framework\TestCase;
use eZ\Publish\Core\Repository\Values\Content\Content;
use eZ\Publish\Core\Repository\Values\Content\VersionInfo;
Expand All @@ -20,7 +21,7 @@
use eZ\Publish\API\Repository\Values\ContentType\ContentType;
use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
use eZ\Publish\Core\FieldType\TextLine;
use eZ\Publish\Core\FieldType\RichText;
use EzSystems\EzPlatformRichText\eZ\FieldType\RichText;

class EncoderTest extends TestCase
{
Expand All @@ -32,8 +33,7 @@ public function setUp()
parent::setUp();

$this->configResolver = $this
->getMockBuilder('eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver')
->disableOriginalConstructor()
->getMockBuilder(ConfigResolverInterface::class)
->getMock();

$this->configResolver
Expand All @@ -58,7 +58,7 @@ public function setUp()
public function testEncodeTwoTextline()
{
$contentTypeServiceMock = $this->getContentTypeServiceMock();
$contentType = $this->getMockForAbstractClass(ContentType::class);
$contentType = $this->getMockForAbstractClass(ContentType::class, [], '', true, true, true, ['getFieldDefinition']);
$fieldDefinition = $this->getMockBuilder(FieldDefinition::class)
->setConstructorArgs([
[
Expand Down Expand Up @@ -129,7 +129,7 @@ public function testEncodeTwoTextline()
public function testEncodeTwoRichText()
{
$contentTypeServiceMock = $this->getContentTypeServiceMock();
$contentType = $this->getMockForAbstractClass(ContentType::class);
$contentType = $this->getMockForAbstractClass(ContentType::class, [], '', true, true, true, ['getFieldDefinition']);
$fieldDefinition = $this->getMockBuilder(FieldDefinition::class)
->setConstructorArgs([
[
Expand Down Expand Up @@ -203,7 +203,7 @@ public function testEncodeTwoRichText()
public function testEncodeTwoRichTextWithTwoEzembed()
{
$contentTypeServiceMock = $this->getContentTypeServiceMock();
$contentType = $this->getMockForAbstractClass(ContentType::class);
$contentType = $this->getMockForAbstractClass(ContentType::class, [], '', true, true, true, ['getFieldDefinition']);
$fieldDefinition = $this->getMockBuilder(FieldDefinition::class)
->setConstructorArgs([
[
Expand Down

0 comments on commit 3e3af63

Please sign in to comment.