public function testUpdate() { $agreement = $this->getMock('Magento\\Paypal\\Model\\Billing\\Agreement', array(), array(), '', false); $argument = $this->getMock('Magento\\Sales\\Model\\Resource\\Order\\Collection', array(), array(), '', false); $this->_registry->expects($this->once())->method('registry')->with('current_billing_agreement')->will($this->returnValue($agreement)); $agreement->expects($this->once())->method('getId')->will($this->returnValue('agreement id')); $this->_agreementResource->expects($this->once())->method('addOrdersFilter')->with($this->identicalTo($argument), 'agreement id'); $this->assertSame($argument, $this->_model->update($argument)); }