/** * @dataProvider mockProvider * @param Agreement $obj */ public function testExecute($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson())); $result = $obj->execute("123123", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }
/** * Execute agreement * @param $token * @return Agreement */ function execute($token) { $agreement = new Agreement(); return $agreement->execute($token, $this->getAdapter()->getApiContext()); }