Fix userid zero in integration tests (#14639)

* test: Fix invalid user ids

* feat: Update parameter defaults with constants
This commit is contained in:
Nikolaj Brask-Nielsen
2023-08-16 23:37:10 +02:00
committed by GitHub
parent 3a7e388547
commit d33c44c0a3
12 changed files with 101 additions and 101 deletions

View File

@@ -66,7 +66,7 @@ internal class ContentVersionService : IContentVersionService
}
/// <inheritdoc />
public void SetPreventCleanup(int versionId, bool preventCleanup, int userId = -1)
public void SetPreventCleanup(int versionId, bool preventCleanup, int userId = Constants.Security.SuperUserId)
{
using (ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true))
{

View File

@@ -1,4 +1,4 @@
// Copyright (c) Umbraco.
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core;
@@ -34,7 +34,7 @@ public static class MediaServiceExtensions
return mediaService.GetByIds(guids.Select(x => x.Guid));
}
public static IMedia CreateMedia(this IMediaService mediaService, string name, Udi parentId, string mediaTypeAlias, int userId = 0)
public static IMedia CreateMedia(this IMediaService mediaService, string name, Udi parentId, string mediaTypeAlias, int userId = Constants.Security.SuperUserId)
{
if (parentId is not GuidUdi guidUdi)
{