mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing functional tests using "I have enabled" steps
--HG-- branch : 1.x
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Web;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Autofac;
|
||||
@@ -8,6 +9,7 @@ using Orchard.Environment.Configuration;
|
||||
namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
public class MvcApplication : HttpApplication {
|
||||
private static IOrchardHost _host;
|
||||
private static IContainer _container;
|
||||
|
||||
public static void RegisterRoutes(RouteCollection routes) {
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
@@ -15,7 +17,8 @@ namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
|
||||
protected void Application_Start() {
|
||||
RegisterRoutes(RouteTable.Routes);
|
||||
_host = OrchardStarter.CreateHost(MvcSingletons);
|
||||
_container = OrchardStarter.CreateHostContainer(MvcSingletons);
|
||||
_host = _container.Resolve<IOrchardHost>();
|
||||
|
||||
_host.Initialize();
|
||||
|
||||
@@ -44,11 +47,14 @@ namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
}
|
||||
|
||||
public static IWorkContextScope CreateStandaloneEnvironment(string name) {
|
||||
var settings = new ShellSettings {
|
||||
Name = name,
|
||||
State = new TenantState("Uninitialized")
|
||||
};
|
||||
|
||||
var settings = _container.Resolve<IShellSettingsManager>().LoadSettings().SingleOrDefault(x => x.Name == name);
|
||||
if (settings == null) {
|
||||
settings = new ShellSettings {
|
||||
Name = name,
|
||||
State = new TenantState("Uninitialized")
|
||||
};
|
||||
}
|
||||
|
||||
return _host.CreateStandaloneEnvironment(settings);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user