Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setPreserveGlobalState example
public
function
startTestSuite
(
$suite
)
: void
{
$suiteName
=
$suite
->
getName
(
)
;
foreach
(
$suite
->
tests
(
)
as
$test
)
{
if
(
!
$test
instanceof TestCase
)
{
continue
;
}
if
(
null === Test::
getPreserveGlobalStateSettings
(
\
get_class
(
$test
)
,
$test
->
getName
(
false
)
)
)
{
$test
->
setPreserveGlobalState
(
false
)
;
}
}
if
(
-1 ===
$this
->state
)
{
echo
"Testing
$suiteName
\n";
$this
->state = 0;
if
(
!
class_exists
(
AnnotationRegistry::
class
, false
)
&&
class_exists
(
AnnotationRegistry::
class
)
)
{
if
(
method_exists
(
AnnotationRegistry::
class
, 'registerUniqueLoader'
)
)
{
AnnotationRegistry::
registerUniqueLoader
(
'class_exists'
)
;
}
elseif
(
method_exists
(
AnnotationRegistry::
class
, 'registerLoader'
)
)
{