function testDelete() { $paymentMethodToken = 'PAYPALToken-' . strval(rand()); $customer = Braintree_Customer::createNoValidate(); $http = new Braintree_HttpClientApi(Braintree_Configuration::$global); $nonce = $http->nonceForPayPalAccount(array('paypal_account' => array('consent_code' => 'PAYPAL_CONSENT_CODE', 'token' => $paymentMethodToken))); Braintree_PaymentMethod::create(array('customerId' => $customer->id, 'paymentMethodNonce' => $nonce)); Braintree_PayPalAccount::delete($paymentMethodToken); $this->setExpectedException('Braintree_Exception_NotFound'); Braintree_PayPalAccount::find($paymentMethodToken); }