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:
Ronald Barendse
2025-03-03 07:38:30 +01:00
committed by GitHub
parent 561d871677
commit 780184e553
35 changed files with 237 additions and 453 deletions

View File

@@ -1,35 +0,0 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using AutoFixture.NUnit3;
using Microsoft.Extensions.Options;
using NUnit.Framework;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Tests.UnitTests.AutoFixture;
using Umbraco.Cms.Web.Common.AspNetCore;
using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Configuration.Models;
[TestFixture]
public class GlobalSettingsTests
{
[InlineAutoMoqData("~/umbraco", "/", "umbraco")]
[InlineAutoMoqData("~/umbraco", "/MyVirtualDir", "umbraco")]
[InlineAutoMoqData("~/customPath", "/MyVirtualDir/", "umbraco")]
[InlineAutoMoqData("~/some-wacky/nestedPath", "/MyVirtualDir", "umbraco")]
[InlineAutoMoqData("~/some-wacky/nestedPath", "/MyVirtualDir/NestedVDir/", "umbraco")]
public void Umbraco_Mvc_Area(
string path,
string rootPath,
string outcome,
[Frozen] IOptionsMonitor<HostingSettings> hostingSettings,
AspNetCoreHostingEnvironment hostingEnvironment)
{
hostingSettings.CurrentValue.ApplicationVirtualPath = rootPath;
var globalSettings = new GlobalSettings();
Assert.AreEqual(outcome, globalSettings.GetUmbracoMvcAreaNoCache(hostingEnvironment));
}
}