1919use CodeIgniter \Database \MigrationRunner ;
2020use CodeIgniter \Database \Seeder ;
2121use CodeIgniter \Events \Events ;
22+ use CodeIgniter \HTTP \Header ;
2223use CodeIgniter \Router \RouteCollection ;
2324use CodeIgniter \Session \Handlers \ArrayHandler ;
2425use CodeIgniter \Test \Mock \MockCache ;
@@ -72,6 +73,8 @@ abstract class CIUnitTestCase extends TestCase
7273
7374 /**
7475 * Store of identified traits.
76+ *
77+ * @var array<class-string, class-string>|null
7578 */
7679 private ?array $ traits = null ;
7780
@@ -109,9 +112,9 @@ abstract class CIUnitTestCase extends TestCase
109112
110113 /**
111114 * The seed file(s) used for all tests within this test case.
112- * Should be fully-namespaced or relative to $basePath
115+ * Should be fully-namespaced or relative to $basePath.
113116 *
114- * @var class-string<Seeder>|list<class-string<Seeder>>
117+ * @var ''| class-string<Seeder>|list<class-string<Seeder>>
115118 */
116119 protected $ seed = '' ;
117120
@@ -127,9 +130,9 @@ abstract class CIUnitTestCase extends TestCase
127130 * The namespace(s) to help us find the migration classes.
128131 * `null` is equivalent to running `spark migrate --all`.
129132 * Note that running "all" runs migrations in date order,
130- * but specifying namespaces runs them in namespace order (then date)
133+ * but specifying namespaces runs them in namespace order (then date).
131134 *
132- * @var array |string|null
135+ * @var list<string> |string|null
133136 */
134137 protected $ namespace = 'Tests\Support ' ;
135138
@@ -156,17 +159,17 @@ abstract class CIUnitTestCase extends TestCase
156159 protected $ migrations ;
157160
158161 /**
159- * Seeder instance
162+ * Seeder instance.
160163 *
161- * @var Seeder
164+ * @var Seeder|null
162165 */
163166 protected $ seeder ;
164167
165168 /**
166169 * Stores information needed to remove any
167- * rows inserted via $this->hasInDatabase();
170+ * rows inserted via $this->hasInDatabase().
168171 *
169- * @var array
172+ * @var list< array<int|string, mixed>>
170173 */
171174 protected $ insertCache = [];
172175
@@ -186,27 +189,27 @@ abstract class CIUnitTestCase extends TestCase
186189 * Values to be set in the SESSION global
187190 * before running the test.
188191 *
189- * @var array
192+ * @var array<int|string, mixed>
190193 */
191194 protected $ session = [];
192195
193196 /**
194- * Enabled auto clean op buffer after request call
197+ * Enabled auto clean op buffer after request call.
195198 *
196199 * @var bool
197200 */
198201 protected $ clean = true ;
199202
200203 /**
201- * Custom request's headers
204+ * Custom request's headers.
202205 *
203- * @var array
206+ * @var array<string, Header|list<Header>>
204207 */
205208 protected $ headers = [];
206209
207210 /**
208211 * Allows for formatting the request body to what
209- * the controller is going to expect
212+ * the controller is going to expect.
210213 *
211214 * @var string
212215 */
@@ -276,7 +279,7 @@ protected function tearDown(): void
276279 * Checks for traits with corresponding
277280 * methods for setUp or tearDown.
278281 *
279- * @param string $stage 'setUp' or 'tearDown'
282+ * @param 'setUp'| 'tearDown' $stage
280283 */
281284 private function callTraitMethods (string $ stage ): void
282285 {
@@ -298,7 +301,7 @@ private function callTraitMethods(string $stage): void
298301 // --------------------------------------------------------------------
299302
300303 /**
301- * Resets shared instanced for all Factories components
304+ * Resets shared instanced for all Factories components.
302305 *
303306 * @return void
304307 */
@@ -308,7 +311,7 @@ protected function resetFactories()
308311 }
309312
310313 /**
311- * Resets shared instanced for all Services
314+ * Resets shared instanced for all Services.
312315 *
313316 * @return void
314317 */
@@ -318,7 +321,7 @@ protected function resetServices(bool $initAutoloader = true)
318321 }
319322
320323 /**
321- * Injects the mock Cache driver to prevent filesystem collisions
324+ * Injects the mock Cache driver to prevent filesystem collisions.
322325 *
323326 * @return void
324327 */
@@ -328,7 +331,7 @@ protected function mockCache()
328331 }
329332
330333 /**
331- * Injects the mock email driver so no emails really send
334+ * Injects the mock email driver so no emails really send.
332335 *
333336 * @return void
334337 */
@@ -338,7 +341,7 @@ protected function mockEmail()
338341 }
339342
340343 /**
341- * Injects the mock session driver into Services
344+ * Injects the mock session driver into Services.
342345 *
343346 * @return void
344347 */
0 commit comments