Skip to content

A free open source IT asset/license management system

Improve test setup

Marcus Moore3b7162cb0214
diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php
index b2fb4b3828..e2a97c1603 100644
--- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php
+++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php
@@ -101,9 +101,14 @@ class SlackNotificationsUponCheckinTest extends TestCase
{
$this->settings->enableSlackWebhook();
- $category = Category::factory()->create(['checkin_email' => false]);
- $assetModel = AssetModel::factory()->create(['category_id' => $category->id]);
- $asset = Asset::factory()->assignedToUser()->create(['model_id' => $assetModel->id]);
+ $category = Category::factory()->create([
+ 'checkin_email' => false,
+ 'eula_text' => null,
+ 'require_acceptance' => false,
+ 'use_default_eula' => false,
+ ]);
+ $assetModel = AssetModel::factory()->for($category)->create();
+ $asset = Asset::factory()->for($assetModel, 'model')->assignedToUser()->create();
$this->fireCheckInEvent(
$asset,
diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php
index b9f8fb6523..c9f426dd30 100644
--- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php
+++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php
@@ -103,9 +103,14 @@ class SlackNotificationsUponCheckoutTest extends TestCase
{
$this->settings->enableSlackWebhook();
- $category = Category::factory()->create(['checkin_email' => false]);
- $assetModel = AssetModel::factory()->create(['category_id' => $category->id]);
- $asset = Asset::factory()->create(['model_id' => $assetModel->id]);
+ $category = Category::factory()->create([
+ 'checkin_email' => false,
+ 'eula_text' => null,
+ 'require_acceptance' => false,
+ 'use_default_eula' => false,
+ ]);
+ $assetModel = AssetModel::factory()->for($category)->create();
+ $asset = Asset::factory()->for($assetModel, 'model')->create();
$this->fireCheckOutEvent(
$asset,