Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CustomerRecoveryEntity example
$storable
=
new
StorableFlow
(
'name', Context::
createDefaultContext
(
)
)
;
$this
->storer->
restore
(
$storable
)
;
static
::
assertEmpty
(
$storable
->
data
(
)
)
;
}
public
function
testLoadEntity
(
)
: void
{
Feature::
skipTestIfActive
(
'v6.6.0.0',
$this
)
;
$entity
=
new
CustomerRecoveryEntity
(
)
;
$result
=
$this
->
createMock
(
EntitySearchResult::
class
)
;
$result
->
expects
(
static
::
once
(
)
)
->
method
(
'get'
)
->
willReturn
(
$entity
)
;
$this
->repository->
expects
(
static
::
once
(
)
)
->
method
(
'search'
)
->
willReturn
(
$result
)
;
$res
=
$this
->storer->
load
(
[
'3443', Context::
createDefaultContext
(
)
]
)
;
static
::
assertEquals
(
$res
,
$entity
)
;
}
public
function
testLoadNullEntity
(
)
: void
{
public
function
testRestoreScalarValuesCorrectly
(
)
: void
{
$salesChannel
=
new
SalesChannelEntity
(
)
;
$salesChannel
->
setTranslated
(
[
'name' => 'my-shop-name'
]
)
;
$context
=
$this
->
createMock
(
SalesChannelContext::
class
)
;
$context
->
expects
(
static
::
any
(
)
)
->
method
(
'getSalesChannel'
)
->
willReturn
(
$salesChannel
)
;
$event
=
new
CustomerAccountRecoverRequestEvent
(
$context
,
new
CustomerRecoveryEntity
(
)
,
'my-reset-url'
)
;
$storer
=
new
ScalarValuesStorer
(
)
;
$stored
=
$storer
->
store
(
$event
,
[
]
)
;
$flow
=
new
StorableFlow
(
'foo', Context::
createDefaultContext
(
)
,
$stored
)
;
$storer
->
restore
(
$flow
)
;