Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getViolationsCount example
$this
->
createMock
(
ConstraintViolation::
class
)
,
]
)
;
$originalValidator
->
method
(
'validate'
)
->
willReturn
(
$violations
)
;
$validator
->
validate
(
new
\
stdClass
(
)
)
;
$collector
->
lateCollect
(
)
;
$calls
=
$collector
->
getCalls
(
)
;
$this
->
assertCount
(
1,
$calls
)
;
$this
->
assertSame
(
2,
$collector
->
getViolationsCount
(
)
)
;
$call
=
$calls
[
0
]
;
$this
->
assertArrayHasKey
(
'caller',
$call
)
;
$this
->
assertArrayHasKey
(
'context',
$call
)
;
$this
->
assertArrayHasKey
(
'violations',
$call
)
;
$this
->
assertCount
(
2,
$call
[
'violations'
]
)
;
}
public
function
testReset
(
)
{