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($coversfunction Dstring $class) {
            $reflector = new \ReflectionClass($class);

            return $reflector->isUserDefined();
        });

        
Home | Imprint | This part of the site doesn't use cookies.