Forked from yann-yinn/drupal-7--bootstrap--phpunit.php
Last active
November 2, 2017 20:34
-
-
Save permanovd/cb9c02920c49a29c97653f4f697147b1 to your computer and use it in GitHub Desktop.
Drupal 7 bootstrap for php unit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Script to bootstrap Drupal 7 for PHPUnit tests. | |
* On multisite installation, set $http_host variable | |
* to the site you want to test. | |
* | |
* Put this file into drupal root directory and | |
* and specify it in phpunit.xml file. | |
*/ | |
// There are problems (notices) with host and REMOTE_ADDR, which fill | |
// all console log. | |
$_SERVER['HTTP_HOST'] = 'localhost'; | |
$_SERVER['SCRIPT_NAME'] = '/index.php'; | |
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | |
$_SERVER['REQUEST_METHOD'] = 'GET'; | |
$_SERVER['SERVER_NAME'] = NULL; | |
$_SERVER['SERVER_SOFTWARE'] = NULL; | |
$_SERVER['HTTP_USER_AGENT'] = NULL; | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment