Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SalutationSorter example
$test
->
setId
(
Uuid::
randomHex
(
)
)
;
$test
->
setSalutationKey
(
'test'
)
;
$salutations
=
new
SalutationCollection
(
)
;
$salutations
->
add
(
$mr
)
;
$salutations
->
add
(
$mrs
)
;
$salutations
->
add
(
$notSpecified
)
;
$salutations
->
add
(
$test
)
;
static
::
assertSame
(
$salutations
->
first
(
)
,
$mr
)
;
$sorter
=
new
SalutationSorter
(
)
;
$salutations
=
$sorter
->
sort
(
$salutations
)
;
static
::
assertSame
(
$salutations
->
first
(
)
,
$notSpecified
)
;
}
}