public function testAroundRenderFalse()
 {
     $attributeMock = $this->getMock('\\Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute', [], [], '', false);
     $this->filterMock->expects($this->atLeastOnce())->method('getAttributeModel')->willReturn($attributeMock);
     $this->filterMock->expects($this->once())->method('hasAttributeModel')->willReturn(true);
     $this->swatchHelperMock->expects($this->once())->method('isSwatchAttribute')->with($attributeMock)->willReturn(false);
     $result = $this->plugin->aroundRender($this->filterRendererMock, $this->closureMock, $this->filterMock);
     $this->assertEquals($result, $this->filterMock);
 }
示例#2
0
 public function testApply()
 {
     $stateKey = 'sk';
     $this->registry->expects($this->once())->method('registry')->with($this->equalTo('current_category'))->will($this->returnValue($this->category));
     $this->stateKeyGenerator->expects($this->once())->method('toString')->with($this->equalTo($this->category))->will($this->returnValue($stateKey));
     $this->state->expects($this->any())->method('getFilters')->will($this->returnValue([$this->filter]));
     $this->filter->expects($this->once())->method('getFilter')->will($this->returnValue($this->abstractFilter));
     $this->filter->expects($this->once())->method('getValueString')->will($this->returnValue('t'));
     $this->abstractFilter->expects($this->once())->method('getRequestVar')->will($this->returnValue('t'));
     $result = $this->model->apply();
     $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Layer', $result);
 }