Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createTestConfigurationWithXmlLoader example
$this
->
assertCount
(
0,
$enumStringMetadata
)
; // asserts the length constraint is not added to an enum
}
public
function
testFieldMappingsConfiguration
(
)
{
$validator
= Validation::
createValidatorBuilder
(
)
->
enableAttributeMapping
(
)
->
addXmlMappings
(
[
__DIR__.'/../Resources/validator/BaseUser.xml'
]
)
->
addLoader
(
new
DoctrineLoader
(
DoctrineTestHelper::
createTestEntityManager
(
DoctrineTestHelper::
createTestConfigurationWithXmlLoader
(
)
)
, '{}'
)
)
->
getValidator
(
)
;
$classMetadata
=
$validator
->
getMetadataFor
(
new
BaseUser
(
1, 'DemoUser'
)
)
;
$constraints
=
$classMetadata
->
getConstraints
(
)
;
$this
->
assertCount
(
0,
$constraints
)
;
}