Total Complexity | 2 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | use Pixelpeter\Genderize\Models\Meta; |
||
7 | |||
8 | class MetaTest extends \PHPUnit\Framework\TestCase |
||
9 | { |
||
10 | /** |
||
11 | * @var \Pixelpeter\Genderize\Models\Meta |
||
12 | */ |
||
13 | protected $meta; |
||
14 | |||
15 | /** |
||
16 | * Set up |
||
17 | */ |
||
18 | protected function setUp(): void |
||
19 | { |
||
20 | $data = (object) [ |
||
21 | 'code' => 200, |
||
22 | 'headers' => [ |
||
23 | 'X-Rate-Limit-Limit' => 7000, |
||
24 | 'X-Rate-Limit-Remaining' => 1000, |
||
25 | 'X-Rate-Reset' => 0, |
||
26 | ], |
||
27 | ]; |
||
28 | |||
29 | $this->meta = new Meta($data); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Check data is set correctly |
||
34 | * |
||
35 | * @test |
||
36 | */ |
||
37 | public function data_is_set_correctly() |
||
38 | { |
||
39 | $this->assertSame(200, $this->meta->code); |
||
40 | $this->assertSame(7000, $this->meta->limit); |
||
41 | $this->assertSame(1000, $this->meta->remaining); |
||
42 | $this->assertInstanceOf('Carbon\Carbon', $this->meta->reset); |
||
46 |