diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 4eab611fc2..37c5385595 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -80,9 +80,9 @@ namespace Content.Client ClientContentIoC.Register(); - if (TestingCallbacks != null) + foreach (var callback in TestingCallbacks) { - var cast = (ClientModuleTestingCallbacks) TestingCallbacks; + var cast = (ClientModuleTestingCallbacks) callback; cast.ClientBeforeIoC?.Invoke(); } diff --git a/Content.IntegrationTests/ContentIntegrationTest.cs b/Content.IntegrationTests/ContentIntegrationTest.cs index 85184d6f65..d4172e53d2 100644 --- a/Content.IntegrationTests/ContentIntegrationTest.cs +++ b/Content.IntegrationTests/ContentIntegrationTest.cs @@ -57,6 +57,20 @@ namespace Content.IntegrationTests options ??= new ServerIntegrationOptions(); options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly; options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly; + options.BeforeStart += () => + { + IoCManager.Resolve().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks + { + ServerBeforeIoC = () => + { + if (options is ServerContentIntegrationOption contentOptions) + { + contentOptions.ContentBeforeIoC?.Invoke(); + } + } + }); + }; + return base.StartServer(options); } @@ -69,11 +83,6 @@ namespace Content.IntegrationTests { ServerBeforeIoC = () => { - if (options is ServerContentIntegrationOption contentOptions) - { - contentOptions.ContentBeforeIoC?.Invoke(); - } - IoCManager.Register(true); } }); diff --git a/Content.Server/EntryPoint.cs b/Content.Server/EntryPoint.cs index 9542e2b36a..77ce2ea747 100644 --- a/Content.Server/EntryPoint.cs +++ b/Content.Server/EntryPoint.cs @@ -40,9 +40,9 @@ namespace Content.Server ServerContentIoC.Register(); - if (TestingCallbacks != null) + foreach (var callback in TestingCallbacks) { - var cast = (ServerModuleTestingCallbacks) TestingCallbacks; + var cast = (ServerModuleTestingCallbacks) callback; cast.ServerBeforeIoC?.Invoke(); }