Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ConstraintVisitor example
final
class
PhpAstExtractorTest
extends
TestCase
{
/** * @dataProvider resourcesProvider */
public
function
testExtraction
(
iterable|string
$resource
)
{
$extractor
=
new
PhpAstExtractor
(
[
new
TransMethodVisitor
(
)
,
new
TranslatableMessageVisitor
(
)
,
new
ConstraintVisitor
(
[
'NotBlank',
'Isbn',
'Length',
]
,
new
TranslatableMessageVisitor
(
)
)
,
]
)
;
$extractor
->
setPrefix
(
'prefix'
)
;
$catalogue
=
new
MessageCatalogue
(
'en'
)
;
$extractor
->
extract
(
$resource
,
$catalogue
)
;
$expectedHeredoc
= <<<EOF