Passed
Push — master ( 1fb483...35eebd )
by Roman
04:31
created

SuccessResponseTest::testSuccessResponseBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
ccs 0
cts 4
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Crossword\Features\Receiver\Response;
6
7
use App\Crossword\Features\Receiver\Response\HttpStatusCode;
8
use App\Crossword\Features\Receiver\Response\SuccessApiResponse;
9
use Faker\Factory;
0 ignored issues
show
Bug introduced by
The type Faker\Factory 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
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...
11
12
/**
13
 * @coversDefaultClass \App\Crossword\Features\Receiver\Response\SuccessApiResponse
14
 */
15
final class SuccessResponseTest extends TestCase
16
{
17
    /**
18
     * @covers ::status
19
     */
20
    public function testSuccessResponseStatus(): void
21
    {
22
        $response = new SuccessApiResponse();
23
24
        self::assertSame($response->status(), HttpStatusCode::HTTP_OK);
25
    }
26
27
    /**
28
     * @covers ::body
29
     */
30
    public function testSuccessResponseBody(): void
31
    {
32
        $data = ['test' => Factory::create()->word];
33
34
        $response = new SuccessApiResponse($data);
35
36
        self::assertSame($response->body()['data'], $data);
37
    }
38
}
39