Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / doc / environment.rst
1 Environment specific settings
2 =============================
3
4 Some of the settings in ``behat.yml`` are environment specific. For example the
5 base URL may be ``http://mysite.localhost`` on your local development
6 environment, while on a test server it might be ``http://127.0.0.1:8080``. Some
7 other environment specific settings are the Drupal root path and the paths to
8 search for subcontexts.
9
10 If you intend to run your tests on different environments these settings should
11 not be committed to ``behat.yml``. Instead they should be exported in an
12 environment variable. Before running tests Behat will check the ``BEHAT_PARAMS``
13 environment variable and add these settings to the ones that are present in
14 ``behat.yml``. This variable should contain a JSON object with your settings.
15
16 Example JSON object:
17
18 .. code-block:: json
19
20     {
21         "extensions": {
22             "Behat\\MinkExtension": {
23                 "base_url": "http://myproject.localhost"
24             },
25             "Drupal\\DrupalExtension": {
26                 "drupal": {
27                     "drupal_root": "/var/www/myproject"
28                 }
29             }
30         }
31     }
32
33
34 To export this into the ``BEHAT_PARAMS`` environment variable, squash the JSON
35 object into a single line and surround with single quotes:
36
37 .. code-block: bash
38
39     $ export BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"http://myproject.localhost"},"Drupal\\DrupalExtension":{"drupal":{"drupal_root":"/var/www/myproject"}}}}'
40
41 There is also a `Drush extension <https://github.com/pfrenssen/drush-bde-env>`_
42 that can help you generate these environment variables.