Test Failed
Push — master ( 85ca69...144c12 )
by Roman
15:41
created

testSuccessfullyExtractDataFromResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Dictionary\Infrastructure\HttpClient;
6
7
use App\Dictionary\Infrastructure\HttpClient\ResponseDataExtractor;
8
use GuzzleHttp\Psr7\Response;
0 ignored issues
show
Bug introduced by
The type GuzzleHttp\Psr7\Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use PHPUnit\Framework\TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
/**
12
 * @coversDefaultClass \App\Dictionary\Infrastructure\HttpClient\ResponseDataExtractor
13
 */
14
final class ResponseDataExtractorTest extends TestCase
15
{
16
    /**
17
     * @covers ::extract
18
     */
19
    public function testSuccessfullyExtractDataFromResponse(): void
20
    {
21
        $body = ['data' => 'test'];
22
23
        $response = new Response(200, ['Content-Type' => 'application/json'], json_encode($body));
24
        $responseDataExtractor = new ResponseDataExtractor();
25
26
        self::assertSame($responseDataExtractor->extract($response), $body);
27
    }
28
}
29