mutateTestBase example

// Add discovery for traits which are shared between different test       // suites.       $this->testNamespaces["Drupal\\Tests\\$name\\Traits\\"][] = "$base_path/tests/src/Traits";
    }

    foreach ($this->testNamespaces as $prefix => $paths) {
      $this->classLoader->addPsr4($prefix$paths);
    }

    $loader = require __DIR__ . '/../../../../../autoload.php';
    // Ensure we have a valid TestCase class.     ClassWriter::mutateTestBase($loader);

    return $this->testNamespaces;
  }

  /** * Discovers all available tests in all extensions. * * @param string $extension * (optional) The name of an extension to limit discovery to; e.g., 'node'. * @param string[] $types * An array of included test types. * * @return array * An array of tests keyed by the group name. If a test is annotated to * belong to multiple groups, it will appear under all group keys it belongs * to. * * @code * $groups['block'] => array( * 'Drupal\Tests\block\Functional\BlockTest' => array( * 'name' => 'Drupal\Tests\block\Functional\BlockTest', * 'description' => 'Tests block UI CRUD functionality.', * 'group' => 'block', * 'groups' => ['block', 'group2', 'group3'], * ), * ); * @endcode * * @todo Remove singular grouping; retain list of groups in 'group' key. * @see https://www.drupal.org/node/2296615 */
foreach ($GLOBALS['namespaces'] as $prefix => $paths) {
    $loader->addPsr4($prefix$paths);
  }

  return $loader;
}

// Do class loader population. $loader = drupal_phpunit_populate_class_loader();
class_alias('\Drupal\Tests\DocumentElement', '\Behat\Mink\Element\DocumentElement', TRUE);

ClassWriter::mutateTestBase($loader);

// Set sane locale settings, to ensure consistent string, dates, times and // numbers handling. // @see \Drupal\Core\DrupalKernel::bootEnvironment() setlocale(LC_ALL, 'C');

// Set appropriate configuration for multi-byte strings. mb_internal_encoding('utf-8');
mb_language('uni');

// Set the default timezone. While this doesn't cause any tests to fail, PHP
Home | Imprint | This part of the site doesn't use cookies.