/** * @depends testGet * @param $createProfileResponse CreateProfileResponse */ public function testDelete($createProfileResponse) { $webProfile = new WebProfile(); $webProfile->setId($createProfileResponse->getId()); $result = $webProfile->delete(null, $this->mockPayPalRestCall); $this->assertTrue($result); }
function delete_profile($id) { // auth $apiContext = $this->apiContext(); // set WebProfile $webProfile = new WebProfile(); $webProfile->setId($id); try { $webProfile->delete($apiContext); $valid = true; } catch (Exception $ex) { $this->LoggingManager->log(print_r($ex, true), 'DEBUG'); $valid = false; } if ($id == $this->get_config('PAYPAL_STANDARD_PROFILE')) { $this->delete_config('PAYPAL_STANDARD_PROFILE'); } $this->delete_config($id, 'config_value'); }
/** * @dataProvider mockProvider * @param WebProfile $obj */ public function testDelete($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(true)); $result = $obj->delete($mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }
public function deleteCustomRecord($parameters) { $webProfile = new WebProfile(); $webProfile->setId($parameters['id']); try { $webProfile->delete($this->apiContext); } catch (PayPalConnectionException $e) { dd($e); } }