Skip to content

Commit 9cd20c0

Browse files
committed
Update the toolbar coverage test to use the a layout toolbar declaration present in default layout. Remove the previews correction made because it's not solve the problem where is checking if the toolbar HTML is not empty.
1 parent b6ed2d9 commit 9cd20c0

File tree

1 file changed

+3
-3
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Block/Product

1 file changed

+3
-3
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ public function testToolbarCoverage()
5555
$parent = $this->_getLayout()->createBlock(\Magento\Catalog\Block\Product\ListProduct::class, 'parent');
5656

5757
/* Prepare toolbar block */
58+
$this->_getLayout()->createBlock(\Magento\Catalog\Block\Product\ProductList\Toolbar::class, 'product_list_toolbar');
59+
$parent->setToolbarBlockName('product_list_toolbar');
60+
5861
$toolbar = $parent->getToolbarBlock();
5962
$this->assertInstanceOf(\Magento\Catalog\Block\Product\ProductList\Toolbar::class, $toolbar, 'Default Toolbar');
6063

6164
$parent->setChild('toolbar', $toolbar);
6265
/* In order to initialize toolbar collection block toHtml should be called before toolbar toHtml */
6366
$this->assertEmpty($parent->toHtml(), 'Block HTML'); /* Template not specified */
6467
$this->assertEquals('grid', $parent->getMode(), 'Default Mode'); /* default mode */
65-
66-
/* In order to use toolbar html you need a collection to be set to toolbar block */
67-
$parent->getToolbarBlock()->setCollection($parent->getLoadedProductCollection());
6868
$this->assertNotEmpty($parent->getToolbarHtml(), 'Toolbar HTML'); /* toolbar for one simple product */
6969
}
7070

0 commit comments

Comments
 (0)