|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PhpGitHooks\Module\Configuration\Tests\Stub; |
|
4
|
|
|
|
|
5
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitGuardCoverageResponse; |
|
6
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitResponse; |
|
7
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PhpUnitStrictCoverageResponse; |
|
8
|
|
|
use PhpGitHooks\Module\Configuration\Contract\Response\PrePushResponse; |
|
9
|
|
|
|
|
10
|
|
|
class PrePushResponseStub |
|
11
|
|
|
{ |
|
12
|
|
|
const RIGHT_MESSAGE = 'OK'; |
|
13
|
|
|
const ERROR_MESSAGE = 'BAD PUSH'; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @param $prePush |
|
17
|
|
|
* @param $rightMessage |
|
18
|
|
|
* @param $errorMessage |
|
19
|
|
|
* @param PhpUnitResponse $phpUnitResponse |
|
20
|
|
|
* @param PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse |
|
21
|
|
|
* @param PhpUnitGuardCoverageResponse $phpUnitGuardCoverageResponse |
|
22
|
|
|
* |
|
23
|
|
|
* @return PrePushResponse |
|
24
|
|
|
*/ |
|
25
|
|
|
public static function create( |
|
26
|
|
|
$prePush, |
|
27
|
|
|
$rightMessage, |
|
28
|
|
|
$errorMessage, |
|
29
|
|
|
PhpUnitResponse $phpUnitResponse, |
|
30
|
|
|
PhpUnitStrictCoverageResponse $phpUnitStrictCoverageResponse, |
|
31
|
|
|
PhpUnitGuardCoverageResponse $phpUnitGuardCoverageResponse |
|
32
|
|
|
) { |
|
33
|
|
|
return new PrePushResponse( |
|
34
|
|
|
$prePush, |
|
35
|
|
|
$rightMessage, |
|
36
|
|
|
$errorMessage, |
|
37
|
|
|
$phpUnitResponse, |
|
38
|
|
|
$phpUnitStrictCoverageResponse, |
|
39
|
|
|
$phpUnitGuardCoverageResponse |
|
40
|
|
|
); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @return PrePushResponse |
|
45
|
|
|
*/ |
|
46
|
|
|
public static function createAllEnabled() |
|
47
|
|
|
{ |
|
48
|
|
|
return new PrePushResponse( |
|
49
|
|
|
true, |
|
50
|
|
|
self::RIGHT_MESSAGE, |
|
51
|
|
|
self::ERROR_MESSAGE, |
|
52
|
|
|
PhpUnitResponseStub::createEnabled(), |
|
53
|
|
|
PhpUnitStrictCoverageResponseStub::createEnabled(), |
|
54
|
|
|
PhpUnitGuardCoverageResponseStub::createEnabled() |
|
55
|
|
|
); |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|