Skip to content

Commit ab108c1

Browse files
committed
fix test
1 parent 09d45de commit ab108c1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/Unit/Jobs/UpdateSiteTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use App\RemoteSite\Responses\FinalizeUpdate;
1010
use App\RemoteSite\Responses\GetUpdate;
1111
use App\RemoteSite\Responses\HealthCheck;
12+
use App\RemoteSite\Responses\Notification;
1213
use App\RemoteSite\Responses\PrepareUpdate;
1314
use Illuminate\Database\Eloquent\Relations\HasMany;
1415
use Illuminate\Support\Facades\App;
@@ -147,7 +148,8 @@ public function testJobWritesFailLogOnFailing()
147148
'checkHealth' => $this->getHealthCheckMock(),
148149
'getUpdate' => $this->getGetUpdateMock("1.0.1"),
149150
'prepareUpdate' => $this->getPrepareUpdateMock(),
150-
'finalizeUpdate' => $this->getFinalizeUpdateMock(false)
151+
'finalizeUpdate' => $this->getFinalizeUpdateMock(false),
152+
'notificationFailed' => $this->getNotificationMock(true)
151153
],
152154
[
153155
'result' => false,
@@ -169,7 +171,8 @@ public function testJobWritesSuccessLogForSuccessfulJobs()
169171
'checkHealth' => $this->getHealthCheckMock(),
170172
'getUpdate' => $this->getGetUpdateMock("1.0.1"),
171173
'prepareUpdate' => $this->getPrepareUpdateMock(),
172-
'finalizeUpdate' => $this->getFinalizeUpdateMock(true)
174+
'finalizeUpdate' => $this->getFinalizeUpdateMock(true),
175+
'notificationSuccess' => $this->getNotificationMock(true)
173176
],
174177
[
175178
'result' => true,
@@ -261,6 +264,13 @@ protected function getFinalizeUpdateMock(bool $success)
261264
]);
262265
}
263266

267+
protected function getNotificationMock(bool $success)
268+
{
269+
return Notification::from([
270+
"success" => $success
271+
]);
272+
}
273+
264274
protected function getPrepareUpdateMock($overrides = [])
265275
{
266276
$defaults = [

0 commit comments

Comments
 (0)