Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FooSubType example
$resolvedFormType
=
$this
->registry->
getType
(
FooType::
class
)
;
$this
->
assertInstanceOf
(
ResolvedFormType::
class
,
$resolvedFormType
)
;
$this
->
assertSame
(
$type
,
$resolvedFormType
->
getInnerType
(
)
)
;
$this
->
assertSame
(
[
$ext1
,
$ext2
]
,
$resolvedFormType
->
getTypeExtensions
(
)
)
;
}
public
function
testGetTypeConnectsParent
(
)
{
$parentType
=
new
FooType
(
)
;
$type
=
new
FooSubType
(
)
;
$this
->extension1->
addType
(
$parentType
)
;
$this
->extension2->
addType
(
$type
)
;
$resolvedFormType
=
$this
->registry->
getType
(
FooSubType::
class
)
;
$this
->
assertInstanceOf
(
ResolvedFormType::
class
,
$resolvedFormType
)
;
$this
->
assertSame
(
$type
,
$resolvedFormType
->
getInnerType
(
)
)
;
$resolvedParentFormType
=
$resolvedFormType
->
getParent
(
)
;