public function testGetCategoryWithAppliedId()
 {
     $storeId = 1234;
     $categoryId = 4321;
     $this->store->expects($this->once())->method('getId')->will($this->returnValue($storeId));
     $this->layer->expects($this->any())->method('getCurrentCategory')->will($this->returnValue($this->category));
     $this->category->expects($this->once())->method('setStoreId')->with($this->equalTo($storeId))->will($this->returnSelf());
     $this->category->expects($this->once())->method('load')->with($this->equalTo($categoryId))->will($this->returnSelf());
     $this->category->expects($this->any())->method('getId')->will($this->returnValue($categoryId));
     $this->category->expects($this->any())->method('getPathIds')->will($this->returnValue([20, 10]));
     $this->coreRegistry->expects($this->once())->method('register')->with($this->equalTo('current_category_filter'), $this->equalTo($this->category), $this->equalTo(true))->will($this->returnSelf());
     $this->target->setCategoryId($categoryId);
     $this->assertSame($this->category, $this->target->getCategory());
     $this->assertSame(20, $this->target->getResetValue());
     return $this->target;
 }
Example #2
0
 /**
  * Get filter value for reset current filter state
  *
  * @return mixed|null
  */
 public function getResetValue()
 {
     return $this->dataProvider->getResetValue();
 }