Skip to content

Commit

Permalink
Add failing test for #1646
Browse files Browse the repository at this point in the history
  • Loading branch information
skeemer committed Feb 4, 2024
1 parent 88d6f6c commit 7e3de19
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/Feature/SubscriptionsWithMultiplePricesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,23 @@ public function test_subscription_item_quantity_changes_can_be_prorated()
$this->assertEquals(2000, $user->upcomingInvoice()->rawTotal());
}

public function test_subscription_item_quantity_change_can_be_thrown()
{
$user = $this->createCustomer('subscription_item_quantity_change_can_be_thrown');

$subscription = $user->newSubscription('main', [self::$priceId, self::$otherPriceId])
->quantity(1, self::$otherPriceId)
->create('pm_card_visa');

$this->assertEquals(2000, ($invoice1 = $user->invoices()->first())->rawTotal());

$user->updateDefaultPaymentMethod('pm_card_chargeCustomerFail');

$this->expectException(\Stripe\Exception\CardException::class);

$subscription->errorIfPaymentFails()->alwaysInvoice()->updateQuantity(2, self::$otherPriceId);
}

/**
* Create a subscription with a single price.
*
Expand Down

0 comments on commit 7e3de19

Please sign in to comment.