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 {
|
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
|
Loading…
Reference in a new issue