mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
more test work
This commit is contained in:
parent
93f995a396
commit
f063275969
|
@ -263,12 +263,7 @@ class CheckoutableListener
|
||||||
private function shouldNotSendAnyNotifications($checkoutable): bool
|
private function shouldNotSendAnyNotifications($checkoutable): bool
|
||||||
{
|
{
|
||||||
return in_array(get_class($checkoutable), $this->skipNotificationsFor);
|
return in_array(get_class($checkoutable), $this->skipNotificationsFor);
|
||||||
//checkoutabale is a HUGE json array
|
//$checkoutabale is a HUGE json array
|
||||||
//$this->>skipNotificationsFor = App/Model/Component | from the top of this Listener
|
|
||||||
//private array $skipNotificationsFor = [
|
|
||||||
// Component::class,
|
|
||||||
// ];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function shouldSendWebhookNotification(): bool
|
private function shouldSendWebhookNotification(): bool
|
||||||
|
|
|
@ -82,8 +82,7 @@ class CheckoutAssetNotification extends Notification
|
||||||
/**
|
/**
|
||||||
* Only send notifications to users that have email addresses
|
* Only send notifications to users that have email addresses
|
||||||
*/
|
*/
|
||||||
if ($this->target instanceof User && (($this->target->email != '') || $this->settings->admin_cc_email != '')) {
|
if ($this->target instanceof User && ($this->target->email != '') || ($this->settings->admin_cc_email != '')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an email if the asset requires acceptance,
|
* Send an email if the asset requires acceptance,
|
||||||
* so the user can accept or decline the asset
|
* so the user can accept or decline the asset
|
||||||
|
|
|
@ -26,7 +26,7 @@ class EmailNotificationsUponCheckoutTest extends TestCase
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$asset = Asset::factory()->assignedToUser($user)->create();
|
$asset = Asset::factory()->assignedToUser($user)->create();
|
||||||
|
|
||||||
$asset->model->category->update(['checkout_email' => true]);
|
$asset->model->category->update(['checkin_email' => true]);
|
||||||
|
|
||||||
$this->fireCheckOutEvent($asset, $user);
|
$this->fireCheckOutEvent($asset, $user);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class EmailNotificationsUponCheckoutTest extends TestCase
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$asset = Asset::factory()->assignedToUser($user)->create();
|
$asset = Asset::factory()->assignedToUser($user)->create();
|
||||||
|
|
||||||
$asset->model->category->update(['checkout_email' => false]);
|
$asset->model->category->update(['checkin_email' => false]); //this is a 0 so the setting IS disabled
|
||||||
|
|
||||||
$this->fireCheckOutEvent($asset, $user);
|
$this->fireCheckOutEvent($asset, $user);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue