From 6b195587c12f4e10863000a6472256e5780d87b3 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 3 Sep 2015 16:24:43 +0200 Subject: [PATCH] U4-7042 - fix root path for tests --- src/Umbraco.Core/IO/PhysicalFileSystem.cs | 10 ++++++++++ src/Umbraco.Tests/App.config | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index 9bef38b68f..8fcda3d10e 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -33,6 +33,16 @@ namespace Umbraco.Core.IO if (rootPath.StartsWith("~/")) throw new ArgumentException("The rootPath argument cannot be a virtual path and cannot start with '~/'"); + // rootPath should be... rooted, as in, it's a root path! + // but the test suite App.config cannot really "root" anything so we'll have to do it here + + //var localRoot = AppDomain.CurrentDomain.BaseDirectory; + var localRoot = IOHelper.GetRootDirectorySafe(); + if (Path.IsPathRooted(rootPath) == false) + { + rootPath = Path.Combine(localRoot, rootPath); + } + RootPath = rootPath; _rootUrl = rootUrl; } diff --git a/src/Umbraco.Tests/App.config b/src/Umbraco.Tests/App.config index 9599390dfb..aa8ed6b0a7 100644 --- a/src/Umbraco.Tests/App.config +++ b/src/Umbraco.Tests/App.config @@ -12,41 +12,41 @@ - + - + - + - + - + - +