Skip to content

Commit

Permalink
Add test for trialing while invoicing
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Feb 22, 2021
1 parent 1349812 commit 852dfe5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Feature/SubscriptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,21 @@ public function test_subscription_changes_can_be_prorated()
$this->assertEquals(0, $user->upcomingInvoice()->rawTotal());
}

public function test_trial_remains_when_customer_is_invoiced_immediately_on_swap()
{
$user = $this->createCustomer('trial_remains_when_customer_is_invoiced_immediately_on_swap');

$subscription = $user->newSubscription('main', static::$planId)
->trialDays(5)
->create('pm_card_visa');

$this->assertTrue($subscription->onTrial());

$subscription = $subscription->swapAndInvoice(static::$otherPlanId);

$this->assertTrue($subscription->onTrial());
}

public function test_no_prorate_on_subscription_create()
{
$user = $this->createCustomer('no_prorate_on_subscription_create');
Expand Down

0 comments on commit 852dfe5

Please sign in to comment.