public function testGetProductCollection() { $this->registry->expects($this->once())->method('registry')->with($this->equalTo('current_category'))->will($this->returnValue($this->category)); $this->category->expects($this->any())->method('getId')->will($this->returnValue(333)); $this->collectionFilter->expects($this->once())->method('filter')->with($this->equalTo($this->collection), $this->equalTo($this->category)); $this->collectionProvider->expects($this->once())->method('getCollection')->with($this->equalTo($this->category))->will($this->returnValue($this->collection)); $result = $this->model->getProductCollection(); $this->assertInstanceOf('\\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection', $result); $result = $this->model->getProductCollection(); $this->assertInstanceOf('\\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection', $result); }