True standalone test

This commit is contained in:
Stephan
2018-12-17 18:52:43 +01:00
parent 7cad591b86
commit 35ebced4ed
13 changed files with 400 additions and 168 deletions

View File

@@ -101,11 +101,11 @@ namespace Umbraco.Web
/// <para>If an actual current UmbracoContext is already present, the disposable object is null and this method does nothing.</para>
/// <para>Otherwise, a temporary, dummy UmbracoContext is created and registered in the accessor. And disposed and removed from the accessor.</para>
/// </remarks>
internal static IDisposable EnsureContext() // keep this internal for now!
internal static IDisposable EnsureContext(HttpContextBase httpContext = null) // keep this internal for now!
{
if (Composing.Current.UmbracoContext != null) return null;
var httpContext = new HttpContextWrapper(System.Web.HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter())));
httpContext = httpContext ?? new HttpContextWrapper(System.Web.HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter())));
return EnsureContext(
Composing.Current.UmbracoContextAccessor,