WordsStoragePopulateTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 19
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSuccessfullyPopulateWordsToTheStorage() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Dictionary\Features\PopulateStorage\Populate;
6
7
use App\Dictionary\Features\PopulateStorage\Populate\WordsStoragePopulate;
8
use App\Dictionary\Features\PopulateStorage\Populate\WordsStoragePopulateCriteria;
9
use App\Dictionary\Infrastructure\FileReader\TextFileReader;
10
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...
11
use App\Tests\Dictionary\DictionaryTestCase;
12
13
/**
14
 * @coversDefaultClass \App\Dictionary\Features\PopulateStorage\Populate\WordsStoragePopulate
15
 */
16
final class WordsStoragePopulateTest extends DictionaryTestCase
17
{
18
    private const WORD_LIST = ['test', 'search', 'date'];
19
20
    /**
21
     * @covers ::execute
22
     */
23
    public function testSuccessfullyPopulateWordsToTheStorage(): void
24
    {
25
        $filePath = $this->createTempFile('.txt', self::WORD_LIST);
26
        $criteria = new WordsStoragePopulateCriteria('ua', $filePath);
27
28
        $wordsStoragePopulate = new WordsStoragePopulate(
29
            new TextFileReader(),
30
            $this->messageBusMock(),
31
            new NullLogger()
32
        );
33
34
        self::assertCount($wordsStoragePopulate->execute($criteria), self::WORD_LIST);
35
    }
36
}
37