Skip to content

Commit 20c97b0

Browse files
committed
fix test error by rewriting code
1 parent 2b421d4 commit 20c97b0

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/Service/ServiceStateManager.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,28 @@ private function actionForService(ServiceIdentificator $serviceId, string $actio
8686
throw new InvalidServiceStatusException('The service is not stopped');
8787
}
8888

89-
$result = $action($serviceId->serviceId(), $serviceId->machine());
89+
//$result = $action($serviceId->serviceId(), $serviceId->machine());
90+
switch ($action) {
91+
case 'win32_start_service':
92+
$result = win32_start_service($serviceId->serviceId(), $serviceId->machine());
93+
break;
94+
95+
case 'win32_stop_service':
96+
$result = win32_stop_service($serviceId->serviceId(), $serviceId->machine());
97+
break;
98+
99+
case 'win32_pause_service':
100+
$result = win32_pause_service($serviceId->serviceId(), $serviceId->machine());
101+
break;
102+
103+
case 'win32_continue_service':
104+
$result = win32_continue_service($serviceId->serviceId(), $serviceId->machine());
105+
break;
106+
107+
default:
108+
# code...
109+
break;
110+
}
90111

91112
$this->checkResponseAndConvertInExceptionIfNeed($result, $serviceId);
92113
$this->throwExceptionIfError(

0 commit comments

Comments
 (0)