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

PlayerHistoryTest   A

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 9
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testReceivedPlayersHistory() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Tests\Game\Features\History;
6
7
use App\Game\Features\History\History;
8
use App\Game\Features\History\HistoryId;
9
use App\Game\Features\History\PlayerHistory;
10
use App\Game\Infrastructure\Dao\InMemory\InMemoryHistoryDao;
11
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...
12
13
/**
14
 * @coversDefaultClass \App\Game\Features\History\PlayerHistory
15
 */
16
final class PlayerHistoryTest extends TestCase
17
{
18
    /**
19
     * @covers ::__invoke
20
     */
21
    public function testReceivedPlayersHistory(): void
22
    {
23
        $history = new History(new HistoryId());
24
        $history->changeLevel(2);
25
26
        $history2 = new History(new HistoryId());
27
        $history2->changeLevel(1);
28
29
        $repository = new InMemoryHistoryDao($history, $history2);
30
        $playerHistory = new PlayerHistory($repository);
31
32
        $result = $playerHistory->__invoke();
33
34
        self::assertCount(2, $result);
35
    }
36
}
37