Skip to content
Snippets Groups Projects
Commit 8dba598f authored by Antonio De Marco's avatar Antonio De Marco
Browse files

Fix documentation.

parent 10556d5f
Branches
Tags
No related merge requests found
...@@ -3,75 +3,52 @@ Working with tests ...@@ -3,75 +3,52 @@ Working with tests
UI Patterns is tested using both `Behat <http://behat.org/en/latest/>`_ and `PHPUnit <https://phpunit.de/>`_. UI Patterns is tested using both `Behat <http://behat.org/en/latest/>`_ and `PHPUnit <https://phpunit.de/>`_.
In order to work with tests you need a fully functional Drupal site. To build the test site perform the following steps: In order to work with tests you need a fully functional Drupal site. To build the test site just run:
- Copy the following files in the directory you wish the test site to be available in:
.. code-block:: bash .. code-block:: bash
./tests/behat.yml.dist $ composer install
./tests/composer.json
./tests/phpunit.xml.dist
- Run ``composer install`` in the test site directory and install the site.
- Change ``./tests/behat.yml.dist`` and ``./tests/phpunit.xml.dist`` environment-specific parameters.
- Install the site.
After installing the site you need to clone the UI Patterns module into the site's modules directory and enable the Thanks to the integration with `Drupal Component Scaffold <https://github.com/nuvoleweb/drupal-component-scaffold>`_
``ui_patterns_test`` module: this module will import all necessary configuration, enable the test theme and expose all you'll find a fully functional Drupal 8 site under ``./build``.
test patterns.
In short the steps above can be summarized as follows: After that proceed with the site installation and setup:
.. code-block:: bash .. code-block:: bash
$ git clone https://github.com/nuvoleweb/ui_patterns.git # Or your own fork. - ./vendor/bin/drush --root=$PWD/build si standard -y --db-url=mysql://YOUR_USER:YOUR_PASS@127.0.0.1/YOUR_DATABASE
$ mkdir test-site - ./vendor/bin/drush --root=$PWD/build en ui_patterns_test -y
$ cp ui_patterns/tests/composer.json test-site
$ cp ui_patterns/tests/phpunit.xml.dist test-site
$ cp ui_patterns/tests/behat.yml.dist test-site
$ cd test-site
$ composer install
$ ./vendor/bin/drush si standard -y --db-url=mysql://USER:PASS@HOST/DATABASE
$ git clone https://github.com/nuvoleweb/ui_patterns.git modules/ui_patterns # Or your own fork.
$ ./vendor/bin/drush en ui_patterns_test -y
The test site will then be available in ``./test-site``.
PHPUnit PHPUnit
------- -------
To execute PHPUnit tests run the following command in the module's root: Setup and run PHPUnit tests by running:
.. code-block:: bash .. code-block:: bash
$ vi phpunit.xml.dist # Change environment-specific parameters. $ cp phpunit.xml.dist phpunit.xml # Then change environment-specific parameters.
$ ./vendor/bin/phpunit $ ./vendor/bin/phpunit
Behat Behat
----- -----
To run Behat tests perform the following steps: Setup and run Behat tests by running:
.. code-block:: bash .. code-block:: bash
$ vi behat.yml.dist # Change environment-specific parameters. $ vi behat.yml.dist behat.yml # Then change environment-specific parameters.
$ ./vendor/bin/behat $ ./vendor/bin/behat
Working with the test site Working with the test site
-------------------------- --------------------------
When working locally with the target site it might be handy to disable the Twig cache as follows: `Drupal Component Scaffold <https://github.com/nuvoleweb/drupal-component-scaffold>`_ will setup a working development site but
you'll still need to manually disable Twig and other Drupal 8 caching by un-commenting the following lines in your
``settings.php`` file:
1. Copy ``./sites/example.settings.local.php`` into ``./sites/default/settings.local.php`` .. code-block:: php
2. Un-comment lines including ``settings.local.php`` in ``./sites/default/settings.php``
3. Disable Twig cache by adding the following lines to ``./sites/development.services.yml`` and clear the cache.
.. code-block:: yaml # if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
# include $app_root . '/' . $site_path . '/settings.local.php';
# }
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment