Completed
Pull Request — master (#13)
by
unknown
02:14
created

PaginationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A itProvidePaginationLinks() 0 6 1
A itProvidePaginationMetadata() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ElevenLabs\Api\Service\Tests\Pagination;
6
7
use ElevenLabs\Api\Service\Pagination\Pagination;
8
use ElevenLabs\Api\Service\Pagination\PaginationLinks;
9
use PHPUnit\Framework\TestCase;
10
11
/**
12
 * Class PaginationTest.
13
 */
14
class PaginationTest extends TestCase
15
{
16
    /** @test */
17
    public function itProvidePaginationMetadata()
18
    {
19
        $pagination = new Pagination(2, 20, 100, 5);
20
21
        $this->assertSame(2, $pagination->getPage());
22
        $this->assertSame(20, $pagination->getPerPage());
23
        $this->assertSame(100, $pagination->getTotalItems());
24
        $this->assertSame(5, $pagination->getTotalPages());
25
        $this->assertFalse($pagination->hasLinks());
26
    }
27
28
    /** @test */
29
    public function itProvidePaginationLinks()
30
    {
31
        $links = $this->prophesize(PaginationLinks::class);
32
        $pagination = new Pagination(2, 20, 100, 5, $links->reveal());
33
34
        $this->assertInstanceOf(PaginationLinks::class, $pagination->getLinks());
35
    }
36
}
37