Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
TraversableContainsIdentical example
UpdateSubscriber::
getSubscribedEvents
(
)
)
;
}
public
function
testUpdateSucessfull
(
)
: void
{
$context
= Context::
createDefaultContext
(
)
;
$version
= '6.0.1_test';
$notificationServiceMock
=
$this
->
createMock
(
NotificationService::
class
)
;
$notificationServiceMock
->
expects
(
static
::
once
(
)
)
->
method
(
'createNotification'
)
->
with
(
new
TraversableContainsIdentical
(
'Updated successfully to version ' .
$version
)
)
;
$eventMock
=
$this
->
createMock
(
UpdatePostFinishEvent::
class
)
;
$eventMock
->
expects
(
static
::
any
(
)
)
->
method
(
'getContext'
)
->
willReturn
(
$context
)
;
$eventMock
->
expects
(
static
::
any
(
)
)
->
method
(
'getNewVersion'
)
->
willReturn
(
$version
)
;
$updateSubscriber
=
new
UpdateSubscriber
(
$notificationServiceMock
)
;
$updateSubscriber
->
updateFinishedDone
(
$eventMock
)
;
}