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

SuccessResponseTest::testSuccessResponseStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Game\Application\Response;
6
7
use App\Game\Application\Enum\HttpStatusCode;
8
use App\Game\Application\Response\API\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\Game\Application\Response\API\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