Skip to content

Commit 17bd1d4

Browse files
committed
truncation hooks
1 parent 9b54692 commit 17bd1d4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dusk.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,24 @@ To specify the database connections that should have their tables truncated, you
222222
*/
223223
protected $connectionsToTruncate = ['mysql'];
224224

225+
If you would like to execute code before or after database truncation is performed, you may define `beforeTruncatingDatabase` or `afterTruncatingDatabase` methods on your test class:
226+
227+
/**
228+
* Perform any work that should take place before the database has started truncating.
229+
*/
230+
protected function beforeTruncatingDatabase(): void
231+
{
232+
//
233+
}
234+
235+
/**
236+
* Perform any work that should take place after the database has finished truncating.
237+
*/
238+
protected function afterTruncatingDatabase(): void
239+
{
240+
//
241+
}
242+
225243
<a name="running-tests"></a>
226244
### Running Tests
227245

0 commit comments

Comments
 (0)