diff --git a/Test/Integration/Model/BlockInstaller/InstallTest.php b/Test/Integration/Model/BlockInstaller/InstallTest.php new file mode 100644 index 0000000000000000000000000000000000000000..36a43691c1cb87ad117f5317b184c0bc9b77f892 --- /dev/null +++ b/Test/Integration/Model/BlockInstaller/InstallTest.php @@ -0,0 +1,18 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\BlockInstaller; + +class InstallTest extends TestCase +{ + public function testInstall() + { + $this->initBlockEntries(); + + $this->installer->install(); + + // Verify, that block are in database like defined + $this->compareBlockWithEntryForStore(1); + $this->compareBlockWithEntryForStore(2); + } +} diff --git a/Test/Integration/Model/BlockInstaller/TestCase.php b/Test/Integration/Model/BlockInstaller/TestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..1b07f421347a41dadae3bb86fd5f9a444b5c2498 --- /dev/null +++ b/Test/Integration/Model/BlockInstaller/TestCase.php @@ -0,0 +1,128 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\BlockInstaller; + +use Firegento\ContentProvisioning\Api\Data\BlockEntryInterface; +use Firegento\ContentProvisioning\Api\Data\BlockEntryInterfaceFactory; +use Firegento\ContentProvisioning\Model\BlockInstaller; +use Firegento\ContentProvisioning\Model\Query\GetBlockEntryList; +use Firegento\ContentProvisioning\Model\Query\GetFirstBlockByBlockEntry; +use Magento\Cms\Api\Data\BlockInterface; +use Magento\Framework\App\ResourceConnection; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\TestFramework\Helper\Bootstrap; + +class TestCase extends \PHPUnit\Framework\TestCase +{ + /** + * @var BlockInstaller + */ + protected $installer; + + /** + * @var GetBlockEntryList|MockObject + */ + protected $getBlockEntryListMock; + + /** + * @var BlockEntryInterfaceFactory + */ + protected $blockEntryInterfaceFactory; + + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var BlockEntryInterface[] + */ + protected $blockEntries = []; + + /** + * @var GetFirstBlockByBlockEntry + */ + protected $getFirstBlockByBlockEntry; + + protected function setUp() + { + parent::setUp(); + + $this->getBlockEntryListMock = self::getMockBuilder(GetBlockEntryList::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->installer = Bootstrap::getObjectManager() + ->create(BlockInstaller::class, ['getAllBlockEntries' => $this->getBlockEntryListMock]); + + $this->blockEntryInterfaceFactory = Bootstrap::getObjectManager() + ->create(BlockEntryInterfaceFactory::class); + + $this->storeManager = Bootstrap::getObjectManager() + ->create(StoreManagerInterface::class); + + $this->getFirstBlockByBlockEntry = Bootstrap::getObjectManager() + ->create(GetFirstBlockByBlockEntry::class); + } + + protected function tearDown() + { + parent::tearDown(); + + $connection = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $connection->getConnection()->delete( + $connection->getTableName('cms_block'), + [ + 'identifier LIKE ?' => 'firegento-content-provisioning-test-%', + ] + ); + } + + protected function initBlockEntries() + { + $this->blockEntries[1] = $this->blockEntryInterfaceFactory->create(['data' => [ + BlockEntryInterface::TITLE => 'Test Block 1', + BlockEntryInterface::CONTENT => '<h2>test foobar Aenean commodo ligula eget dolor aenean massa</h2>', + BlockEntryInterface::KEY => 'test.block.1', + BlockEntryInterface::IDENTIFIER => 'firegento-content-provisioning-test-1', + BlockEntryInterface::IS_ACTIVE => false, + BlockEntryInterface::IS_MAINTAINED => true, + BlockEntryInterface::STORES => ['admin'], + ]]); + + $this->blockEntries[2] = $this->blockEntryInterfaceFactory->create(['data' => [ + BlockEntryInterface::TITLE => 'Test Block 2', + BlockEntryInterface::CONTENT => file_get_contents(__DIR__ . '/../../_files/content/dummy-content.html'), + BlockEntryInterface::KEY => 'test.block.2', + BlockEntryInterface::IDENTIFIER => 'firegento-content-provisioning-test-2', + BlockEntryInterface::IS_ACTIVE => true, + BlockEntryInterface::IS_MAINTAINED => false, + BlockEntryInterface::STORES => ['default', 'admin'], + ]]); + + $this->getBlockEntryListMock->method('get')->willReturn($this->blockEntries); + } + + protected function compareBlockWithEntryForStore($entryIndex) + { + $entry = $this->blockEntries[$entryIndex]; + $block = $this->getBlockByBlockEntry($entry); + + $this->assertSame($block->getTitle(), $entry->getTitle()); + $this->assertSame($block->getContent(), $entry->getContent()); + $this->assertSame($block->isActive(), $entry->isActive()); + } + + /** + * @param BlockEntryInterface $entry + * @return BlockInterface + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException + */ + protected function getBlockByBlockEntry(BlockEntryInterface $entry): BlockInterface + { + return $this->getFirstBlockByBlockEntry->execute($entry); + } +} diff --git a/Test/Integration/Model/BlockInstaller/UpdateMaintainedTest.php b/Test/Integration/Model/BlockInstaller/UpdateMaintainedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..1144464998e10f3b633ec87fd03dbd320a9ca2fe --- /dev/null +++ b/Test/Integration/Model/BlockInstaller/UpdateMaintainedTest.php @@ -0,0 +1,36 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\BlockInstaller; + +class UpdateMaintainedTest extends TestCase +{ + public function testInstall() + { + $this->initBlockEntries(); + + $this->installer->install(); + + // Change block entry values + $this->blockEntries[1]->setTitle('Changed Block 1'); + $this->blockEntries[1]->setIsActive(true); + $this->blockEntries[1]->setContent('New Content'); + + $this->blockEntries[2]->setTitle('Changed Block 2'); + $this->blockEntries[2]->setIsActive(true); + $this->blockEntries[2]->setContent('New Content'); + + // Execute installer a second time + $this->installer->install(); + + // Verify that first block was updated + $this->compareBlockWithEntryForStore(1); + + // Verify that second block did not change + $entry = $this->blockEntries[2]; + $block = $this->getBlockByBlockEntry($entry); + + $this->assertNotSame($block->getTitle(), $entry->getTitle()); + $this->assertNotSame($block->getContent(), $entry->getContent()); + } +} diff --git a/Test/Integration/Model/Config/ConverterTest.php b/Test/Integration/Model/Config/ConverterTest.php index 2295528d8ab5fe51ef6c4ecfcd84ad40ffda1892..fe5718833cf3b372816f3f1aa954c4bbb4db153b 100644 --- a/Test/Integration/Model/Config/ConverterTest.php +++ b/Test/Integration/Model/Config/ConverterTest.php @@ -21,7 +21,7 @@ class ConverterTest extends \PHPUnit\Framework\TestCase public function testConverter() { - $pathFiles = __DIR__ . '/_files'; + $pathFiles = __DIR__ . '/../../_files'; $expectedResult = require $pathFiles . '/result.php'; $path = $pathFiles . '/content_provisioning.xml'; $domDocument = new \DOMDocument(); diff --git a/Test/Integration/Model/PageInstaller/InstallTest.php b/Test/Integration/Model/PageInstaller/InstallTest.php new file mode 100644 index 0000000000000000000000000000000000000000..551717aa575a6b87eeb44c2722e5ed10737cb88e --- /dev/null +++ b/Test/Integration/Model/PageInstaller/InstallTest.php @@ -0,0 +1,19 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\PageInstaller; + +class InstallTest extends TestCase +{ + public function testInstall() + { + $this->initEntries(); + + $this->installer->install(); + + // Verify, that pages are in database like defined + $this->comparePageWithEntryForStore(1); + $this->comparePageWithEntryForStore(2); + $this->comparePageWithEntryForStore(3); + } +} diff --git a/Test/Integration/Model/PageInstaller/TestCase.php b/Test/Integration/Model/PageInstaller/TestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..f75fca6062e05133bc0f680ec2924f724f8d5daf --- /dev/null +++ b/Test/Integration/Model/PageInstaller/TestCase.php @@ -0,0 +1,169 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\PageInstaller; + +use Firegento\ContentProvisioning\Api\Data\PageEntryInterface; +use Firegento\ContentProvisioning\Api\Data\PageEntryInterfaceFactory; +use Firegento\ContentProvisioning\Model\PageInstaller; +use Firegento\ContentProvisioning\Model\Query\GetFirstPageByPageEntry; +use Firegento\ContentProvisioning\Model\Query\GetPageEntryList; +use Magento\Cms\Api\Data\PageInterface; +use Magento\Framework\App\ResourceConnection; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\TestFramework\Helper\Bootstrap; + +class TestCase extends \PHPUnit\Framework\TestCase +{ + /** + * @var StoreManagerInterface + */ + protected $storeManager; + + /** + * @var GetPageEntryList|MockObject + */ + protected $getPageEntryListMock; + + /** + * @var PageInstaller + */ + protected $installer; + + /** + * @var PageEntryInterfaceFactory + */ + protected $pageEntryInterfaceFactory; + + /** + * @var PageEntryInterface[] + */ + protected $pageEntries; + + /** + * @var GetFirstPageByPageEntry + */ + protected $getFisrtPageByPageEntry; + + + protected function setUp() + { + parent::setUp(); + + $this->getPageEntryListMock = self::getMockBuilder(GetPageEntryList::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->installer = Bootstrap::getObjectManager() + ->create(PageInstaller::class, ['getAllPageEntries' => $this->getPageEntryListMock]); + + $this->pageEntryInterfaceFactory = Bootstrap::getObjectManager() + ->create(PageEntryInterfaceFactory::class); + + $this->storeManager = Bootstrap::getObjectManager() + ->create(StoreManagerInterface::class); + + $this->getFisrtPageByPageEntry = Bootstrap::getObjectManager() + ->create(GetFirstPageByPageEntry::class); + } + + protected function tearDown() + { + parent::tearDown(); + + $connection = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $connection->getConnection()->delete( + $connection->getTableName('cms_page'), + [ + 'identifier LIKE ?' => 'firegento-content-provisioning-test-%', + ] + ); + $connection->getConnection()->delete( + $connection->getTableName('url_rewrite'), + [ + 'request_path LIKE ?' => 'firegento-content-provisioning-test-%', + 'entity_type = ?' => 'cms-page', + ] + ); + } + + protected function initEntries() + { + $this->pageEntries[1] = $this->pageEntryInterfaceFactory->create(['data' => [ + PageEntryInterface::TITLE => 'Test Page 1', + PageEntryInterface::CONTENT => '<h2>test foobar Aenean commodo ligula eget dolor aenean massa</h2>', + PageEntryInterface::CONTENT_HEADING => 'Some Content Heading', + PageEntryInterface::KEY => 'test.page.1', + PageEntryInterface::IDENTIFIER => 'firegento-content-provisioning-test-1', + PageEntryInterface::IS_ACTIVE => false, + PageEntryInterface::IS_MAINTAINED => true, + PageEntryInterface::STORES => ['admin'], + PageEntryInterface::META_DESCRIPTION => 'Some seo description', + PageEntryInterface::META_KEYWORDS => 'Some, seo, keywords', + PageEntryInterface::META_TITLE => 'Seo title', + PageEntryInterface::PAGE_LAYOUT => '3columns', + PageEntryInterface::LAYOUT_UPDATE_XML => '<foo>bar</foo>', + PageEntryInterface::CUSTOM_THEME => 3, + PageEntryInterface::CUSTOM_THEME_FROM => '2019-03-29', + PageEntryInterface::CUSTOM_THEME_TO => '2019-05-29', + PageEntryInterface::CUSTOM_ROOT_TEMPLATE => '3columns', + ]]); + + $this->pageEntries[2] = $this->pageEntryInterfaceFactory->create(['data' => [ + PageEntryInterface::TITLE => 'Test Page 2', + PageEntryInterface::CONTENT => file_get_contents(__DIR__ . '/../../_files/content/dummy-content.html'), + PageEntryInterface::CONTENT_HEADING => 'Some Content Heading', + PageEntryInterface::KEY => 'test.page.2', + PageEntryInterface::IDENTIFIER => 'firegento-content-provisioning-test-2', + PageEntryInterface::IS_ACTIVE => true, + PageEntryInterface::IS_MAINTAINED => false, + PageEntryInterface::STORES => ['default', 'admin'], + ]]); + + $this->pageEntries[3] = $this->pageEntryInterfaceFactory->create(['data' => [ + PageEntryInterface::TITLE => 'Test Page 3', + PageEntryInterface::CONTENT => '<h2>test foobar Aenean commodo ligula eget dolor aenean massa</h2>', + PageEntryInterface::CONTENT_HEADING => 'Some Content Heading', + PageEntryInterface::KEY => 'test.page.3', + PageEntryInterface::IDENTIFIER => 'firegento-content-provisioning-test-3', + PageEntryInterface::IS_ACTIVE => true, + PageEntryInterface::IS_MAINTAINED => true, + PageEntryInterface::STORES => ['default'], + PageEntryInterface::META_DESCRIPTION => 'Some seo description', + PageEntryInterface::META_KEYWORDS => 'Some, seo, keywords', + PageEntryInterface::META_TITLE => 'Seo title', + PageEntryInterface::PAGE_LAYOUT => '3columns', + PageEntryInterface::LAYOUT_UPDATE_XML => '<foo>bar</foo>' + ]]); + + $this->getPageEntryListMock->method('get')->willReturn($this->pageEntries); + } + + protected function comparePageWithEntryForStore($entryIndex) + { + $entry = $this->pageEntries[$entryIndex]; + $block = $this->getPageByPageEntry($entry); + + $this->assertSame($block->getTitle(), $entry->getTitle()); + $this->assertSame($block->getContent(), $entry->getContent()); + $this->assertSame($block->isActive(), $entry->isActive()); + $this->assertSame($block->getMetaDescription(), $entry->getMetaDescription()); + $this->assertSame($block->getMetaKeywords(), $entry->getMetaKeywords()); + $this->assertSame($block->getMetaTitle(), $entry->getMetaTitle()); + $this->assertSame($block->getCustomLayoutUpdateXml(), $entry->getCustomLayoutUpdateXml()); + $this->assertSame($block->getPageLayout(), $entry->getPageLayout()); + $this->assertSame($block->getContentHeading(), $entry->getContentHeading()); + } + + /** + * @param PageEntryInterface $entry + * @return PageInterface + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\LocalizedException + */ + protected function getPageByPageEntry(PageEntryInterface $entry): PageInterface + { + return $this->getFisrtPageByPageEntry->execute($entry); + } +} diff --git a/Test/Integration/Model/PageInstaller/UpdateMaintainedTest.php b/Test/Integration/Model/PageInstaller/UpdateMaintainedTest.php new file mode 100644 index 0000000000000000000000000000000000000000..f74843282360b38110076b0f967567ce526cfab0 --- /dev/null +++ b/Test/Integration/Model/PageInstaller/UpdateMaintainedTest.php @@ -0,0 +1,43 @@ +<?php +declare(strict_types=1); + +namespace Firegento\ContentProvisioning\Test\Integration\Model\PageInstaller; + +class UpdateMaintainedTest extends TestCase +{ + public function testInstall() + { + $this->initEntries(); + + $this->installer->install(); + + // Change page entry values + $this->pageEntries[1]->setTitle('Changed Page 1'); + $this->pageEntries[1]->setIsActive(true); + $this->pageEntries[1]->setContent('New Content'); + + $this->pageEntries[2]->setTitle('Changed Page 2'); + $this->pageEntries[2]->setIsActive(true); + $this->pageEntries[2]->setContent('New Content'); + + $this->pageEntries[3]->setTitle('Changed Page 3'); + $this->pageEntries[3]->setContent('New Content 333'); + $this->pageEntries[3]->setMetaDescription('New Meta description'); + $this->pageEntries[3]->setPageLayout('1column'); + $this->pageEntries[3]->setContentHeading('Another Content Heading'); + + // Execute installer a second time + $this->installer->install(); + + // Verify that first and third page was updated + $this->comparePageWithEntryForStore(1); + $this->comparePageWithEntryForStore(3); + + // Verify that second page did not change + $entry = $this->pageEntries[2]; + $block = $this->getPageByPageEntry($entry); + + $this->assertNotSame($block->getTitle(), $entry->getTitle()); + $this->assertNotSame($block->getContent(), $entry->getContent()); + } +} diff --git a/Test/Integration/_files/content/content-with-images-1.html b/Test/Integration/_files/content/content-with-images-1.html new file mode 100644 index 0000000000000000000000000000000000000000..dc3c06d323aca666c6b1da39c36bdf930ab9d321 --- /dev/null +++ b/Test/Integration/_files/content/content-with-images-1.html @@ -0,0 +1,5 @@ +<h5>Some foobar</h5> +<p>Foobar: <a href="{{media url="image-1.png"}}">Link zu einem Bilder</a></p> +<p>Dummy content...</p> +<p>Image: <img src="{{media url="some-test-image.png"}}" alt="fooo" width="300"></p> +<p>Image 2: <img src="{{media url="foobar/test.png"}}" alt="" width="450" height="150"></p> \ No newline at end of file diff --git a/Test/Integration/_files/content/dummy-content.html b/Test/Integration/_files/content/dummy-content.html new file mode 100644 index 0000000000000000000000000000000000000000..e512db4d761c6dec12088f48dca0ce60e0123f3d --- /dev/null +++ b/Test/Integration/_files/content/dummy-content.html @@ -0,0 +1,4 @@ +<h1>Dummy Content</h1> +<p> + Some test block content +</p> \ No newline at end of file diff --git a/Test/Integration/_files/content/file-1.html b/Test/Integration/_files/content/file-1.html new file mode 100644 index 0000000000000000000000000000000000000000..38c94991d7697d3c024cb9047156cb69eab17878 --- /dev/null +++ b/Test/Integration/_files/content/file-1.html @@ -0,0 +1,3 @@ +<p> + Some test page content +</p> \ No newline at end of file diff --git a/Test/Integration/_files/content_provisioning.xml b/Test/Integration/_files/content_provisioning.xml new file mode 100644 index 0000000000000000000000000000000000000000..8e8b97e446774661f95f05cc6494bd1b711c9f18 --- /dev/null +++ b/Test/Integration/_files/content_provisioning.xml @@ -0,0 +1,52 @@ +<?xml version="1.0"?> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Firegento/ContentProvisioning/etc/content_provisioning.xsd"> + <page key="test.page.1" identifier="test-page-1" maintained="true" active="true"> + <title>Test Page 1</title> + <content type="file">Firegento_ContentProvisioning::Test/Integration/_files/content/file-1.html</content> + </page> + <page key="test.page.2" identifier="test-page-2" active="false"> + <title>Title 2</title> + <content heading="New Page Heading 2" type="file">Firegento_ContentProvisioning::Test/Integration/_files/content/file-1.html</content> + <stores> + <store code="default" /> + <store code="admin" /> + </stores> + <seo> + <title>SEO Page Title</title> + <keywords>Some, SEO, keywords</keywords> + <description>SEO description</description> + </seo> + <design> + <layout>3columns</layout> + <layout_xml><![CDATA[<foo>bar</foo>]]></layout_xml> + </design> + <custom_design> + <from>2019-03-03</from> + <to>2019-03-29</to> + <layout>3columns</layout> + <theme_id>3</theme_id> + </custom_design> + </page> + <page key="test.page.3" identifier="test-page-3" active="true" maintained="true"> + <title>Page With Images</title> + <content type="file">Firegento_ContentProvisioning::Test/Integration/_files/content/content-with-images-1.html</content> + <media_directory>Firegento_ContentProvisioning::Test/Integration/_files/content/media</media_directory> + </page> + <block key="test.block.1" identifier="test-block-1" maintained="true" active="true"> + <title>Test Block 1</title> + <content><![CDATA[<h2>test foobar Aenean commodo ligula eget dolor aenean massa</h2>]]></content> + </block> + <block key="test.block.2" identifier="test-block-2" maintained="false" active="true"> + <title>Test Block 2</title> + <content type="file">Firegento_ContentProvisioning::Test/Integration/_files/content/file-1.html</content> + <stores> + <store code="default" /> + <store code="admin" /> + </stores> + </block> + <block key="test.block.3" identifier="test-block-3" maintained="true" active="true"> + <title>Block With Images</title> + <content type="file">Firegento_ContentProvisioning::Test/Integration/_files/content/content-with-images-1.html</content> + <media_directory>Firegento_ContentProvisioning::Test/Integration/_files/content/media</media_directory> + </block> +</config> \ No newline at end of file diff --git a/Test/Integration/_files/result.php b/Test/Integration/_files/result.php new file mode 100644 index 0000000000000000000000000000000000000000..0a50d067d39942a61d5d6fbd56bf3fa1af2d570c --- /dev/null +++ b/Test/Integration/_files/result.php @@ -0,0 +1,97 @@ +<?php + +use \Firegento\ContentProvisioning\Api\Data\PageEntryInterface; +use \Firegento\ContentProvisioning\Api\Data\BlockEntryInterface; + +return [ + 'pages' => [ + 'test.page.1' => [ + PageEntryInterface::TITLE => 'Test Page 1', + PageEntryInterface::CONTENT => file_get_contents(__DIR__ . '/content/file-1.html'), + PageEntryInterface::KEY => 'test.page.1', + PageEntryInterface::IDENTIFIER => 'test-page-1', + PageEntryInterface::IS_ACTIVE => true, + PageEntryInterface::IS_MAINTAINED => true, + PageEntryInterface::STORES => ['admin'], + PageEntryInterface::CONTENT_HEADING => '', + PageEntryInterface::MEDIA_DIRECTORY => null, + PageEntryInterface::MEDIA_FILES => [], + ], + 'test.page.2' => [ + PageEntryInterface::TITLE => 'Title 2', + PageEntryInterface::CONTENT => file_get_contents(__DIR__ . '/content/file-1.html'), + PageEntryInterface::KEY => 'test.page.2', + PageEntryInterface::IDENTIFIER => 'test-page-2', + PageEntryInterface::IS_ACTIVE => false, + PageEntryInterface::IS_MAINTAINED => false, + PageEntryInterface::STORES => ['default', 'admin'], + PageEntryInterface::CONTENT_HEADING => 'New Page Heading 2', + PageEntryInterface::META_TITLE => 'SEO Page Title', + PageEntryInterface::META_KEYWORDS => 'Some, SEO, keywords', + PageEntryInterface::META_DESCRIPTION => 'SEO description', + PageEntryInterface::PAGE_LAYOUT => '3columns', + PageEntryInterface::LAYOUT_UPDATE_XML => '<foo>bar</foo>', + PageEntryInterface::CUSTOM_THEME_FROM => '2019-03-03', + PageEntryInterface::CUSTOM_THEME_TO => '2019-03-29', + PageEntryInterface::CUSTOM_THEME => '3', + PageEntryInterface::CUSTOM_ROOT_TEMPLATE => '3columns', + PageEntryInterface::MEDIA_DIRECTORY => null, + PageEntryInterface::MEDIA_FILES => [], + ], + 'test.page.3' => [ + PageEntryInterface::TITLE => 'Page With Images', + PageEntryInterface::CONTENT => file_get_contents(__DIR__ . '/content/content-with-images-1.html'), + PageEntryInterface::KEY => 'test.page.3', + PageEntryInterface::IDENTIFIER => 'test-page-3', + PageEntryInterface::IS_ACTIVE => true, + PageEntryInterface::IS_MAINTAINED => true, + PageEntryInterface::STORES => ['admin'], + PageEntryInterface::CONTENT_HEADING => '', + PageEntryInterface::MEDIA_DIRECTORY => __DIR__ . '/content/media', + PageEntryInterface::MEDIA_FILES => [ + 'image-1.png', + 'some-test-image.png', + 'foobar/test.png', + ], + ] + ], + 'blocks' => [ + 'test.block.1' => [ + BlockEntryInterface::TITLE => 'Test Block 1', + BlockEntryInterface::CONTENT => '<h2>test foobar Aenean commodo ligula eget dolor aenean massa</h2>', + BlockEntryInterface::KEY => 'test.block.1', + BlockEntryInterface::IDENTIFIER => 'test-block-1', + BlockEntryInterface::IS_ACTIVE => true, + BlockEntryInterface::IS_MAINTAINED => true, + BlockEntryInterface::STORES => ['admin'], + BlockEntryInterface::MEDIA_DIRECTORY => null, + BlockEntryInterface::MEDIA_FILES => [], + ], + 'test.block.2' => [ + BlockEntryInterface::TITLE => 'Test Block 2', + BlockEntryInterface::CONTENT => file_get_contents(__DIR__ . '/content/file-1.html'), + BlockEntryInterface::KEY => 'test.block.2', + BlockEntryInterface::IDENTIFIER => 'test-block-2', + BlockEntryInterface::IS_ACTIVE => true, + BlockEntryInterface::IS_MAINTAINED => false, + BlockEntryInterface::STORES => ['default', 'admin'], + BlockEntryInterface::MEDIA_DIRECTORY => null, + BlockEntryInterface::MEDIA_FILES => [], + ], + 'test.block.3' => [ + BlockEntryInterface::TITLE => 'Block With Images', + BlockEntryInterface::CONTENT => file_get_contents(__DIR__ . '/content/content-with-images-1.html'), + BlockEntryInterface::KEY => 'test.block.3', + BlockEntryInterface::IDENTIFIER => 'test-block-3', + BlockEntryInterface::IS_ACTIVE => true, + BlockEntryInterface::IS_MAINTAINED => true, + BlockEntryInterface::STORES => ['admin'], + BlockEntryInterface::MEDIA_DIRECTORY => __DIR__ . '/content/media', + BlockEntryInterface::MEDIA_FILES => [ + 'image-1.png', + 'some-test-image.png', + 'foobar/test.png', + ], + ], + ], +];