Last active
September 24, 2020 18:57
-
-
Save amitaibu/2b8ce08c387e6162c3fd2d2112bb2c91 to your computer and use it in GitHub Desktop.
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
# https://ddev.readthedocs.io/en/stable/users/cli-usage/#drupal-8-quickstart | |
mkdir my-drupal8-site | |
cd my-drupal8-site | |
ddev config --project-type=drupal8 --docroot=web --create-docroot | |
ddev start | |
ddev composer create "drupal/recommended-project:^8" | |
ddev composer require drush/drush | |
ddev launch | |
# Install PHPunit | |
ddev composer require --dev phpunit/phpunit:^7 | |
ddev composer require --dev symfony/phpunit-bridge:^5.0 | |
ddev composer require --dev mikey179/vfsstream | |
# Prepare config file. | |
cp web/core/phpunit.xml.dist web/core/phpunit.xml | |
sed -i 's/<env name="SIMPLETEST_BASE_URL" value=""\/>/<env name="SIMPLETEST_BASE_URL" value="http:\/\/localhost"\/>/' web/core/phpunit.xml | |
sed -i 's/<env name="SIMPLETEST_DB" value=""\/>/<env name="SIMPLETEST_DB" value="mysql:\/\/db:db@db\/db"\/>/' web/core/phpunit.xml | |
# Get module, with the `add-test` branch | |
git clone git@gitlab.com:drupalforks/pluggable_entity_view_builder.git web/modules/pluggable_entity_view_builder -b add-test | |
# Execute phpunit from the container. | |
ddev ssh | |
../vendor/bin/phpunit -c core/phpunit.xml modules/pluggable_entity_view_builder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's how it would look in a more generic way (i.e. without my specific module):