Working with tests

UI Patterns is tested using PHPUnit in Drupal 8.

To build the test site just run:

$ composer install

After that you’ll find a fully functional Drupal 8 site under ./build, thanks to the integration with the OpenEuropa Task Runner.

Tu run tests use:

$ ./vendor/bin/phpunit

Working with coding standards

UI Patterns coding standards checks are ran using GrumPHP.

$ ./vendor/bin/grumphp run

Docker Compose

UI Patterns ships with a docker-compose.yml file which can be used to streamline local development and tests execution.

Setup Docker Compose by copying docker-compose.yml to docker-compose.override.yml and replace ${TRAVIS_PHP_VERSION} with the desired PHP version (either “5.6” or “7.1”).

After that run:

$ docker-compose up -d
$ docker-compose exec -u www-data php composer install
$ docker-compose exec -u www-data php ./vendor/bin/run drupal:site-setup
$ docker-compose exec -u www-data php ./vendor/bin/run drupal:site-install
$ docker-compose exec -u www-data php chown -R www-data:www-data build

You’ll then have a fully functional test site at http://localhost:8080.

To run all tests use:

$ docker-compose exec -u www-data php ./vendor/bin/grumphp run
$ docker-compose exec -u www-data php ./vendor/bin/phpunit