@@ -87,6 +87,9 @@ |
||
87 | 87 | $this->process->stop(); |
88 | 88 | } |
89 | 89 | |
90 | + /** |
|
91 | + * @param null|PhiremockProcess $process |
|
92 | + */ |
|
90 | 93 | private function initProcess($process) |
91 | 94 | { |
92 | 95 | $this->process = $process === null ? new PhiremockProcess() : $process; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | array $options, |
60 | 60 | PhiremockProcess $process = null |
61 | 61 | ) { |
62 | - $this->config['bin_path'] = Config::projectDir() . '../vendor/bin/phiremock'; |
|
62 | + $this->config['bin_path'] = Config::projectDir().'../vendor/bin/phiremock'; |
|
63 | 63 | $this->config['logs_path'] = Config::logDir(); |
64 | 64 | parent::__construct($config, $options); |
65 | 65 |
@@ -39,9 +39,7 @@ |
||
39 | 39 | /** |
40 | 40 | * Starts a wiremock process. |
41 | 41 | * |
42 | - * @param string $jarPath |
|
43 | 42 | * @param string $logsPath |
44 | - * @param string $arguments |
|
45 | 43 | * |
46 | 44 | * @throws \Exception |
47 | 45 | */ |
@@ -48,20 +48,20 @@ |
||
48 | 48 | public function start($ip, $port, $path, $logsPath, $debug) |
49 | 49 | { |
50 | 50 | $path = realpath($path); |
51 | - $phiremockPath = is_file($path) ? $path : $path . DIRECTORY_SEPARATOR . 'phiremock'; |
|
51 | + $phiremockPath = is_file($path) ? $path : $path.DIRECTORY_SEPARATOR.'phiremock'; |
|
52 | 52 | |
53 | 53 | if ($debug) { |
54 | - echo 'Running ' . $this->getCommandPrefix() |
|
54 | + echo 'Running '.$this->getCommandPrefix() |
|
55 | 55 | . "{$phiremockPath} -i {$ip} -p {$port}" |
56 | - . ($debug? ' -d' : '') . PHP_EOL; |
|
56 | + . ($debug ? ' -d' : '').PHP_EOL; |
|
57 | 57 | } |
58 | 58 | $this->process = new Process( |
59 | 59 | $this->getCommandPrefix() |
60 | 60 | . "{$phiremockPath} -i {$ip} -p {$port}" |
61 | 61 | . ($debug ? ' -d' : '') |
62 | 62 | ); |
63 | - $logFile = $logsPath . DIRECTORY_SEPARATOR . self::LOG_FILE_NAME; |
|
64 | - $this->process->start(function ($type, $buffer) use ($logFile) { |
|
63 | + $logFile = $logsPath.DIRECTORY_SEPARATOR.self::LOG_FILE_NAME; |
|
64 | + $this->process->start(function($type, $buffer) use ($logFile) { |
|
65 | 65 | file_put_contents($logFile, $buffer, FILE_APPEND); |
66 | 66 | }); |
67 | 67 | $this->process->setEnhanceSigchildCompatibility(true); |