description.html.twig

Same filename in this branch
  1. 4.0.x modules/menu_example/templates/description.html.twig
  2. 4.0.x modules/form_api_example/templates/description.html.twig
  3. 4.0.x modules/js_example/templates/description.html.twig
  4. 4.0.x modules/page_example/templates/description.html.twig
  5. 4.0.x modules/node_type_example/templates/description.html.twig
  6. 4.0.x modules/pager_example/templates/description.html.twig
  7. 4.0.x modules/block_example/templates/description.html.twig
  8. 4.0.x modules/tabledrag_example/templates/description.html.twig
  9. 4.0.x modules/rest_example/templates/description.html.twig
  10. 4.0.x modules/tour_example/templates/description.html.twig
  11. 4.0.x modules/config_entity_example/templates/description.html.twig
  12. 4.0.x modules/phpunit_example/templates/description.html.twig
  13. 4.0.x modules/render_example/templates/description.html.twig
  14. 4.0.x modules/field_permission_example/templates/description.html.twig
  15. 4.0.x modules/stream_wrapper_example/templates/description.html.twig
  16. 4.0.x modules/ajax_example/templates/description.html.twig
  17. 4.0.x modules/hooks_example/templates/description.html.twig
  18. 4.0.x modules/field_example/templates/description.html.twig
  19. 4.0.x tests/modules/examples_description_test/templates/description.html.twig
  20. 4.0.x modules/config_simple_example/templates/description.html.twig
