Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
forClassName example
$cache
=
array_replace_recursive
(
$cache
,
[
\
get_class
(
$test
)
=>
[
'covers' =>
$covers
,
]
,
]
)
;
$r
->
setValue
(
TestUtil::
class
,
$cache
)
;
}
private
function
addCoversForDocBlockInsideRegistry
(
Test
$test
, array
$covers
)
: void
{
$docBlock
= Registry::
getInstance
(
)
->
forClassName
(
\
get_class
(
$test
)
)
;
$symbolAnnotations
=
new
\
ReflectionProperty
(
$docBlock
, 'symbolAnnotations'
)
;
$symbolAnnotations
->
setAccessible
(
true
)
;
// Exclude internal classes; PHPUnit 9.1+ is picky about tests covering, say, a \RuntimeException
$covers
=
array_filter
(
$covers
,
function
Dstring
$class
)
{
$reflector
=
new
\
ReflectionClass
(
$class
)
;
return
$reflector
->
isUserDefined
(
)
;
}
)
;