testSendOneMessageToStorage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
ccs 0
cts 7
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Dictionary\Features\PopulateStorage\Upload;
6
7
use App\Dictionary\Features\PopulateStorage\Upload\WordsStorageUpload;
8
use App\Dictionary\Features\PopulateStorage\Upload\WordsStorageUploadCriteria;
9
use App\Dictionary\Features\PopulateStorage\SaveStorage\Message\SaveToStorageMessage;
10
use App\Dictionary\Infrastructure\FileReader\CsvFileReader;
11
use Psr\Log\NullLogger;
0 ignored issues
show
Bug introduced by
The type Psr\Log\NullLogger 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...
12
use App\Tests\Dictionary\DictionaryTestCase;
13
14
/**
15
 * @coversDefaultClass \App\Dictionary\Features\PopulateStorage\Upload\WordsStorageUpload
16
 */
17
final class WordsStorageUploadTest extends DictionaryTestCase
18
{
19
    /**
20
     * @covers ::execute
21
     */
22
    public function testSendOneMessageToStorage(): void
23
    {
24
        $wordsStorageUpload = new WordsStorageUpload(
25
            new CsvFileReader(),
26
            $this->messageBusMockWithConsecutive(self::once(), new SaveToStorageMessage('test', 'test test', 'ua')),
27
            new NullLogger()
28
        );
29
30
        $filePath = $this->createTempFile('.csv', ['subject,subject,subject', 'test,test test,ua']);
31
32
        $wordsStorageUpload->execute(new WordsStorageUploadCriteria($filePath));
33
    }
34
}
35