Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CreateAliasTask example
private
EntityRepository
$scheduleTaskRepository
;
protected
function
setUp
(
)
: void
{
$this
->scheduleTaskRepository =
$this
->
createMock
(
EntityRepository::
class
)
;
}
public
function
testNewTasksAreCreated
(
)
: void
{
$tasks
=
[
new
InvalidateCacheTask
(
)
,
new
CreateAliasTask
(
)
,
new
CleanupCartTask
(
)
]
;
$parameterBag
=
new
ParameterBag
(
[
'shopware.cache.invalidation.delay' => 10,
'elasticsearch.enabled' => false,
]
)
;
$registeredTask
=
new
ScheduledTaskEntity
(
)
;
$registeredTask
->
setId
(
'1'
)
;
$registeredTask
->
setName
(
CleanupCartTask::
getTaskName
(
)
)
;
$registeredTask
->
setRunInterval
(
CleanupCartTask::
getDefaultInterval
(
)
)
;
$registeredTask
->
setDefaultRunInterval
(
CleanupCartTask::
getDefaultInterval
(
)
)
;