FoyerControllerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStatistics() 0 19 1
1
<?php
2
3
namespace Tests\KI\FoyerBundle\Controller;
4
5
use Tests\KI\CoreBundle\WebTestCase;
6
7
class FoyerControllerTest extends WebTestCase
8
{
9
    public function testStatistics()
10
    {
11
        $this->client->request('GET', '/statistics/foyer');
12
        $response = $this->client->getResponse();
13
        $this->assertJsonResponse($response, 200);
14
15
        $this->client->request('GET', '/statistics/foyer/trancara');
16
        $response = $this->client->getResponse();
17
        $this->assertJsonResponse($response, 200);
18
19
        $this->connect('peluchom', 'password');
20
        $this->client->request('POST', '/transactions', ['credit' => 20.5, 'user' => 'trancara']);
21
        $response = $this->client->getResponse();
22
        $this->assertJsonResponse($response, 201);
23
24
        $this->client->request('POST', '/transactions', ['credit' => -20.5, 'user' => 'trancara']);
25
        $response = $this->client->getResponse();
26
        $this->assertJsonResponse($response, 201);
27
    }
28
}
29