From 7ccc434bd6d12b18470a13dc0c4c2aec1b29ff3b Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Thu, 19 Aug 2021 09:08:12 +0200 Subject: [PATCH] Inject IHostingEnvironment to UmbracoBuilder to fix integration tests --- .../TestServerTest/UmbracoTestServerTestBase.cs | 6 ++++-- .../Testing/UmbracoIntegrationTest.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs b/src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs index 71b9ac3ef9..96681c67da 100644 --- a/src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs +++ b/src/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs @@ -134,15 +134,17 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest public override void ConfigureServices(IServiceCollection services) { services.AddTransient(); + + Core.Hosting.IHostingEnvironment hostingEnvironment = TestHelper.GetHostingEnvironment(); TypeLoader typeLoader = services.AddTypeLoader( GetType().Assembly, - TestHelper.GetHostingEnvironment(), + hostingEnvironment, TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration, TestHelper.Profiler); - var builder = new UmbracoBuilder(services, Configuration, typeLoader); + var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment); builder .AddConfiguration() diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index bb4be6f368..314a614b49 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -212,7 +212,7 @@ namespace Umbraco.Cms.Tests.Integration.Testing TestHelper.Profiler); var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment); - builder.Services.AddLogger(TestHelper.GetHostingEnvironment(), TestHelper.GetLoggingConfiguration(), Configuration); + builder.Services.AddLogger(hostingEnvironment, TestHelper.GetLoggingConfiguration(), Configuration); builder.AddConfiguration() .AddUmbracoCore()