Skip to content

A free open source IT asset/license management system

Implement test for license checkout notification

Marcus Moore2cbc6276f779
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,