Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
IntegrationTestHelper
n/a
0 / 0
n/a
0 / 0
11
n/a
0 / 0
 createDbLayerImplementation
n/a
0 / 0
n/a
0 / 0
2
 createFakerLayerImplementation
n/a
0 / 0
n/a
0 / 0
2
 createInMemoryLayerImplementation
n/a
0 / 0
n/a
0 / 0
1
 createFullFrameworkConfig
n/a
0 / 0
n/a
0 / 0
1
 createMinimalFrameworkConfig
n/a
0 / 0
n/a
0 / 0
1
 createEmptySearch
n/a
0 / 0
n/a
0 / 0
1
 createSpacebarSearch
n/a
0 / 0
n/a
0 / 0
1
 createRegularSearch
n/a
0 / 0
n/a
0 / 0
1
 createLikeSearch
n/a
0 / 0
n/a
0 / 0
1
1<?php
2namespace Apie\IntegrationTests;
3
4use Apie\DoctrineEntityDatalayer\DoctrineEntityDatalayer;
5use Apie\Faker\Datalayers\FakerDatalayer;
6use Apie\IntegrationTests\Concerns\CreatesApieBoundedContext;
7use Apie\IntegrationTests\Concerns\CreatesApplications;
8use Apie\IntegrationTests\Config\ApplicationConfig;
9use Apie\IntegrationTests\Config\Enums\DatalayerImplementation;
10
11/**
12 * @codeCoverageIgnore
13 */
14final class IntegrationTestHelper
15{
16    use CreatesApplications;
17    use CreatesApieBoundedContext;
18
19    public function createDbLayerImplementation(): ?DatalayerImplementation
20    {
21        return class_exists(DoctrineEntityDatalayer::class) ? DatalayerImplementation::DB_DATALAYER : null;
22    }
23
24    public function createFakerLayerImplementation(): ?DatalayerImplementation
25    {
26        return class_exists(FakerDatalayer::class) ? DatalayerImplementation::FAKER : null;
27    }
28
29    public function createInMemoryLayerImplementation(): DatalayerImplementation
30    {
31        return DatalayerImplementation::IN_MEMORY;
32    }
33
34    public function createFullFrameworkConfig(DatalayerImplementation $datalayerImplementation): ApplicationConfig
35    {
36        return new ApplicationConfig(
37            true,
38            true,
39            $datalayerImplementation
40        );
41    }
42
43    public function createMinimalFrameworkConfig(): ApplicationConfig
44    {
45        return new ApplicationConfig(
46            false,
47            false,
48            DatalayerImplementation::IN_MEMORY
49        );
50    }
51
52    public function createEmptySearch(): SearchTerm
53    {
54        return new SearchTerm('');
55    }
56
57    public function createSpacebarSearch(): SearchTerm
58    {
59        return new SearchTerm(' ');
60    }
61
62    public function createRegularSearch(): SearchTerm
63    {
64        return new SearchTerm('search');
65    }
66
67    public function createLikeSearch(): SearchTerm
68    {
69        return new SearchTerm('%');
70    }
71}