@@ -54,7 +54,7 @@ public function testExecute()
54
54
->method ('execute ' )
55
55
->willReturnMap (
56
56
[
57
- ['exec pgrep -U "$UID " -f "bin/magento cron:run" ' , [], [111 , 222 ]],
57
+ ['exec pgrep -U "$(id -u) " -f "bin/magento cron:run" ' , [], [111 , 222 ]],
58
58
["kill 111 " , [], []],
59
59
["kill 222 " , [], []],
60
60
]
@@ -75,7 +75,7 @@ public function testExecuteWithNoRunningCrons()
75
75
);
76
76
$ this ->shellMock ->expects ($ this ->once ())
77
77
->method ('execute ' )
78
- ->with ('exec pgrep -U "$UID " -f "bin/magento cron:run" ' )
78
+ ->with ('exec pgrep -U "$(id -u) " -f "bin/magento cron:run" ' )
79
79
->willThrowException (new \RuntimeException ('return code 1 ' , 1 ));
80
80
$ this ->process ->execute ();
81
81
}
@@ -90,7 +90,7 @@ public function testExecuteWithError()
90
90
->with ('Trying to kill running cron jobs ' );
91
91
$ this ->shellMock ->expects ($ this ->once ())
92
92
->method ('execute ' )
93
- ->with ('exec pgrep -U "$UID " -f "bin/magento cron:run" ' )
93
+ ->with ('exec pgrep -U "$(id -u) " -f "bin/magento cron:run" ' )
94
94
->willThrowException (new \RuntimeException ('return code 2 ' , 2 ));
95
95
$ this ->loggerMock ->expects ($ this ->once ())
96
96
->method ('warning ' )
@@ -114,7 +114,7 @@ public function testExecuteWithExeption()
114
114
);
115
115
$ this ->shellMock ->expects ($ this ->at (0 ))
116
116
->method ('execute ' )
117
- ->with ('exec pgrep -U "$UID " -f "bin/magento cron:run" ' )
117
+ ->with ('exec pgrep -U "$(id -u) " -f "bin/magento cron:run" ' )
118
118
->willReturn ([111 , 222 ]);
119
119
$ this ->shellMock ->expects ($ this ->at (1 ))
120
120
->method ('execute ' )
0 commit comments