Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
doesNotPerformAssertions example
if
(
class_exists
(
DebugClassLoader::
class
, false
)
)
{
DebugClassLoader::
checkClasses
(
)
;
}
$className
= \
get_class
(
$test
)
;
$groups
= Test::
getGroups
(
$className
,
$test
->
getName
(
false
)
)
;
if
(
$this
->checkNumAssertions
)
{
$assertions
= \
count
(
self::
$expectedDeprecations
)
+
$test
->
getNumAssertions
(
)
;
if
(
$test
->
doesNotPerformAssertions
(
)
&&
$assertions
> 0
)
{
$test
->
getTestResultObject
(
)
->
addFailure
(
$test
,
new
RiskyTestError
(
sprintf
(
'This test is annotated with "@doesNotPerformAssertions", but performed %s assertions',
$assertions
)
)
,
$time
)
;
}
elseif
(
$assertions
=== 0 && !
$test
->
doesNotPerformAssertions
(
)
&&
$test
->
getTestResultObject
(
)
->
noneSkipped
(
)
)
{
$test
->
getTestResultObject
(
)
->
addFailure
(
$test
,
new
RiskyTestError
(
'This test did not perform any assertions'
)
,
$time
)
;
}
$this
->checkNumAssertions = false;
}
if
(
$this
->runsInSeparateProcess
)
{
$deprecations
=
file_get_contents
(
$this
->runsInSeparateProcess
)
;
unlink
(
$this
->runsInSeparateProcess
)
;