@@ 11-61 (lines=51) @@ | ||
8 | use PhpGitHooks\Module\Configuration\Domain\Undefined; |
|
9 | use PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface; |
|
10 | ||
11 | class PhpUnitGuardCoverageStub implements RandomStubInterface |
|
12 | { |
|
13 | /** |
|
14 | * @param Undefined $undefined |
|
15 | * @param Enabled $enabled |
|
16 | * @param Message $warningMessage |
|
17 | * |
|
18 | * @return PhpUnitGuardCoverage |
|
19 | */ |
|
20 | public static function create(Undefined $undefined, Enabled $enabled, Message $warningMessage) |
|
21 | { |
|
22 | return new PhpUnitGuardCoverage($undefined, $enabled, $warningMessage); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * @return PhpUnitGuardCoverage |
|
27 | */ |
|
28 | public static function random() |
|
29 | { |
|
30 | return self::create( |
|
31 | new Undefined(false), |
|
32 | EnabledStub::random(), |
|
33 | MessageStub::random() |
|
34 | ); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @param string|null $message |
|
39 | * @return PhpUnitGuardCoverage |
|
40 | */ |
|
41 | public static function createEnabled($message = null) |
|
42 | { |
|
43 | return self::create( |
|
44 | new Undefined(false), |
|
45 | EnabledStub::create(true), |
|
46 | MessageStub::create($message) |
|
47 | ); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @return PhpUnitGuardCoverage |
|
52 | */ |
|
53 | public static function setUndefined() |
|
54 | { |
|
55 | return self::create( |
|
56 | new Undefined(true), |
|
57 | EnabledStub::create(false), |
|
58 | MessageStub::create(null) |
|
59 | ); |
|
60 | } |
|
61 | } |
|
62 |
@@ 11-62 (lines=52) @@ | ||
8 | use PhpGitHooks\Module\Configuration\Domain\Undefined; |
|
9 | use PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface; |
|
10 | ||
11 | class PhpUnitStrictCoverageStub implements RandomStubInterface |
|
12 | { |
|
13 | /** |
|
14 | * @param Undefined $undefined |
|
15 | * @param Enabled $enabled |
|
16 | * @param MinimumStrictCoverage $minimumStrictCoverage |
|
17 | * |
|
18 | * @return PhpUnitStrictCoverage |
|
19 | */ |
|
20 | public static function create(Undefined $undefined, Enabled $enabled, MinimumStrictCoverage $minimumStrictCoverage) |
|
21 | { |
|
22 | return new PhpUnitStrictCoverage($undefined, $enabled, $minimumStrictCoverage); |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * @return PhpUnitStrictCoverage |
|
27 | */ |
|
28 | public static function random() |
|
29 | { |
|
30 | return self::create( |
|
31 | new Undefined(false), |
|
32 | EnabledStub::random(), |
|
33 | MinimumStrictCoverageStub::random() |
|
34 | ); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @param float $minimum |
|
39 | * |
|
40 | * @return PhpUnitStrictCoverage |
|
41 | */ |
|
42 | public static function createEnabled($minimum = 99.00) |
|
43 | { |
|
44 | return self::create( |
|
45 | new Undefined(false), |
|
46 | EnabledStub::create(true), |
|
47 | MinimumStrictCoverageStub::create($minimum) |
|
48 | ); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * @return PhpUnitStrictCoverage |
|
53 | */ |
|
54 | public static function setUndefined() |
|
55 | { |
|
56 | return self::create( |
|
57 | new Undefined(true), |
|
58 | EnabledStub::create(false), |
|
59 | MinimumStrictCoverageStub::create(null) |
|
60 | ); |
|
61 | } |
|
62 | } |
|
63 |