@@ -48,41 +48,7 @@ protected function setUp()
4848 ->create (\Magento \CatalogSearch \Model \Layer \Filter \Decimal::class, ['layer ' => $ layer ]);
4949 $ this ->_model ->setAttributeModel ($ attribute );
5050 }
51-
52- /**
53- * Test the product collection returns the correct number of items after the filter is applied.
54- *
55- * @magentoDataFixture Magento/Catalog/Model/Layer/Filter/_files/attribute_special_price_filterable.php
56- * @magentoDataFixture Magento/Catalog/_files/multiple_visible_products.php
57- * @magentoDbIsolation disabled
58- */
59- public function testApplyProductCollection ()
60- {
61- /** @var $objectManager \Magento\TestFramework\ObjectManager */
62- $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
63- $ category = $ objectManager ->create (\Magento \Catalog \Model \Category::class);
64- $ category ->load (100 );
65- $ this ->_model ->getLayer ()->setCurrentCategory ($ category );
66-
67- /** @var $attribute \Magento\Catalog\Model\Entity\Attribute */
68- $ attribute = $ objectManager ->create (\Magento \Catalog \Model \Entity \Attribute::class);
69- $ attribute ->loadByCode ('catalog_product ' , 'special_price ' );
70- $ this ->_model ->setAttributeModel ($ attribute );
71-
72- /** @var $objectManager \Magento\TestFramework\ObjectManager */
73- $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
74- /** @var $request \Magento\TestFramework\Request */
75- $ request = $ objectManager ->get (\Magento \TestFramework \Request::class);
76- $ request ->setParam ('special_price ' , '10-20 ' );
77- $ result = $ this ->_model ->apply ($ request );
78- $ collection = $ this ->_model ->getLayer ()->getProductCollection ();
79- $ size = $ collection ->getSize ();
80- $ this ->assertEquals (
81- 1 ,
82- $ size
83- );
84- }
85-
51+
8652 /**
8753 * Test the filter label is correct
8854 */
0 commit comments