From 6832de38bb83f9a3a0f62b9e604ddd3624602f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 15 Sep 2020 11:51:07 +0200 Subject: [PATCH] Mention Event::fake() --- source/docs/v3/testing.blade.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/docs/v3/testing.blade.md b/source/docs/v3/testing.blade.md index 24cde2d..e895c10 100644 --- a/source/docs/v3/testing.blade.md +++ b/source/docs/v3/testing.blade.md @@ -6,8 +6,26 @@ section: content # Testing {#testing} +> If you're a sponsor, you can get an opinionated, but automatic testing setup on the site with exclusive content for sponsors: https://sponsors.tenancyforlaravel.com/frictionless-testing-setup + TODO: Review +## Events + +Keep in mind that the package makes heavy use of events, so if you use `Event::fake()` anywhere in your tests, tenancy initialization and related processes might break. + +For that reason, try to be selective about faking tests. Use for example: + +```php +Event::fake([MyEvent::class]); +``` + +rather than + +```php +Event::fake(); +``` + ## Central app {#central-app} To test your central app, just write normal Laravel tests.