Skip to content

Commit feb48e7

Browse files
committed
Update FlutterwavePlanTest.php for next payment due date
1 parent 4d7b98f commit feb48e7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/Subscription/FlutterwavePlanTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Damms005\LaravelMultipay\Models\PaymentPlan;
66
use Damms005\LaravelMultipay\Services\SubscriptionService;
77
use Damms005\LaravelMultipay\Services\PaymentHandlers\Flutterwave;
8+
use Illuminate\Support\Carbon;
9+
use Illuminate\Support\Facades\DB;
810

911
beforeEach(function () {
1012
config()->set('laravel-multipay.flutterwave.publicKey', 'FLW_PUBLIC_KEY');
@@ -99,8 +101,9 @@
99101
'currency' => 'NGN',
100102
]);
101103

102-
$this->assertDatabaseHas('subscriptions', [
103-
'payment_plan_id' => $plan->id,
104-
'next_payment_due_date' => now()->addMonth()->format('Y-m-d H:i:s'),
105-
]);
104+
$subscription = DB::table('subscriptions')->where('payment_plan_id', $plan->id)->first();
105+
$this->assertEquals(
106+
now()->addMonth()->format('Y-m-d'),
107+
Carbon::parse($subscription->next_payment_due_date)->format('Y-m-d')
108+
);
106109
});

0 commit comments

Comments
 (0)