public function testCollectDoesNotCalculateTaxIfThereIsNoItemsRelatedToGivenAddress() { $storeId = 1; $storeMock = $this->getMockObject('Magento\\Store\\Model\\Store', ['store_id' => $storeId]); $quoteMock = $this->getMockObject('Magento\\Quote\\Model\\Quote', ['store' => $storeMock]); $addressMock = $this->getMockObject('Magento\\Quote\\Model\\Quote\\Address', ['all_items' => [], 'shipping_tax_calculation_amount' => 100, 'base_shipping_tax_calculation_amount' => 200, 'shipping_discount_amount' => 10, 'base_shipping_discount_amount' => 20, 'quote' => $quoteMock]); $this->taxCalculationMock->expects($this->never())->method('calculateTax'); $this->model->collect($addressMock); }