Skip to content

Commit 776b36f

Browse files
committed
Add documentation for WithCachedAutowire
1 parent ab00d1e commit 776b36f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ It is possible to use custom Attribute classes for either or both the autowiring
197197
- Add a `autowire_attribute`, `configure_attribute`, `tag_attribute` or `listen_attribute` setting to the `config/autowire.php` file, containing the fully-namespaced name of your custom attribute class.
198198
- Use your custom attribute to mark the interface or class you want to autowire or configure.
199199

200+
## Speeding up tests
201+
202+
To avoid tests crawling your codebase for autowiring attributes, and thus slowing them down, you can use the `WithCachedAutowire` trait.
203+
This will make sure autowire will only crawl once for the whole run of the tests.
204+
205+
```php
206+
abstract class TestCase extends BaseTestCase
207+
{
208+
use WithCachedAutowire;
209+
}
210+
```
211+
200212
## Changelog
201213

202214
Please see the [changelog](changelog.md) for more information on what has changed recently.

0 commit comments

Comments
 (0)