From 2cbc6276f779dbe9e7d92124417ee772523a9d83 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Mon, 27 Mar 2023 14:09:21 -0700 Subject: [PATCH] Implement test for license checkout notification --- .../AssetCheckoutWebhookNotificationTest.php | 1 - .../LicenseCheckoutWebhookNotificationTest.php | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/Feature/Notifications/AssetCheckoutWebhookNotificationTest.php b/tests/Feature/Notifications/AssetCheckoutWebhookNotificationTest.php index 57a6fcfb98..2a2a8367e3 100644 --- a/tests/Feature/Notifications/AssetCheckoutWebhookNotificationTest.php +++ b/tests/Feature/Notifications/AssetCheckoutWebhookNotificationTest.php @@ -13,7 +13,6 @@ use Tests\TestCase; class AssetCheckoutWebhookNotificationTest extends TestCase { - public function checkoutTargets() { return [ diff --git a/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php b/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php index 6fd7d22cfc..e01a2dc62b 100644 --- a/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php +++ b/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php @@ -29,18 +29,12 @@ class LicenseCheckoutWebhookNotificationTest extends TestCase Setting::factory()->withWebhookEnabled()->create(); - $checkoutTarget = $checkoutTarget(); - - $licenseSeat = LicenseSeat::factory()->create(); - - // @todo: this has to go through the LicenseCheckoutController::store() method - // @todo: to have the CheckoutableCheckedOut fire... - // @todo: either change this to go through controller - // @todo: or move that functionality to the model? - // $licenseSeat->checkOut( - // $checkoutTarget, - // User::factory()->superuser()->create()->id - // ); + event(new CheckoutableCheckedOut( + LicenseSeat::factory()->create(), + $checkoutTarget(), + User::factory()->superuser()->create(), + '' + )); Notification::assertSentTo( new AnonymousNotifiable,