private function getOptions() { $this->product->expects($this->once())->method('getStoreId')->will($this->returnValue($this->storeId)); $this->product->expects($this->any())->method('getTypeInstance')->will($this->returnValue($this->productType)); $this->productType->expects($this->once())->method('setStoreFilter')->with($this->equalTo($this->storeId), $this->equalTo($this->product)); $this->productType->expects($this->once())->method('getOptionsCollection')->with($this->equalTo($this->product))->will($this->returnValue($this->optionCollection)); }
public function getRemoveOptions() { $this->product->expects($this->any())->method('getTypeInstance')->will($this->returnValue($this->productType)); $this->product->expects($this->once())->method('getStoreId')->will($this->returnValue(1)); $this->productType->expects($this->once())->method('setStoreFilter'); $this->productType->expects($this->once())->method('getOptionsCollection')->with($this->equalTo($this->product))->will($this->returnValue($this->optionCollection)); $this->productType->expects($this->once())->method('getOptionsIds')->with($this->equalTo($this->product))->will($this->returnValue([1, 2, 3])); $this->productType->expects($this->once())->method('getSelectionsCollection')->will($this->returnValue([])); $this->optionCollection->expects($this->any())->method('appendSelections')->with($this->equalTo([]))->will($this->returnValue([$this->option])); }