| @@ 11-63 (lines=53) @@ | ||
| 8 | use PhpGitHooks\Module\Configuration\Domain\Undefined; |
|
| 9 | use PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface; |
|
| 10 | ||
| 11 | class CommitMsgStub implements RandomStubInterface |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @param Undefined $undefined |
|
| 15 | * @param Enabled $enabled |
|
| 16 | * @param RegularExpression $regularExpression |
|
| 17 | * |
|
| 18 | * @return CommitMsg |
|
| 19 | */ |
|
| 20 | public static function create( |
|
| 21 | Undefined $undefined, |
|
| 22 | Enabled $enabled, |
|
| 23 | RegularExpression $regularExpression |
|
| 24 | ) { |
|
| 25 | return new CommitMsg($undefined, $enabled, $regularExpression); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return CommitMsg |
|
| 30 | */ |
|
| 31 | public static function random() |
|
| 32 | { |
|
| 33 | return self::create( |
|
| 34 | new Undefined(false), |
|
| 35 | EnabledStub::random(), |
|
| 36 | RegularExpressionStub::random() |
|
| 37 | ); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return CommitMsg |
|
| 42 | */ |
|
| 43 | public static function setUndefined() |
|
| 44 | { |
|
| 45 | return self::create( |
|
| 46 | new Undefined(true), |
|
| 47 | new Enabled(false), |
|
| 48 | RegularExpressionStub::create(null) |
|
| 49 | ); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * @return CommitMsg |
|
| 54 | */ |
|
| 55 | public static function createEnabled() |
|
| 56 | { |
|
| 57 | return self::create( |
|
| 58 | new Undefined(false), |
|
| 59 | new Enabled(true), |
|
| 60 | RegularExpressionStub::create('#[0-9]{2,7}') |
|
| 61 | ); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| @@ 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 | ||
| @@ 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 | ||