Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
OtherTypeExtension example
use
Symfony\Component\Form\AbstractTypeExtension;
use
Symfony\Component\Form\Exception\InvalidArgumentException;
use
Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension;
use
Symfony\Component\Form\FormTypeGuesserChain;
class
DependencyInjectionExtensionTest
extends
TestCase
{
public
function
testGetTypeExtensions
(
)
{
$typeExtension1
=
new
TestTypeExtension
(
)
;
$typeExtension2
=
new
TestTypeExtension
(
)
;
$typeExtension3
=
new
OtherTypeExtension
(
)
;
$typeExtension4
=
new
MultipleTypesTypeExtension
(
)
;
$extensions
=
[
'test' =>
new
\
ArrayIterator
(
[
$typeExtension1
,
$typeExtension2
,
$typeExtension4
]
)
,
'other' =>
new
\
ArrayIterator
(
[
$typeExtension3
,
$typeExtension4
]
)
,
]
;
$extension
=
new
DependencyInjectionExtension
(
new
ContainerBuilder
(
)
,
$extensions
,
[
]
)
;
$this
->
assertTrue
(
$extension
->
hasTypeExtensions
(
'test'
)
)
;
$this
->
assertTrue
(
$extension
->
hasTypeExtensions
(
'other'
)
)
;