/**
  * @magentoDataFixture Magento/Catalog/_files/multiple_products.php
  */
 public function testGetListUrl()
 {
     /** @var $empty \Magento\Catalog\Helper\Product\Compare */
     $empty = $this->_objectManager->create('Magento\\Catalog\\Helper\\Product\\Compare');
     $this->assertContains('/catalog/product_compare/index/', $empty->getListUrl());
     $this->_populateCompareList();
     $this->assertRegExp('#/catalog/product_compare/index/items/(?:10,11|11,10)/#', $this->_helper->getListUrl());
 }
示例#2
0
 /**
  * @magentoDataFixture Magento/Catalog/_files/multiple_products.php
  */
 public function testGetListUrl()
 {
     /** @var $empty \Magento\Catalog\Helper\Product\Compare */
     $empty = $this->_objectManager->create('Magento\\Catalog\\Helper\\Product\\Compare');
     $this->assertContains('/catalog/product_compare/index/', $empty->getListUrl());
     $this->_populateCompareList();
     $productRepository = $this->_objectManager->create('Magento\\Catalog\\Api\\ProductRepositoryInterface');
     $id1 = $productRepository->get('simple1')->getId();
     $id2 = $productRepository->get('simple2')->getId();
     $this->assertRegExp('#/catalog/product_compare/index/items/(?:' . $id1 . ',' . $id2 . '|' . $id2 . ',' . $id1 . ')/#', $this->_helper->getListUrl());
 }
 /**
  * {@inheritdoc}
  */
 public function getSectionData()
 {
     $count = $this->helper->getItemCount();
     return ['count' => $count, 'countCaption' => $count == 1 ? __('1 item') : __('%1 items', $count), 'listUrl' => $this->helper->getListUrl(), 'items' => $count ? $this->getItems() : []];
 }