Skip to content

Commit ad29f41

Browse files
committed
Merge branch 'ACP2E-3490' of https://github.com/adobe-commerce-tier-4/magento2-page-builder into PR-12-05-2024
2 parents 0b30769 + a9b290b commit ad29f41

File tree

1 file changed

+38
-2
lines changed
  • dev/tests/integration/testsuite/Magento/PageBuilder/CatalogWidget/Block/Product

1 file changed

+38
-2
lines changed

dev/tests/integration/testsuite/Magento/PageBuilder/CatalogWidget/Block/Product/ProductListTest.php

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -10,7 +10,10 @@
1010
use Magento\Catalog\Api\Data\CategoryInterface;
1111
use Magento\CatalogWidget\Block\Product\ProductsList;
1212
use Magento\Store\Model\Store;
13+
use Magento\TestFramework\Fixture\AppArea;
14+
use Magento\TestFramework\Fixture\Config;
1315
use Magento\TestFramework\Helper\Bootstrap;
16+
use Magento\Widget\Model\Template\Filter;
1417
use PHPUnit\Framework\TestCase;
1518

1619
/**
@@ -291,4 +294,37 @@ public static function categoryFilterAndSortDataProvider(): array
291294
]
292295
];
293296
}
297+
298+
#[
299+
AppArea('frontend'),
300+
Config('dev/template/minify_html', 1, 'store', 'default')
301+
]
302+
public function testWidgetWithMinification()
303+
{
304+
/** @var Filter $filter */
305+
$filter = Bootstrap::getObjectManager()->create(
306+
Filter::class
307+
);
308+
$notExistedSku = uniqid();
309+
$construction = [
310+
0 => '{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" ' .
311+
'template="Magento_PageBuilder::catalog/product/widget/content/carousel.phtml" anchor_text="" ' .
312+
'id_path="" show_pager="0" products_count="20" condition_option="sku" condition_option_value="' .
313+
$notExistedSku . '" ' .
314+
'type_name="Catalog Products Carousel" conditions_encoded="^[`1`:^[`aggregator`:`all`,`new_child`:``,' .
315+
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`value`:`1`^],`1--1`:' .
316+
'^[`operator`:`()`,`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`' .
317+
',`value`:`' . $notExistedSku . '`^]^]" sort_order="position_by_sku" store_id="0"}}',
318+
1 => 'widget',
319+
2 => 'type="Magento\CatalogWidget\Block\Product\ProductsList" ' .
320+
'template="Magento_PageBuilder::catalog/product/widget/content/carousel.phtml" anchor_text="" ' .
321+
'id_path="" show_pager="0" products_count="20" condition_option="sku" condition_option_value="' .
322+
$notExistedSku . '" ' .
323+
'type_name="Catalog Products Carousel" conditions_encoded="^[`1`:^[`aggregator`:`all`,`new_child`:``,' .
324+
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`value`:`1`^],`1--1`:' .
325+
'^[`operator`:`()`,`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:' .
326+
'`sku`,`value`:`' . $notExistedSku . '`^]^]" sort_order="position_by_sku" store_id="0"'
327+
];
328+
$this->assertEquals('', $filter->generateWidget($construction));
329+
}
294330
}

0 commit comments

Comments
 (0)