Commit d79a83e
committed
Tweaks the RefreshDatabase trait for better support of multi-dbs
When working with multiple databases and some of them are in-memory
while others are regular disk-based databases, we usually have to
override some of the traits methods to make it work. Also, the database
restoration process doesn't handle multiple DBs that well.
With these changes, when an app needs to support multiple databases, the
user will have to do a few steps:
1. Set the `$connectionsToTransact` protected property on the TestCase
listing all connections they use
1. Override the `migrateDatabase` method and call all the migrate:fresh
commands for all their connections
Restoring the databases between tests should now be completely handled
by the trait, no matter which database connection uses in-memory
databases or not.1 parent 3e9ef5a commit d79a83e
1 file changed
+27
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| |||
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
66 | | - | |
| 78 | + | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
| |||
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
92 | | - | |
| 104 | + | |
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
| |||
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
124 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
125 | 145 | | |
126 | 146 | | |
127 | 147 | | |
| |||
0 commit comments