|
8 | 8 |
|
9 | 9 | use function Spatie\PestPluginTestTime\testTime; |
10 | 10 |
|
11 | | -it('can create model with default expiration', function ($model, $expiresAt, $deletesAt) { |
| 11 | +it('can create model with default expiration', function (string $model, ?int $expiresAt, ?int $deletesAt) { |
12 | 12 | testTime()->freeze(); |
13 | 13 |
|
14 | 14 | $model::factory()->count(5)->create(); |
|
39 | 39 | ], |
40 | 40 | ]); |
41 | 41 |
|
42 | | -it('can set expires_at', function ($model, $index, $days, $default) { |
| 42 | +it('can set expires_at', function (string $model, int $index, int $days, ?Carbon $default) { |
43 | 43 | $users = $model::factory()->count(3)->create(); |
44 | 44 |
|
45 | 45 | $expirations = Expiration::get(); |
|
70 | 70 | ['model' => Tenant::class, 'index' => 2, 'days' => -10, 'default' => fn () => now()->startOfDay()->addDays(365)], |
71 | 71 | ]); |
72 | 72 |
|
73 | | -it('can get expires_at', function ($model, $index, $days, $default) { |
| 73 | +it('can get expires_at', function (string $model, int $index, int $days, ?Carbon $default) { |
74 | 74 | testTime()->freeze(); |
75 | 75 |
|
76 | 76 | $users = $model::factory()->count(3)->create(); |
|
100 | 100 | ['model' => Tenant::class, 'index' => 2, 'days' => -10, 'default' => fn () => now()->startOfDay()->addDays(365)], |
101 | 101 | ]); |
102 | 102 |
|
103 | | -it('can get isExpired', function ($model, $index, $months) { |
| 103 | +it('can get isExpired', function (string $model, int $index, int $months) { |
104 | 104 | testTime()->freeze(); |
105 | 105 |
|
106 | 106 | $users = $model::factory()->count(3)->create(); |
|
128 | 128 | ['model' => Tenant::class, 'index' => 2, 'months' => 10], |
129 | 129 | ]); |
130 | 130 |
|
131 | | -it('can get getDaysLeftToExpiration', function ($model, $index, $days, $default, $remainingIndex, $remaining) { |
| 131 | +it('can get getDaysLeftToExpiration', function (string $model, int $index, int $days, ?int $default, int $remainingIndex, ?int $remaining) { |
132 | 132 | testTime()->freeze(); |
133 | 133 |
|
134 | 134 | $users = $model::factory()->count(3)->create(); |
|
155 | 155 | ['model' => Tenant::class, 'index' => 2, 'days' => 10, 'default' => 365, 'remaining' => 6, 'remainingIndex' => fn () => 361], |
156 | 156 | ]); |
157 | 157 |
|
158 | | -it('can get canExpire', function ($model, $index, $days, $default) { |
| 158 | +it('can get canExpire', function (string $model, int $index, int $days, bool $default) { |
159 | 159 | testTime()->freeze(); |
160 | 160 |
|
161 | 161 | $users = $model::factory()->count(3)->create(); |
|
0 commit comments