BaseControllerTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPagination() 0 8 1
A testFilter() 0 6 1
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