Code Duplication    Length = 21-21 lines in 2 locations

Test/Unit/Model/Inventory/StockbaseStockManagementTest.php 2 locations

@@ 194-214 (lines=21) @@
191
    /**
192
     * testGetReserveForProduct
193
     */
194
    public function testGetReserveForProduct()
195
    {
196
        $reserveCollection = $this->createMock(StockItemReserveCollection::class);
197
        
198
        $this->objectManager->expects($this->once())->method('create')
199
            ->with(StockItemReserveCollection::class)
200
            ->willReturn($reserveCollection);
201
202
        $reserve = $this->createMock(StockItemReserve::class);
203
        
204
        $reserveCollection->expects($this->any())->method('addFieldToFilter')
205
            ->with('product_id', ['in' => [101]]);
206
        
207
        $reserveCollection->expects($this->once())->method('getItems')
208
            ->willReturn([$reserve]);
209
        
210
        $model = $this->createModel();
211
        $result = $model->getReserveForProduct(101);
212
        
213
        $this->assertEquals([$reserve], $result);
214
    }
215
216
    /**
217
     * testGetReserveForQuoteItem
@@ 219-239 (lines=21) @@
216
    /**
217
     * testGetReserveForQuoteItem
218
     */
219
    public function testGetReserveForQuoteItem()
220
    {
221
        $reserveCollection = $this->createMock(StockItemReserveCollection::class);
222
        
223
        $this->objectManager->expects($this->once())->method('create')
224
            ->with(StockItemReserveCollection::class)
225
            ->willReturn($reserveCollection);
226
227
        $reserve = $this->createMock(StockItemReserve::class);
228
        
229
        $reserveCollection->expects($this->any())->method('addFieldToFilter')
230
            ->with('quote_item_id', ['in' => [101]]);
231
        
232
        $reserveCollection->expects($this->once())->method('getItems')
233
            ->willReturn([$reserve]);
234
        
235
        $model = $this->createModel();
236
        $result = $model->getReserveForQuoteItem(101);
237
            
238
        $this->assertEquals([$reserve], $result);
239
    }
240
    
241
    protected function createModel()
242
    {