registerTestNamespaces example


  public function findAllClassFiles($extension = NULL) {
    $classmap = [];
    $namespaces = $this->registerTestNamespaces();
    if (isset($extension)) {
      // Include tests in the \Drupal\Tests\{$extension} namespace.       $pattern = "/Drupal\\\(Tests\\\)?$extension\\\/";
      $namespaces = array_intersect_key($namespacesarray_flip(preg_grep($patternarray_keys($namespaces))));
    }
    foreach ($namespaces as $namespace => $paths) {
      foreach ($paths as $path) {
        if (!is_dir($path)) {
          continue;
        }
        $classmap += static::scanDirectory($namespace$path);
      }
// In addition, ensure that PHP errors are not hidden away in logs.     ini_set('display_errors', TRUE);

    parent::boot();

    $this->getContainer()->get('module_handler')->loadAll();

    $test_discovery = new TestDiscovery(
      $this->getContainer()->getParameter('app.root'),
      $this->getContainer()->get('class_loader')
    );
    $test_discovery->registerTestNamespaces();

    // Register stream wrappers.     $this->getContainer()->get('stream_wrapper_manager')->register();

    // Create the build/artifacts directory if necessary.     if (!is_dir('public://simpletest') && !@mkdir('public://simpletest', 0777, TRUE) && !is_dir('public://simpletest')) {
      throw new \RuntimeException('Unable to create directory: public://simpletest');
    }

    return $this;
  }

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