add(laravel): adding support for laravel inspired serviceproviders
This commit is contained in:
parent
914949fdac
commit
3fbe700c26
1 changed files with 4 additions and 6 deletions
|
@ -13,18 +13,16 @@ class TestSetup {
|
|||
Future<void> initialize() async {
|
||||
app = Application();
|
||||
|
||||
// Create a container
|
||||
_container = Container();
|
||||
|
||||
// Set up MirrorsReflector
|
||||
Reflector.global = MirrorsReflector();
|
||||
// Create a container with MirrorsReflector
|
||||
_container = Container(MirrorsReflector());
|
||||
|
||||
// Initialize PlatformWithProviders
|
||||
platformWithProviders = PlatformWithProviders(app);
|
||||
|
||||
// Configure the app to use our container
|
||||
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
|
Loading…
Reference in a new issue