Passed
Push — master ( 35eebd...7b8a1a )
by Roman
16:45
created

Features/Answers/Response/SuccessResponseTest.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Game\Features\Answers\Response;
6
7
use App\Game\Features\Answers\Response\HttpStatusCode;
8
use App\Game\Features\Answers\Response\SuccessApiResponse;
9
use Faker\Factory;
0 ignored issues
show
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;
11
12
/**
13
 * @coversDefaultClass \App\Game\Features\Answers\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