FoyerControllerTest::testStatistics()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 0
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