Skip to content

Instantly share code, notes, and snippets.

@bradfordcondon
Created February 12, 2018 21:02
Show Gist options
  • Save bradfordcondon/7506335de5e1c46b5350038225ef2e30 to your computer and use it in GitHub Desktop.
Save bradfordcondon/7506335de5e1c46b5350038225ef2e30 to your computer and use it in GitHub Desktop.
php unit testing connect to drupal
require_once '../includes/tripal_alchemist.api.inc';
use PHPUnit\Framework\TestCase;
use PHPUnit\DbUnit\TestCaseTrait;
//Change this path for the docker!
define('DRUPAL_ROOT', '/Users/chet/UTK/tripal');
$start = getcwd();
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
chdir("/Users/chet/UTK/tripal");
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment