Move Notification::fake() to setUp method

This commit is contained in:
Marcus Moore 2024-02-27 17:23:30 -08:00
parent 43cc296582
commit 2ea883aa15
No known key found for this signature in database
2 changed files with 14 additions and 32 deletions

View file

@ -22,6 +22,13 @@ class SlackNotificationsUponCheckinTest extends TestCase
{
use InteractsWithSettings;
protected function setUp(): void
{
parent::setUp();
Notification::fake();
}
public function assetCheckoutTargets(): array
{
return [
@ -41,8 +48,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
public function testAccessoryCheckinSendsSlackNotificationWhenSettingEnabled()
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -63,8 +68,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
public function testAccessoryCheckinDoesNotSendSlackNotificationWhenSettingDisabled()
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -80,8 +83,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
/** @dataProvider assetCheckoutTargets */
public function testAssetCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget)
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -103,8 +104,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
/** @dataProvider assetCheckoutTargets */
public function testAssetCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget)
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -119,8 +118,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
public function testComponentCheckinDoesNotSendSlackNotification()
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -146,8 +143,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
/** @dataProvider licenseCheckoutTargets */
public function testLicenseCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget)
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn(
@ -169,8 +164,6 @@ class SlackNotificationsUponCheckinTest extends TestCase
/** @dataProvider licenseCheckoutTargets */
public function testLicenseCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget)
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedIn(

View file

@ -24,6 +24,13 @@ class SlackNotificationsUponCheckoutTest extends TestCase
{
use InteractsWithSettings;
protected function setUp(): void
{
parent::setUp();
Notification::fake();
}
public function assetCheckoutTargets(): array
{
return [
@ -43,8 +50,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
public function testAccessoryCheckoutSendsSlackNotificationWhenSettingEnabled()
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -65,8 +70,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
public function testAccessoryCheckoutDoesNotSendSlackNotificationWhenSettingDisabled()
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -82,8 +85,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
/** @dataProvider assetCheckoutTargets */
public function testAssetCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget)
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -105,8 +106,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
/** @dataProvider assetCheckoutTargets */
public function testAssetCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget)
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -121,8 +120,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
public function testComponentCheckoutDoesNotSendSlackNotification()
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -137,8 +134,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
public function testConsumableCheckoutSendsSlackNotificationWhenSettingEnabled()
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -159,8 +154,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
public function testConsumableCheckoutDoesNotSendSlackNotificationWhenSettingDisabled()
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -176,8 +169,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
/** @dataProvider licenseCheckoutTargets */
public function testLicenseCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget)
{
Notification::fake();
$this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut(
@ -199,8 +190,6 @@ class SlackNotificationsUponCheckoutTest extends TestCase
/** @dataProvider licenseCheckoutTargets */
public function testLicenseCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget)
{
Notification::fake();
$this->settings->disableSlackWebhook();
event(new CheckoutableCheckedOut(