Example #1
0
 public function testPrepareSortableFieldsByCategory()
 {
     /** @var $category \Magento\Catalog\Model\Category */
     $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Category');
     $category->setDefaultSortBy('name');
     $this->_block->prepareSortableFieldsByCategory($category);
     $this->assertEquals('name', $this->_block->getSortBy());
 }
 /**
  * {@inheritdoc}
  */
 public function prepareSortableFieldsByCategory($category)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'prepareSortableFieldsByCategory');
     if (!$pluginInfo) {
         return parent::prepareSortableFieldsByCategory($category);
     } else {
         return $this->___callPlugins('prepareSortableFieldsByCategory', func_get_args(), $pluginInfo);
     }
 }