getMockBuilder( \Magento\Payment\Model\MethodInterface::class )->disableOriginalConstructor()->setMethods([])->getMock(); $paymentMethod->expects($this->at(0))->method('getConfigData')->with( TotalMinMax::MIN_ORDER_TOTAL )->will($this->returnValue(self::PAYMENT_MIN_TOTAL)); $paymentMethod->expects($this->at(1))->method('getConfigData')->with( TotalMinMax::MAX_ORDER_TOTAL )->will($this->returnValue(self::PAYMENT_MAX_TOTAL)); $quote = $this->getMockBuilder(\Magento\Quote\Model\Quote::class)->disableOriginalConstructor()->setMethods( ['getBaseGrandTotal', '__wakeup'] )->getMock(); $quote->expects($this->once())->method('getBaseGrandTotal')->will($this->returnValue($baseGrandTotal)); $model = new TotalMinMax(); $this->assertEquals($expectation, $model->isApplicable($paymentMethod, $quote)); } /** * @return array */ public function paymentMethodDataProvider() { return [[1, false], [6, false], [3, true]]; } }