mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Mention Event::fake()
This commit is contained in:
parent
ee024c7e5b
commit
6832de38bb
1 changed files with 18 additions and 0 deletions
|
|
@ -6,8 +6,26 @@ section: content
|
||||||
|
|
||||||
# Testing {#testing}
|
# 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
|
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}
|
## Central app {#central-app}
|
||||||
|
|
||||||
To test your central app, just write normal Laravel tests.
|
To test your central app, just write normal Laravel tests.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue