Remove UmbracoPath setting (#16037)
* Use require modifier instead of setting null-suppressed default values * Only remove read-only properties when IgnoreReadOnlyProperties is set * Obsolete UmbracoPath property and remove work-around for obsolete setter * Remove UmbracoPath setting and use constant instead * Remove usage of GetBackOfficePath * Add IHostingEnvironment.GetBackOfficePath() extension method * Add Constants.System.UmbracoPathSegment constant * Update Constants.System XML docs * Replace StringBuilder with string interpolation Co-authored-by: Nuklon <Nuklon@users.noreply.github.com> * Fix syntax error * Removed uses of obsoletes. * Further obsolete messages. * Cleaned up usings. * Update src/Umbraco.Infrastructure/Install/FilePermissionHelper.cs Co-authored-by: Ronald Barendse <ronald@barend.se> --------- Co-authored-by: Nuklon <Nuklon@users.noreply.github.com> Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
@@ -26,8 +26,8 @@ public class RenderNoContentControllerTests
|
||||
var mockHostingEnvironment = new Mock<IHostingEnvironment>();
|
||||
var controller = new RenderNoContentController(
|
||||
new TestUmbracoContextAccessor(mockUmbracoContext.Object),
|
||||
new TestOptionsSnapshot<GlobalSettings>(new GlobalSettings()),
|
||||
mockHostingEnvironment.Object);
|
||||
mockHostingEnvironment.Object,
|
||||
new TestOptionsSnapshot<GlobalSettings>(new GlobalSettings()));
|
||||
|
||||
var result = controller.Index() as RedirectResult;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RenderNoContentControllerTests
|
||||
{
|
||||
NoNodesViewPath = viewPath,
|
||||
});
|
||||
var controller = new RenderNoContentController(new TestUmbracoContextAccessor(mockUmbracoContext.Object), globalSettings, mockHostingEnvironment.Object);
|
||||
var controller = new RenderNoContentController(new TestUmbracoContextAccessor(mockUmbracoContext.Object), mockHostingEnvironment.Object, globalSettings);
|
||||
|
||||
var result = controller.Index() as ViewResult;
|
||||
Assert.IsNotNull(result);
|
||||
|
||||
@@ -38,9 +38,8 @@ public class SurfaceControllerTests
|
||||
{
|
||||
var backofficeSecurityAccessor = Mock.Of<IBackOfficeSecurityAccessor>();
|
||||
Mock.Get(backofficeSecurityAccessor).Setup(x => x.BackOfficeSecurity).Returns(Mock.Of<IBackOfficeSecurity>());
|
||||
var globalSettings = new GlobalSettings();
|
||||
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(globalSettings, _umbracoContextAccessor);
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(_umbracoContextAccessor);
|
||||
|
||||
var umbracoContextReference = umbracoContextFactory.EnsureUmbracoContext();
|
||||
var umbracoContext = umbracoContextReference.UmbracoContext;
|
||||
@@ -57,10 +56,9 @@ public class SurfaceControllerTests
|
||||
[Test]
|
||||
public void Umbraco_Context_Not_Null()
|
||||
{
|
||||
var globalSettings = new GlobalSettings();
|
||||
var backofficeSecurityAccessor = Mock.Of<IBackOfficeSecurityAccessor>();
|
||||
Mock.Get(backofficeSecurityAccessor).Setup(x => x.BackOfficeSecurity).Returns(Mock.Of<IBackOfficeSecurity>());
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(globalSettings, _umbracoContextAccessor);
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(_umbracoContextAccessor);
|
||||
|
||||
var umbracoContextReference = umbracoContextFactory.EnsureUmbracoContext();
|
||||
var umbCtx = umbracoContextReference.UmbracoContext;
|
||||
@@ -79,9 +77,8 @@ public class SurfaceControllerTests
|
||||
content.Setup(x => x.Id).Returns(2);
|
||||
var backofficeSecurityAccessor = Mock.Of<IBackOfficeSecurityAccessor>();
|
||||
Mock.Get(backofficeSecurityAccessor).Setup(x => x.BackOfficeSecurity).Returns(Mock.Of<IBackOfficeSecurity>());
|
||||
var globalSettings = new GlobalSettings();
|
||||
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(globalSettings, _umbracoContextAccessor);
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(_umbracoContextAccessor);
|
||||
|
||||
var umbracoContextReference = umbracoContextFactory.EnsureUmbracoContext();
|
||||
var umbracoContext = umbracoContextReference.UmbracoContext;
|
||||
@@ -101,10 +98,9 @@ public class SurfaceControllerTests
|
||||
[Test]
|
||||
public void Mock_Current_Page()
|
||||
{
|
||||
var globalSettings = new GlobalSettings();
|
||||
var backofficeSecurityAccessor = Mock.Of<IBackOfficeSecurityAccessor>();
|
||||
Mock.Get(backofficeSecurityAccessor).Setup(x => x.BackOfficeSecurity).Returns(Mock.Of<IBackOfficeSecurity>());
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(globalSettings, _umbracoContextAccessor);
|
||||
var umbracoContextFactory = TestUmbracoContextFactory.Create(_umbracoContextAccessor);
|
||||
|
||||
var umbracoContextReference = umbracoContextFactory.EnsureUmbracoContext();
|
||||
var umbracoContext = umbracoContextReference.UmbracoContext;
|
||||
|
||||
Reference in New Issue
Block a user