Test Failed
Pull Request — master (#50)
by David
03:23
created

PaginationTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace FlexyProject\GitHub\Tests;
4
5
use FlexyProject\GitHub\Client;
6
use FlexyProject\GitHub\Pagination;
7
use FlexyProject\GitHub\Receiver\Activity;
8
9
/**
10
 * Class PaginationTest
11
 *
12
 * @package FlexyProject\GitHub\Tests
13
 */
14
class PaginationTest extends AbstractClientTest
15
{
16
17
    /** @var Pagination */
18
    protected $pagination;
19
20
    public function setUp()
21
    {
22
        $this->pagination = new Pagination();
23
        $this->client->setPagination($this->pagination);
24
    }
25
26
    public function testInstanceOf()
27
    {
28
        self::assertInstanceOf(Pagination::class, $this->pagination);
29
    }
30
31 View Code Duplication
    public function testPage()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        $this->pagination->setLimit(10);
34
        $this->pagination->setPage(2);
35
        self::assertEquals(2, $this->pagination->getPage());
36
37
        $activity = $this->client->getReceiver(Client::ACTIVITY);
38
        $events   = $activity->getReceiver(Activity::EVENTS);
39
        self::assertCount(10, $events->listPublicEvents());
40
    }
41
42 View Code Duplication
    public function testLimit()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
    {
44
        $this->pagination->setLimit(10);
45
        self::assertEquals(10, $this->pagination->getLimit());
46
47
        $activity = $this->client->getReceiver(Client::ACTIVITY);
48
        $events   = $activity->getReceiver(Activity::EVENTS);
49
        self::assertCount(10, $events->listPublicEvents());
50
    }
51
}