Skip to content

Commit f6762a5

Browse files
committed
wip
1 parent 0497786 commit f6762a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Feature/HasLimitsTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,18 @@ public function test_model_can_consume_multiple_limits(): void
178178
$this->assertEquals(2.0, $this->user->remainingLimit($productLimit->name, $productLimit->plan));
179179
}
180180

181+
public function test_exception_is_thrown_if_model_consumes_zero_limits(): void
182+
{
183+
$limit = $this->createLimit();
184+
185+
$this->user->setLimit($limit->name, $limit->plan);
186+
187+
$this->assertException(
188+
fn () => $this->user->useLimit($limit->name, $limit->plan, 0),
189+
UsedAmountShouldBePositiveIntAndLessThanAllowedAmount::class
190+
);
191+
}
192+
181193
public function test_exception_is_thrown_if_model_consumes_unavailable_limits(): void
182194
{
183195
$limit = $this->createLimit();

0 commit comments

Comments
 (0)