QuotaExceededTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 3
c 1
b 0
f 1
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A sets_message() 0 5 1
1
<?php
2
3
namespace Zenstruck\Governator\Tests\Unit\Exception;
4
5
use PHPUnit\Framework\TestCase;
6
use Zenstruck\Governator\Counter;
7
use Zenstruck\Governator\Exception\QuotaExceeded;
8
use Zenstruck\Governator\Key;
9
use Zenstruck\Governator\Quota;
10
11
/**
12
 * @group time-sensitive
13
 *
14
 * @author Kevin Bond <[email protected]>
15
 */
16
final class QuotaExceededTest extends TestCase
17
{
18
    /**
19
     * @test
20
     */
21
    public function sets_message(): void
22
    {
23
        $exception = new QuotaExceeded(new Quota(new Key('foo', 10, 60), new Counter(12, time() + 9)));
24
25
        $this->assertSame('Quota Exceeded (12/10), resets in 9 seconds.', $exception->getMessage());
26
    }
27
}
28