Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / doc / usage.rst
1 Usage
2 =====
3
4 Drupal API driver
5 -----------------
6
7 .. literalinclude:: _static/snippets/usage-drupal.php
8    :language: php
9    :linenos:
10    :emphasize-lines: 14-15
11
12 Drush driver
13 ------------
14
15 .. literalinclude:: _static/snippets/usage-drush.php
16    :language: php
17    :linenos:
18    :emphasize-lines: 7-8
19
20 Blackbox
21 --------
22
23 Note, the blackbox driver has no ability to control Drupal, and is provided as a fallback for when some tests can run without such access.
24
25 Any testing application should catch unsupported driver exceptions.
26
27 .. literalinclude:: _static/snippets/usage-blackbox.php
28    :language: php
29    :linenos:
30    :emphasize-lines: 8,19
31
32 Practical example with PHPUnit
33 ------------------------------
34
35 By using the phpunit/mink project in conjunction with the Drupal Driver, one can use PHPUnit to drive browser sessions and control Drupal.
36
37 To install:
38
39 .. literalinclude:: _static/snippets/phpunit-composer.json
40    :language: json
41    :linenos:
42
43 and then, in the tests directory, a sample test:
44
45 .. literalinclude:: _static/snippets/phpunitDrupalDriver.php
46    :language: php
47    :linenos: