27 $this->_registry = $this->createMock(\
Magento\Framework\Registry::class);
28 $this->_agreementResource = $this->createMock(\
Magento\Paypal\Model\
ResourceModel\Billing\Agreement::class);
30 $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
31 $this->_model =
$helper->getObject(
32 \
Magento\Paypal\Model\Billing\Agreement\OrdersUpdater::class,
33 [
'coreRegistry' => $this->_registry,
'agreementResource' => $this->_agreementResource]
42 $this->_registry->expects(
47 'current_billing_agreement' 52 $agreement->expects($this->once())->method(
'getId')->will($this->returnValue(
'agreement id'));
53 $this->_agreementResource->expects(
58 $this->identicalTo($argument),
62 $this->assertSame($argument, $this->_model->update($argument));
70 $this->_registry->expects(
75 'current_billing_agreement' 77 $this->returnValue(
null)
80 $this->_model->update(
'any argument');
testUpdateWhenBillingAgreementIsNotSet()