createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('audio deleted sends discord notification', function (): void { $audio = Audio::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AudioDeleted::class); $audio->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('audio restored sends discord notification', function (): void { $audio = Audio::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AudioRestored::class); $audio->restore(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('audio updated sends discord notification', function (): void { $audio = Audio::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AudioUpdated::class); $changes = Audio::factory()->makeOne(); $audio->fill($changes->getAttributes()); $audio->save(); Bus::assertDispatched(SendDiscordNotificationJob::class); });