Merge pull request #14272 from marcusmoore/testing/update-state-helper-name

Updated testing helper name
This commit is contained in:
snipe 2024-02-15 08:19:40 +00:00 committed by GitHub
commit b6279af1d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 10 deletions

View file

@ -22,7 +22,7 @@ class AccessoryWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut( event(new CheckoutableCheckedOut(
Accessory::factory()->appleBtKeyboard()->create(), Accessory::factory()->appleBtKeyboard()->create(),
@ -60,7 +60,7 @@ class AccessoryWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn( event(new CheckoutableCheckedIn(
Accessory::factory()->appleBtKeyboard()->create(), Accessory::factory()->appleBtKeyboard()->create(),

View file

@ -33,7 +33,7 @@ class AssetWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut( event(new CheckoutableCheckedOut(
$this->createAsset(), $this->createAsset(),
@ -73,7 +73,7 @@ class AssetWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn( event(new CheckoutableCheckedIn(
$this->createAsset(), $this->createAsset(),

View file

@ -20,7 +20,7 @@ class ComponentWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut( event(new CheckoutableCheckedOut(
Component::factory()->ramCrucial8()->create(), Component::factory()->ramCrucial8()->create(),
@ -36,7 +36,7 @@ class ComponentWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn( event(new CheckoutableCheckedIn(
Component::factory()->ramCrucial8()->create(), Component::factory()->ramCrucial8()->create(),

View file

@ -20,7 +20,7 @@ class ConsumableWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut( event(new CheckoutableCheckedOut(
Consumable::factory()->cardstock()->create(), Consumable::factory()->cardstock()->create(),

View file

@ -32,7 +32,7 @@ class LicenseWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedOut( event(new CheckoutableCheckedOut(
LicenseSeat::factory()->create(), LicenseSeat::factory()->create(),
@ -72,7 +72,7 @@ class LicenseWebhookTest extends TestCase
{ {
Notification::fake(); Notification::fake();
$this->settings->enableWebhook(); $this->settings->enableSlackWebhook();
event(new CheckoutableCheckedIn( event(new CheckoutableCheckedIn(
LicenseSeat::factory()->create(), LicenseSeat::factory()->create(),

View file

@ -39,9 +39,10 @@ class Settings
return $this->update(['full_multiple_companies_support' => 0]); return $this->update(['full_multiple_companies_support' => 0]);
} }
public function enableWebhook(): Settings public function enableSlackWebhook(): Settings
{ {
return $this->update([ return $this->update([
'webhook_selected' => 'slack',
'webhook_botname' => 'SnipeBot5000', 'webhook_botname' => 'SnipeBot5000',
'webhook_endpoint' => 'https://hooks.slack.com/services/NZ59/Q446/672N', 'webhook_endpoint' => 'https://hooks.slack.com/services/NZ59/Q446/672N',
'webhook_channel' => '#it', 'webhook_channel' => '#it',
@ -51,6 +52,7 @@ class Settings
public function disableWebhook(): Settings public function disableWebhook(): Settings
{ {
return $this->update([ return $this->update([
'webhook_selected' => '',
'webhook_botname' => '', 'webhook_botname' => '',
'webhook_endpoint' => '', 'webhook_endpoint' => '',
'webhook_channel' => '', 'webhook_channel' => '',