test-site.php

Same filename and directory in other branches
  1. 10 core/scripts/test-site.php
  2. 11.x core/scripts/test-site.php
  3. 9 core/scripts/test-site.php
  4. 8.9.x core/scripts/test-site.php

A command line application to install Drupal for tests.

File

core/scripts/test-site.php

View source
#!/usr/bin/env php
<?php


/**
 * @file
 * A command line application to install Drupal for tests.
 */

use Drupal\TestSite\TestSiteApplication;
if (PHP_SAPI !== 'cli') {
  return;
}
require_once __DIR__ . '/../../autoload_runtime.php';
return static function () {
  // Use the PHPUnit bootstrap to prime an autoloader that works for
  // test classes.
  // Note we have to disable the SYMFONY_DEPRECATIONS_HELPER to ensure
  // deprecation notices are not triggered.
  putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');
  require_once __DIR__ . '/../tests/bootstrap.php';
  // The application version is 0.1.0 to indicate that it is for internal use
  // only and not currently API.
  return new TestSiteApplication('test-site', '0.1.0');
};

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.