1 | <?php namespace Pixelpeter\Genderize\Test; |
||
2 | |||
3 | use Carbon\Carbon; |
||
4 | use Pixelpeter\Genderize\Models\Meta; |
||
5 | |||
6 | class MetaTest extends \PHPUnit\Framework\TestCase |
||
7 | { |
||
8 | /** |
||
9 | * @var \Pixelpeter\Genderize\Models\Meta |
||
10 | */ |
||
11 | protected $meta; |
||
12 | |||
13 | /** |
||
14 | * Set up |
||
15 | */ |
||
16 | public function setUp() |
||
17 | { |
||
18 | $data = (object) [ |
||
19 | 'code' => 200, |
||
20 | 'headers' => [ |
||
21 | 'X-Rate-Limit-Limit' => 7000, |
||
22 | 'X-Rate-Limit-Remaining' => 1000, |
||
23 | 'X-Rate-Reset' => 0 |
||
24 | ] |
||
25 | ]; |
||
26 | |||
27 | $this->meta = new Meta($data); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * Check data is set correctly |
||
32 | * |
||
33 | * @test |
||
34 | */ |
||
35 | public function data_is_set_correctly() |
||
36 | { |
||
37 | $this->assertSame(200, $this->meta->code); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
38 | $this->assertSame(7000, $this->meta->limit); |
||
0 ignored issues
–
show
The property
$limit is declared protected in Pixelpeter\Genderize\Models\Meta . Since you implement __get , consider adding a @property or @property-read.
Loading history...
|
|||
39 | $this->assertSame(1000, $this->meta->remaining); |
||
0 ignored issues
–
show
The property
$remaining is declared protected in Pixelpeter\Genderize\Models\Meta . Since you implement __get , consider adding a @property or @property-read.
Loading history...
|
|||
40 | $this->assertInstanceOf('Carbon\Carbon', $this->meta->reset); |
||
0 ignored issues
–
show
The property
$reset is declared protected in Pixelpeter\Genderize\Models\Meta . Since you implement __get , consider adding a @property or @property-read.
Loading history...
|
|||
41 | $this->assertSame(Carbon::now()->toDateTimeString(), $this->meta->reset->toDateTimeString()); |
||
42 | } |
||
43 | } |
||
44 |