Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tlattimore
Forked from juampynr/README.md
Created May 31, 2016 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlattimore/818e628a89816bff0b9a5041d7dda1b8 to your computer and use it in GitHub Desktop.
Save tlattimore/818e628a89816bff0b9a5041d7dda1b8 to your computer and use it in GitHub Desktop.
Run Drupal 8 web tests without installing Drupal
  1. Create a MySQL database.
  2. Create a user that has access to that database.
  3. Make sure that you have the PDO_MySQL PHP library (otherwise you will get an error because it is missing).
  4. Run the following script.
  5. Once tests complete, we need to stop PHP's web server.

Note: there seem to be some issues with PHP's built-in web server. Please report them here https://www.drupal.org/node/1543858.

# Next, download core and run web tests.
wget -q -O - http://ftp.drupal.org/files/projects/drupal-8.1.x-dev.tar.gz | tar xz
mv my_module drupal-8.1.x-dev/modules/
cd drupal-8.1.x-dev
# You need to download the module's dependencies. Perhaps Composer can do this?
drush dl ctools
# Start PHP's built-in web server in the background.
nohup php -S localhost:9000 > phpd.log 2>&1 &
# Run tests.
php ./core/scripts/run-tests.sh --sqlite /tmp/test.sqlite --dburl mysql://user:pass@localhost/db_name --url http://localhost:9000 --module my_module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment