Skip to content

Commit 23a5f01

Browse files
authored
#20951 Direct STDERR output when listing crontab to /dev/null
Fix unit test failures
1 parent 528864d commit 23a5f01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/internal/Magento/Framework/Crontab/Test/Unit/CrontabManagerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testGetTasksNoCrontab()
5858

5959
$this->shellMock->expects($this->once())
6060
->method('execute')
61-
->with('crontab -l', [])
61+
->with('crontab -l 2>/dev/null', [])
6262
->willThrowException($localizedException);
6363

6464
$this->assertEquals([], $this->crontabManager->getTasks());
@@ -74,7 +74,7 @@ public function testGetTasks($content, $tasks)
7474
{
7575
$this->shellMock->expects($this->once())
7676
->method('execute')
77-
->with('crontab -l', [])
77+
->with('crontab -l 2>/dev/null', [])
7878
->willReturn($content);
7979

8080
$this->assertEquals($tasks, $this->crontabManager->getTasks());
@@ -127,7 +127,7 @@ public function testRemoveTasksWithException()
127127

128128
$this->shellMock->expects($this->at(0))
129129
->method('execute')
130-
->with('crontab -l', [])
130+
->with('crontab -l 2>/dev/null', [])
131131
->willReturn('');
132132

133133
$this->shellMock->expects($this->at(1))
@@ -148,7 +148,7 @@ public function testRemoveTasks($contentBefore, $contentAfter)
148148
{
149149
$this->shellMock->expects($this->at(0))
150150
->method('execute')
151-
->with('crontab -l', [])
151+
->with('crontab -l 2>/dev/null', [])
152152
->willReturn($contentBefore);
153153

154154
$this->shellMock->expects($this->at(1))
@@ -276,7 +276,7 @@ public function testSaveTasks($tasks, $content, $contentToSave)
276276

277277
$this->shellMock->expects($this->at(0))
278278
->method('execute')
279-
->with('crontab -l', [])
279+
->with('crontab -l 2>/dev/null', [])
280280
->willReturn($content);
281281

282282
$this->shellMock->expects($this->at(1))

0 commit comments

Comments
 (0)