common\WebTestCase::getKernelClass PHP Method

getKernelClass() protected static method

When the Kernel is located, the file is required.
protected static getKernelClass ( ) : string
return string The Kernel class name
    protected static function getKernelClass()
    {
        $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();
        $finder = new Finder();
        $finder->name('AppKernel.php')->depth(0)->in($dir);
        $results = iterator_to_array($finder);
        if (!count($results)) {
            throw new \RuntimeException('Either set KERNEL_DIR in your phpunit.xml according to http://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.');
        }
        $file = current($results);
        $class = $file->getBasename('.php');
        require_once $file;
        return $class;
    }