Same filename in other branches
  1. 3.x modules/menu_example/templates/description.html.twig
  2. 3.x modules/form_api_example/templates/description.html.twig
  3. 3.x modules/js_example/templates/description.html.twig
  4. 3.x modules/page_example/templates/description.html.twig
  5. 3.x modules/node_type_example/templates/description.html.twig
  6. 3.x modules/pager_example/templates/description.html.twig
  7. 3.x modules/block_example/templates/description.html.twig
  8. 3.x modules/tabledrag_example/templates/description.html.twig
  9. 3.x modules/rest_example/templates/description.html.twig
  10. 3.x modules/testing_example/templates/description.html.twig
  11. 3.x modules/tour_example/templates/description.html.twig
  12. 3.x modules/config_entity_example/templates/description.html.twig
  13. 3.x modules/phpunit_example/templates/description.html.twig
  14. 3.x modules/render_example/templates/description.html.twig
  15. 3.x modules/field_permission_example/templates/description.html.twig
  16. 3.x modules/stream_wrapper_example/templates/description.html.twig
  17. 3.x modules/ajax_example/templates/description.html.twig
  18. 3.x modules/hooks_example/templates/description.html.twig
  19. 3.x modules/field_example/templates/description.html.twig
  20. 3.x tests/modules/examples_description_test/templates/description.html.twig
  21. 8.x-1.x menu_example/templates/description.html.twig
  22. 8.x-1.x form_api_example/templates/description.html.twig
  23. 8.x-1.x js_example/templates/description.html.twig
  24. 8.x-1.x page_example/templates/description.html.twig
  25. 8.x-1.x node_type_example/templates/description.html.twig
  26. 8.x-1.x pager_example/templates/description.html.twig
  27. 8.x-1.x block_example/templates/description.html.twig
  28. 8.x-1.x tabledrag_example/templates/description.html.twig
  29. 8.x-1.x testing_example/templates/description.html.twig
  30. 8.x-1.x tour_example/templates/description.html.twig
  31. 8.x-1.x config_entity_example/templates/description.html.twig
  32. 8.x-1.x tests/modules/examples_description_test/templates/description.html.twig
  33. 8.x-1.x phpunit_example/templates/description.html.twig
  34. 8.x-1.x render_example/templates/description.html.twig
  35. 8.x-1.x field_permission_example/templates/description.html.twig
  36. 8.x-1.x stream_wrapper_example/templates/description.html.twig
  37. 8.x-1.x ajax_example/templates/description.html.twig
  38. 8.x-1.x hooks_example/templates/description.html.twig
  39. 8.x-1.x field_example/templates/description.html.twig
{#

Description text for the PHPUnit Example.

#}

{% set sum_in_hands = path('testing_example.sum_in_hands') %}

{% trans %}
<h2>Testing Frameworks in Drupal</h2>

<p>This module <a href={{ sum_in_hands }}>provides a path</a> so we can test it.
    The path takes two numeric arguments, and tells you how many hands are
    required to count the sum of both numbers.</p>

<h3>How to use this example module</h3>
<p>You really should be reading the various documentation comments in the files under
  <code>tests/src/</code>.</p>

<h3>How To:</h3>
<ul>
  <li>PHPUnit-based Drupal tests go in the <code>tests/src</code> directory, so
    they will not be loaded by the autoloader during normal bootstrap.
  </li>

  <li>Unit tests go in <code>[your_module]/tests/src/Unit</code>.</li>
  <li>Kernel tests go in <code>[your_module]/tests/src/Kernel</code>.</li>
  <li>Functional tests go in <code>[your_module]/tests/src/Functional</code>.</li>
</ul>

<table>
  <thead>
  <tr>
    <td><b>Type</b></td>
    <td><b>Location</b></td>
    <td><b>Namespace</b></td>
    <td><b>Subclass of</b></td>
  </tr>
  </thead>
  <tbody>
  <tr>
    <td>Unit test</td>
    <td>[your_module]/tests/src/Unit</td>
    <td>Drupal\Tests\[your_module]\Unit\</td>
    <td>Drupal\Tests\UnitTestCase</td>
  </tr>
  <tr>
    <td>Kernel test</td>
    <td>[your_module]/tests/src/Kernel</td>
    <td>Drupal\Tests\[your_module]\Kernel\</td>
    <td>Drupal\KernelTests\KernelTestBase</td>
  </tr>
  <tr>
    <td>Functional test</td>
    <td>[your_module]/tests/src/Functional</td>
    <td>Drupal\Tests\[your_module]\Functional\</td>
    <td>Drupal\Tests\BrowserTestBase</td>
  </tr>
  <tr>
    <td>FunctionalJavascript test</td>
    <td>[your_module]/tests/src/FunctionalJavascript</td>
    <td>Drupal\Tests\[your_module]\FunctionalJavascript\</td>
    <td>Drupal\FunctionalJavascriptTests\WebDriverTestBase</td>
  </tr>
  <tr>
    <td>Shared test traits</td>
    <td>[your_module]/tests/src/Traits</td>
    <td>Drupal\Tests\[your_module]\Traits\</td>
    <td>n/a</td>
  </tr>

  </tbody>
</table>

<h3>Standard PHPUnit Practices</h3>
<p>You can run PHPUnit from the command line or via the run-tests.sh command.</p>
<p>You can specify which type of test you're running via
  <pre><code>phpunit --testsuite</code></pre> and
  <pre><code>run-tests.sh --types</code><pre>.
<p>There are many options to phpunit, but, for instance, to run all of the
  testing_example phpunit tests, you could
<pre><code>./vendor/phpunit/phpunit/phpunit -c core/ ./modules/examples/testing_example</code></pre>
</p>

{% endtrans %}

File

modules/testing_example/templates/description.html.twig

View source
  1. {#
  2. Description text for the PHPUnit Example.
  3. #}
  4. {% set sum_in_hands = path('testing_example.sum_in_hands') %}
  5. {% trans %}
  6. <h2>Testing Frameworks in Drupal</h2>
  7. <p>This module <a href={{ sum_in_hands }}>provides a path</a> so we can test it.
  8. The path takes two numeric arguments, and tells you how many hands are
  9. required to count the sum of both numbers.</p>
  10. <h3>How to use this example module</h3>
  11. <p>You really should be reading the various documentation comments in the files under
  12. <code>tests/src/</code>.</p>
  13. <h3>How To:</h3>
  14. <ul>
  15. <li>PHPUnit-based Drupal tests go in the <code>tests/src</code> directory, so
  16. they will not be loaded by the autoloader during normal bootstrap.
  17. </li>
  18. <li>Unit tests go in <code>[your_module]/tests/src/Unit</code>.</li>
  19. <li>Kernel tests go in <code>[your_module]/tests/src/Kernel</code>.</li>
  20. <li>Functional tests go in <code>[your_module]/tests/src/Functional</code>.</li>
  21. </ul>
  22. <table>
  23. <thead>
  24. <tr>
  25. <td><b>Type</b></td>
  26. <td><b>Location</b></td>
  27. <td><b>Namespace</b></td>
  28. <td><b>Subclass of</b></td>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. <tr>
  33. <td>Unit test</td>
  34. <td>[your_module]/tests/src/Unit</td>
  35. <td>Drupal\Tests\[your_module]\Unit\</td>
  36. <td>Drupal\Tests\UnitTestCase</td>
  37. </tr>
  38. <tr>
  39. <td>Kernel test</td>
  40. <td>[your_module]/tests/src/Kernel</td>
  41. <td>Drupal\Tests\[your_module]\Kernel\</td>
  42. <td>Drupal\KernelTests\KernelTestBase</td>
  43. </tr>
  44. <tr>
  45. <td>Functional test</td>
  46. <td>[your_module]/tests/src/Functional</td>
  47. <td>Drupal\Tests\[your_module]\Functional\</td>
  48. <td>Drupal\Tests\BrowserTestBase</td>
  49. </tr>
  50. <tr>
  51. <td>FunctionalJavascript test</td>
  52. <td>[your_module]/tests/src/FunctionalJavascript</td>
  53. <td>Drupal\Tests\[your_module]\FunctionalJavascript\</td>
  54. <td>Drupal\FunctionalJavascriptTests\WebDriverTestBase</td>
  55. </tr>
  56. <tr>
  57. <td>Shared test traits</td>
  58. <td>[your_module]/tests/src/Traits</td>
  59. <td>Drupal\Tests\[your_module]\Traits\</td>
  60. <td>n/a</td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. <h3>Standard PHPUnit Practices</h3>
  65. <p>You can run PHPUnit from the command line or via the run-tests.sh command.</p>
  66. <p>You can specify which type of test you're running via
  67. <pre><code>phpunit --testsuite</code></pre> and
  68. <pre><code>run-tests.sh --types</code><pre>.
  69. <p>There are many options to phpunit, but, for instance, to run all of the
  70. testing_example phpunit tests, you could
  71. <pre><code>./vendor/phpunit/phpunit/phpunit -c core/ ./modules/examples/testing_example</code></pre>
  72. </p>
  73. {% endtrans %}