diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs index 1ad350ebf8..84bd22cc4f 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs @@ -135,17 +135,16 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting var umbracoContextAccessor = Umbraco.Web.Composing.Current.UmbracoContextAccessor; - var umbracoContextFactory = new UmbracoContextFactory( - umbracoContextAccessor, + var umbCtx = new UmbracoContext(httpContext, publishedSnapshotService.Object, - new TestVariationContextAccessor(), - new TestDefaultCultureAccessor(), + webSecurity.Object, Mock.Of(section => section.WebRouting == Mock.Of(routingSection => routingSection.UrlProviderMode == "Auto")), - globalSettings, Enumerable.Empty(), - Mock.Of()); + globalSettings, + new TestVariationContextAccessor()); - var umbCtx = umbracoContextFactory.EnsureUmbracoContext(httpContext).UmbracoContext; + //replace it + umbracoContextAccessor.UmbracoContext = umbCtx; var urlHelper = new Mock(); urlHelper.Setup(provider => provider.GetUrl(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()))