@@ -205,6 +205,72 @@ public function boot()
205
205
$ app ->boot ();
206
206
});
207
207
208
+ it ('calls registered callbacks ' , function () {
209
+ $ app = new Application (temp ('base_path ' ));
210
+
211
+ mkdir ($ app ->storagePath ('framework/cache ' ), 0777 , true );
212
+
213
+ $ app ->bind ('config ' , fn () => new ConfigRepository );
214
+
215
+ $ manifest = mock (\Roots \Acorn \PackageManifest::class);
216
+
217
+ $ app ->singleton (\Illuminate \Foundation \PackageManifest::class, fn () => $ manifest );
218
+
219
+ $ manifest
220
+ ->shouldReceive ('providers ' )
221
+ ->andReturn ([]);
222
+
223
+ $ callback = Mockery::mock (new class
224
+ {
225
+ public function __invoke (...$ args ) {}
226
+ });
227
+
228
+ $ callback
229
+ ->shouldReceive ('__invoke ' )
230
+ ->withArgs ([$ app ])
231
+ ->once ();
232
+
233
+ $ app ->registered ($ callback );
234
+
235
+ $ app ->registerConfiguredProviders ();
236
+ });
237
+
238
+ it ('calls booting callbacks ' , function () {
239
+ $ app = new Application ;
240
+
241
+ $ callback = Mockery::mock (new class
242
+ {
243
+ public function __invoke (...$ args ) {}
244
+ });
245
+
246
+ $ callback
247
+ ->shouldReceive ('__invoke ' )
248
+ ->withArgs ([$ app ])
249
+ ->once ();
250
+
251
+ $ app ->booting ($ callback );
252
+
253
+ $ app ->boot ();
254
+ });
255
+
256
+ it ('calls booted callbacks ' , function () {
257
+ $ app = new Application ;
258
+
259
+ $ callback = Mockery::mock (new class
260
+ {
261
+ public function __invoke (...$ args ) {}
262
+ });
263
+
264
+ $ callback
265
+ ->shouldReceive ('__invoke ' )
266
+ ->withArgs ([$ app ])
267
+ ->once ();
268
+
269
+ $ app ->booted ($ callback );
270
+
271
+ $ app ->boot ();
272
+ });
273
+
208
274
it ('uses custom aliases ' , function () {
209
275
$ app = new Application ;
210
276
0 commit comments