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')) {
                    
Home | Imprint | This part of the site doesn't use cookies.