Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AbstractDummyThirdChild example
public
function
testMappedObjectType
(
)
{
$mapping
=
new
ClassDiscriminatorMapping
(
'type',
[
'first' => AbstractDummyFirstChild::
class
,
'third' => AbstractDummyThirdChild::
class
,
]
)
;
$this
->
assertEquals
(
'first',
$mapping
->
getMappedObjectType
(
AbstractDummyFirstChild::
class
)
)
;
$this
->
assertEquals
(
'first',
$mapping
->
getMappedObjectType
(
new
AbstractDummyFirstChild
(
)
)
)
;
$this
->
assertNull
(
$mapping
->
getMappedObjectType
(
new
AbstractDummySecondChild
(
)
)
)
;
$this
->
assertSame
(
'third',
$mapping
->
getMappedObjectType
(
new
AbstractDummyThirdChild
(
)
)
)
;
}
}