You are here

function Braintree_SubscriptionTest::testUpdate_validationErrors in Commerce Braintree 7

File

braintree_php/tests/integration/SubscriptionTest.php, line 735

Class

Braintree_SubscriptionTest

Code

function testUpdate_validationErrors() {
  $subscription = Braintree_SubscriptionTestHelper::createSubscription();
  $result = Braintree_Subscription::update($subscription->id, array(
    'price' => '',
  ));
  $this
    ->assertFalse($result->success);
  $errors = $result->errors
    ->forKey('subscription')
    ->onAttribute('price');
  $this
    ->assertEquals(Braintree_Error_Codes::SUBSCRIPTION_PRICE_CANNOT_BE_BLANK, $errors[0]->code);
}