Skip to content

A free open source IT asset/license management system

Scaffold failing test

Marcus Moore51479c8bbc3a
diff --git a/tests/Feature/Notifications/Email/EmailNotificationsToAdminAlertEmailUponCheckout.php b/tests/Feature/Notifications/Email/EmailNotificationsToAdminAlertEmailUponCheckout.php
index 930a1388f0..9493e30b90 100644
--- a/tests/Feature/Notifications/Email/EmailNotificationsToAdminAlertEmailUponCheckout.php
+++ b/tests/Feature/Notifications/Email/EmailNotificationsToAdminAlertEmailUponCheckout.php
@@ -77,6 +77,21 @@ class EmailNotificationsToAdminAlertEmailUponCheckout extends TestCase
});
}
+ public function test_admin_alert_email_not_sent_when_always_send_is_false_and_asset_does_not_require_acceptance()
+ {
+ $this->settings
+ ->enableAdminCC('[email protected]')
+ ->disableAdminCCAlways();
+
+ $this->category->update(['checkin_email' => false]);
+
+ $this->fireCheckoutEvent();
+
+ Mail::assertNotSent(CheckoutAssetMail::class, function (CheckoutAssetMail $mail) {
+ return $mail->hasTo('[email protected]') || $mail->hasCc('[email protected]');
+ });
+ }
+
private function fireCheckoutEvent(): void
{
event(new CheckoutableCheckedOut(