createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('anime deleted sends discord notification', function () { $anime = Anime::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AnimeDeleted::class); $anime->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('anime restored sends discord notification', function () { $anime = Anime::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AnimeRestored::class); $anime->restore(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('anime updated sends discord notification', function () { $anime = Anime::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(AnimeUpdated::class); $changes = Anime::factory()->makeOne(); $anime->fill($changes->getAttributes()); $anime->save(); Bus::assertDispatched(SendDiscordNotificationJob::class); });