41 $this->_observer = new \Magento\Framework\Event\Observer();
42 $this->_observer->setEvent($this->_event);
44 $this->_authorization = $this->getMockForAbstractClass(\
Magento\Framework\AuthorizationInterface::class);
46 $this->_model = new \Magento\Paypal\Observer\RestrictAdminBillingAgreementUsageObserver($this->_authorization);
55 [new \stdClass(),
false,
true],
57 $this->getMockForAbstractClass(
58 \
Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::class,
67 $this->getMockForAbstractClass(
68 \
Magento\Paypal\Model\Payment\Method\Billing\AbstractAgreement::class,
87 $this->_event->setMethodInstance($methodInstance);
88 $this->_authorization->expects(
98 $result->setData(
'is_available',
true);
99 $this->_event->setResult(
$result);
100 $this->_model->execute($this->_observer);
101 $this->assertEquals($isAvailable,
$result->getData(
'is_available'));
restrictAdminBillingAgreementUsageDataProvider()
testExecute($methodInstance, $isAllowed, $isAvailable)