Updated SettingsForTest to return mockable umbraco settings so we can set whatever we want. Fixing up unit tests. Removes calls to CleanUmbracoSettingsConfig and EnsureUmbracoSettingsConfig since we should be dealing with the mockable settings.
This commit is contained in:
@@ -13,10 +13,15 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
return new OptionalCommaDelimitedConfigurationElement(
|
||||
(CommaDelimitedConfigurationElement)this["imageFileTypes"],
|
||||
//set the default
|
||||
new[] { "jpeg", "jpg", "gif", "bmp", "png", "tiff", "tif" });
|
||||
GetDefaultImageFileTypes());
|
||||
}
|
||||
}
|
||||
|
||||
internal static string[] GetDefaultImageFileTypes()
|
||||
{
|
||||
return new[] {"jpeg", "jpg", "gif", "bmp", "png", "tiff", "tif"};
|
||||
}
|
||||
|
||||
[ConfigurationProperty("allowedAttributes")]
|
||||
internal CommaDelimitedConfigurationElement ImageTagAllowedAttributes
|
||||
{
|
||||
@@ -61,5 +66,16 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
}
|
||||
}
|
||||
|
||||
internal static ImagingAutoFillPropertiesCollection GetDefaultImageAutoFillProperties()
|
||||
{
|
||||
return new ImagingAutoFillPropertiesCollection
|
||||
{
|
||||
new ImagingAutoFillUploadFieldElement
|
||||
{
|
||||
Alias = "umbracoFile"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,21 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
var urls = this[prop] as ConfigurationElement;
|
||||
if (urls != null && urls.ElementInformation.IsPresent == false)
|
||||
{
|
||||
var dictionary = new Dictionary<char, string>()
|
||||
_defaultUrlReplacing = new UrlReplacingElement()
|
||||
{
|
||||
CharCollection = GetDefaultCharReplacements()
|
||||
};
|
||||
|
||||
return _defaultUrlReplacing;
|
||||
}
|
||||
|
||||
return (UrlReplacingElement)this["urlReplacing"];
|
||||
}
|
||||
}
|
||||
|
||||
internal static CharCollection GetDefaultCharReplacements()
|
||||
{
|
||||
var dictionary = new Dictionary<char, string>()
|
||||
{
|
||||
{' ',"-"},
|
||||
{'\"',""},
|
||||
@@ -77,28 +91,19 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{'>',""}
|
||||
};
|
||||
|
||||
//const string chars = @" ,"",',%,.,;,/,\,:,#,+,*,&,?,æ,ø,å,ä,ö,ü,ß,Ä,Ö,|,<,>";
|
||||
//const string chars = @" ,"",',%,.,;,/,\,:,#,+,*,&,?,æ,ø,å,ä,ö,ü,ß,Ä,Ö,|,<,>";
|
||||
|
||||
var collection = new CharCollection();
|
||||
foreach (var c in dictionary)
|
||||
{
|
||||
collection.Add(new CharElement
|
||||
{
|
||||
Char = c.Key.ToString(CultureInfo.InvariantCulture),
|
||||
Replacement = c.Value.ToString(CultureInfo.InvariantCulture)
|
||||
});
|
||||
}
|
||||
|
||||
_defaultUrlReplacing = new UrlReplacingElement()
|
||||
{
|
||||
CharCollection = collection
|
||||
};
|
||||
|
||||
return _defaultUrlReplacing;
|
||||
}
|
||||
|
||||
return (UrlReplacingElement)this["urlReplacing"];
|
||||
var collection = new CharCollection();
|
||||
foreach (var c in dictionary)
|
||||
{
|
||||
collection.Add(new CharElement
|
||||
{
|
||||
Char = c.Key.ToString(CultureInfo.InvariantCulture),
|
||||
Replacement = c.Value.ToString(CultureInfo.InvariantCulture)
|
||||
});
|
||||
}
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
bool IRequestHandlerSection.UseDomainPrefixes
|
||||
|
||||
Reference in New Issue
Block a user