Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
LinkExternalProtocolsConstraint example
$context
->
expects
(
$this
->
never
(
)
)
->
method
(
'addViolation'
)
;
}
else
{
$context
->
expects
(
$this
->
once
(
)
)
->
method
(
'addViolation'
)
;
}
// Setup some more allowed protocols. UrlHelper::
setAllowedProtocols
(
[
'http', 'https', 'magnet'
]
)
;
$constraint
=
new
LinkExternalProtocolsConstraint
(
)
;
$validator
=
new
LinkExternalProtocolsConstraintValidator
(
)
;
$validator
->
initialize
(
$context
)
;
$validator
->
validate
(
$link
,
$constraint
)
;
}
/** * Data provider for ::testValidate. */
public
function
providerValidate
(
)
{
$data
=
[
]
;