Failed Conditions
Pull Request — master (#11)
by Adrien
15:48 queued 12:33
created

tests/Log/Writer/DbTest.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Log\Writer;
6
7
use Ecodev\Felix\Log\EventCompleter;
8
use Ecodev\Felix\Log\Writer\Db;
1 ignored issue
show
The type Ecodev\Felix\Log\Writer\Db 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 Ecodev\Felix\Repository\LogRepository;
10
use PHPUnit\Framework\TestCase;
11
12
class DbTest extends TestCase
13
{
14
    public function testWriteCompletedEventInDb(): void
15
    {
16
        $event = ['message' => 'original'];
17
        $completedEvent = ['message' => 'completed'];
18
19
        $logRepository = self::createMock(LogRepository::class);
20
        $logRepository->expects(self::once())
21
            ->method('log')
22
            ->with($completedEvent);
23
24
        $eventCompleter = self::createMock(EventCompleter::class);
25
        $eventCompleter->expects(self::once())
26
            ->method('process')
27
            ->with($event)
28
            ->willReturn($completedEvent);
29
30
        $writer = new Db($logRepository, $eventCompleter);
31
        $writer->write($event);
32
    }
33
}
34