BaseControllerTest::testPagination()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Tests\KI\CoreBundle\Controller;
4
5
use Tests\KI\CoreBundle\WebTestCase;
6
7
// Tests généraux à toutes les classes
8
class BaseControllerTest extends WebTestCase
9
{
10
    public function testPagination()
11
    {
12
        $this->client->request('GET', '/clubs?page=1&limit=10&sort=-fullName');
13
        $response = $this->client->getResponse();
14
        $this->assertJsonResponse($response, 200);
15
        $this->assertTrue($response->headers->has('Links'), $response->headers);
16
        $this->assertTrue($response->headers->has('Total-count'), $response->headers);
17
    }
18
19
    public function testFilter()
20
    {
21
        $this->client->request('GET', '/courses/mecanique-des-structures/exercices?department=1A&sort=semester,-startDate');
22
        $response = $this->client->getResponse();
23
        $this->assertJsonResponse($response, 200);
24
    }
25
}
26