updates unit test to ensure UmbracoContext.Current is nulled, updates dispose on application context to
not dispose the database if it is not configured.
This commit is contained in:
@@ -282,7 +282,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
get { return ApplicationContext.DatabaseContext; }
|
||||
}
|
||||
|
||||
protected UmbracoContext GetUmbracoContext(string url, int templateId, RouteData routeData = null)
|
||||
protected UmbracoContext GetUmbracoContext(string url, int templateId, RouteData routeData = null, bool setSingleton = false)
|
||||
{
|
||||
var cache = new PublishedContentCache();
|
||||
|
||||
@@ -300,6 +300,11 @@ namespace Umbraco.Tests.TestHelpers
|
||||
ApplicationContext,
|
||||
new PublishedCaches(cache, new PublishedMediaCache()));
|
||||
|
||||
if (setSingleton)
|
||||
{
|
||||
UmbracoContext.Current = ctx;
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user