1 | <?php |
||
11 | class StubbedParaProcess extends ParaunitProcessAbstract |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $output; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $commandLine; |
||
22 | |||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $exitCode = 0; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function __construct($commandLine = 'testCommandLine', $uniqueId = null) |
||
32 | { |
||
33 | if (is_null($uniqueId)) { |
||
34 | $uniqueId = md5($commandLine); |
||
35 | } |
||
36 | |||
37 | parent::__construct($commandLine, $uniqueId); |
||
38 | |||
39 | $this->commandLine = $commandLine; |
||
40 | $this->filename = 'Test.php'; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param bool $isToBeRetried |
||
45 | */ |
||
46 | public function setIsToBeRetried($isToBeRetried) |
||
47 | { |
||
48 | $this->shouldBeRetried = $isToBeRetried; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return string |
||
53 | */ |
||
54 | public function getCommandLine() |
||
55 | { |
||
56 | return $this->commandLine; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param string $output |
||
61 | */ |
||
62 | public function setOutput($output) |
||
63 | { |
||
64 | $this->output = $output; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param int $exitCode |
||
69 | */ |
||
70 | public function setExitCode($exitCode) |
||
71 | { |
||
72 | $this->exitCode = $exitCode; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getOutput() |
||
79 | { |
||
80 | return $this->output; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function isTerminated() |
||
87 | { |
||
88 | return true; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return mixed |
||
93 | */ |
||
94 | public function start() |
||
95 | { |
||
96 | return; |
||
97 | } |
||
98 | |||
99 | /** |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function restart() |
||
103 | { |
||
104 | return; |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function isRunning() |
||
111 | { |
||
112 | return false; |
||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @return int |
||
117 | */ |
||
118 | public function getExitCode() |
||
119 | { |
||
120 | return $this->exitCode; |
||
121 | } |
||
122 | } |
||
123 |