Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CreateAliasTaskHandler example
$connection
=
$this
->
createMock
(
Connection::
class
)
;
$connection
->
expects
(
static
::
once
(
)
)
->
method
(
'fetchAllAssociative'
)
->
willThrowException
(
new
\
Exception
(
'test'
)
)
;
$elasticsearchHelper
=
$this
->
createMock
(
ElasticsearchHelper::
class
)
;
$elasticsearchHelper
->
expects
(
static
::
once
(
)
)
->
method
(
'logAndThrowException'
)
;
$handler
=
new
CreateAliasTaskHandler
(
$this
->
createMock
(
EntityRepository::
class
)
,
$this
->
createMock
(
Client::
class
)
,
$connection
,
$elasticsearchHelper
,
[
]
,
new
EventDispatcher
(
)
,
$this
->
createMock
(
AbstractKeyValueStorage::
class
)
)
;
$handler
->
run
(
)
;
}