PostsSpec   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setupPostsApi() 0 14 1
1
<?php
2
3
namespace App\Tests\Modules\Posts\Unit;
4
5
use App\Modules\Posts\Api\PostsApiInterface;
6
use App\Modules\Posts\Domain\PostsApi;
7
use App\Tests\Modules\Posts\Unit\Repository\InMemoryPostsRepository;
8
use App\Tests\Modules\Posts\Unit\Transaction\InMemoryPostTransactionFactory;
9
use App\Tests\TestUtils\Events\InMemoryEventPublisher;
10
use App\Tests\TestUtils\Security\InMemoryLoggedInUserProvider;
11
use PHPUnit\Framework\TestCase;
12
use Psr\Log\LoggerInterface;
13
14
abstract class PostsSpec extends TestCase
15
{
16
    protected PostsApiInterface $postsApi;
17
18
    /**
19
     * @before
20
     */
21
    protected function setupPostsApi()
22
    {
23
        $repository = new InMemoryPostsRepository();
24
        $this->postsApi = new PostsApi(
25
            new InMemoryEventPublisher(),
26
            $repository,
27
            $repository,
28
            $repository,
29
            $repository,
30
            new InMemoryLoggedInUserProvider(),
31
            new InMemoryPostTransactionFactory(),
32
            $repository,
33
            $repository,
34
            $this->createMock(LoggerInterface::class)
35
        );
36
    }
37
}