Merge remote-tracking branch 'origin/6.1.4' into 7.0.0
Conflicts: .gitignore src/Umbraco.Core/Models/PropertyExtensions.cs src/Umbraco.Core/Models/PropertyTypeExtensions.cs src/Umbraco.Core/Security/AuthenticationExtensions.cs src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs src/Umbraco.Core/Security/UserData.cs src/Umbraco.Core/Umbraco.Core.csproj src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs src/Umbraco.Tests/Umbraco.Tests.csproj src/Umbraco.Web/Security/WebSecurity.cs src/Umbraco.Web/UmbracoModule.cs src/umbraco.businesslogic/BasePages/BasePage.cs src/umbraco.cms/businesslogic/datatype/DefaultData.cs src/umbraco.sln
This commit is contained in:
@@ -42,28 +42,39 @@ namespace Umbraco.Tests.TestHelpers
|
||||
private static volatile bool _firstRunInTestSession = true;
|
||||
private static readonly object Locker = new object();
|
||||
private bool _firstTestInFixture = true;
|
||||
private DefaultDatabaseFactory _dbFactory;
|
||||
|
||||
//Used to flag if its the first test in the current session
|
||||
private bool _isFirstRunInTestSession = false;
|
||||
//Used to flag if its the first test in the current fixture
|
||||
private bool _isFirstTestInFixture = false;
|
||||
|
||||
private ApplicationContext _appContext;
|
||||
|
||||
[SetUp]
|
||||
public override void Initialize()
|
||||
{
|
||||
InitializeFirstRunFlags();
|
||||
|
||||
_dbFactory = new DefaultDatabaseFactory(
|
||||
GetDbConnectionString(),
|
||||
GetDbProviderName());
|
||||
|
||||
base.Initialize();
|
||||
|
||||
|
||||
var path = TestHelper.CurrentAssemblyDirectory;
|
||||
AppDomain.CurrentDomain.SetData("DataDirectory", path);
|
||||
|
||||
DatabaseContext.Initialize(_dbFactory.ProviderName, _dbFactory.ConnectionString);
|
||||
var dbFactory = new DefaultDatabaseFactory(
|
||||
GetDbConnectionString(),
|
||||
GetDbProviderName());
|
||||
_appContext = new ApplicationContext(
|
||||
//assign the db context
|
||||
new DatabaseContext(dbFactory),
|
||||
//assign the service context
|
||||
new ServiceContext(new PetaPocoUnitOfWorkProvider(dbFactory), new FileUnitOfWorkProvider(), new PublishingStrategy()),
|
||||
//disable cache
|
||||
false)
|
||||
{
|
||||
IsReady = true
|
||||
};
|
||||
|
||||
base.Initialize();
|
||||
|
||||
DatabaseContext.Initialize(dbFactory.ProviderName, dbFactory.ConnectionString);
|
||||
|
||||
CreateSqlCeDatabase();
|
||||
|
||||
@@ -75,18 +86,7 @@ namespace Umbraco.Tests.TestHelpers
|
||||
|
||||
protected override void SetupApplicationContext()
|
||||
{
|
||||
//disable cache
|
||||
var cacheHelper = new CacheHelper(new NullCacheProvider(), false);
|
||||
|
||||
ApplicationContext.Current = new ApplicationContext(
|
||||
//assign the db context
|
||||
new DatabaseContext(_dbFactory),
|
||||
//assign the service context
|
||||
new ServiceContext(new PetaPocoUnitOfWorkProvider(), new FileUnitOfWorkProvider(), new PublishingStrategy(), cacheHelper),
|
||||
cacheHelper)
|
||||
{
|
||||
IsReady = true
|
||||
};
|
||||
ApplicationContext.Current = _appContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user