function Braintree_SubscriptionTest::testValidationErrors_hasValidationErrorsOnId in Commerce Braintree 7
File
- braintree_php/
tests/ integration/ SubscriptionTest.php, line 586
Class
Code
function testValidationErrors_hasValidationErrorsOnId() {
$creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
$plan = Braintree_SubscriptionTestHelper::triallessPlan();
$result = Braintree_Subscription::create(array(
'paymentMethodToken' => $creditCard->token,
'planId' => $plan['id'],
'id' => 'invalid token',
));
$this
->assertFalse($result->success);
$errors = $result->errors
->forKey('subscription')
->onAttribute('id');
$this
->assertEquals(Braintree_Error_Codes::SUBSCRIPTION_TOKEN_FORMAT_IS_INVALID, $errors[0]->code);
}