Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ui_patterns
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
ui_patterns
Commits
8dba598f
Commit
8dba598f
authored
7 years ago
by
Antonio De Marco
Browse files
Options
Downloads
Patches
Plain Diff
Fix documentation.
parent
10556d5f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/content/tests.rst
+18
-41
18 additions, 41 deletions
docs/content/tests.rst
with
18 additions
and
41 deletions
docs/content/tests.rst
+
18
−
41
View file @
8dba598f
...
@@ -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
# C
hange environment-specific parameters.
$
cp
phpunit.xml.dist
phpunit.xml # Then c
hange 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
# C
hange environment-specific parameters.
$ vi behat.yml.dist
behat.yml # Then c
hange 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment