add(laravel): adding support for laravel inspired serviceproviders

This commit is contained in:
Patrick Stewart 2024-09-28 23:05:36 -07:00
parent 914949fdac
commit 3fbe700c26

View file

@ -13,18 +13,16 @@ class TestSetup {
Future<void> initialize() async { Future<void> initialize() async {
app = Application(); app = Application();
// Create a container // Create a container with MirrorsReflector
_container = Container(); _container = Container(MirrorsReflector());
// Set up MirrorsReflector
Reflector.global = MirrorsReflector();
// Initialize PlatformWithProviders // Initialize PlatformWithProviders
platformWithProviders = PlatformWithProviders(app); platformWithProviders = PlatformWithProviders(app);
// Configure the app to use our container // Configure the app to use our container
app.configure((angel) { app.configure((angel) {
angel.container.registerSingleton<Container>((c) => _container); // Instead of registering the container, we'll replace Angel's container
angel.container = _container;
}); });
// Allow some time for initialization // Allow some time for initialization