Completed
Push — master ( 99411a...99411a )
by Hugo
30s queued 10s
created

StatisticsTest::testDid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
c 0
b 0
f 0
rs 9.52
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yproximite\WannaSpeakBundle\Tests\Api;
6
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\HttpClient\Response\MockResponse;
9
use Yproximite\WannaSpeakBundle\Api\Statistics;
10
use Yproximite\WannaSpeakBundle\Tests\HttpClientTestTrait;
11
12
class StatisticsTest extends TestCase
13
{
14
    use HttpClientTestTrait;
15
16
    public function testDid(): void
17
    {
18
        $statistics = new Statistics(
19
            $this->createHttpClient(new MockResponse(
20
                (string) json_encode($responseData = [
21
                    'error' => null,
22
                    'data'  => [
23
                        'calls' => [
24
                            [
25
                                'starttime' => '2020-01-01 16:28:49',
26
                                'source'    => 'unknown',
27
                                'duration'  => 30,
28
                                // ...
29
                            ],
30
                        ],
31
                    ],
32
                ])
33
            ))
34
        );
35
36
        static::assertSame(
37
            $responseData,
38
            $statistics->did()
39
        );
40
    }
41
}
42