/drupal-project

Wunder's template for Drupal projects designed to work automatically with Lando, CircleCI and Helm.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

Wunder template for Drupal projects

This project template is an opinionated fork of the popular Drupal-composer template, configured to automatically deploy code to a Kubernetes cluster using CircleCI. Everything that works with the Drupal-composer project template will work with this repository, so we won't duplicate the documentation here.

Getting started

  • Click "Use this template" to generate a new project,
    • select the correct owner,
    • name the project as client-COUNTRYCODE-CLIENT-PROJECT,
    • make the repository private (unless the project is public).
  • Clone the new project locally and modify it's details:
    • composer.json name,
    • silta/silta.yml values.
  • Log in to CircleCI using your Github account and add the new project using existing config.

For additional instructions, please see the Silta documentation.

Local development

  1. Install the latest Lando and read the documentation.
  2. Update your project name and other Lando Drupal 9 recipe's parameters at .lando.yml.
  3. Run lando start.
  • lando - tools / commands overview.
  • lando grumphp <commands> - run GrumPHP code quality checks. Modified or new files are checked on git commit, see more at lando grumphp -h or wunderio/code-quality.
  • lando npm <commands> - run npm commands.
  • lando phpunit <commands> - run PHPUnit commands.
  • lando xdebug <mode> - load Xdebug in the selected mode(s).

Drupal development hints

Running tests

The PHPUnit test framework is predefined in this project, see phpunit.xml for details. Also, there is a minified web/modules/custom/phpunit_example module included from examples module for learning purposes.

Testing examples

Use lando phpunit to run the PHPUnit commands.

  • run one test class: lando phpunit path/to/your/class/file.php,
  • list groups: lando phpunit --list-groups,
  • run all the tests in a particular group: lando phpunit --group Groupname.