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/testing_example/templates/description.html.twig
  11. 4.0.x modules/tour_example/templates/description.html.twig
  12. 4.0.x modules/config_entity_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.

#}

{% trans %}
<h2>PHPUnit for Drupal: A very basic how-to.</h2>

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

<h3>How To:</h3>
<ul>
<li><p>PHPUnit tests belong in their own directory, so they will not be loaded
  by the autoloader during normal bootstrap. This means you should have a
  <code>/tests/src</code> directory in the root of your module directory.</p>
</li>

<li><p>Your tests should be in the <code>Drupal\Tests\[your_module]\Unit</code>
  namespace. Under Drupal&#39;s PSR-4 system, this means your PHPUnit-based
  tests should go in a <code>[your_module]/tests/src/Unit</code>
  directory.</p>
</li>
<li><p>Your test case should subclass <code>Drupal\Tests\UnitTestCase</code>.
   </p>
</li>
<li>
  <p>You can run PHPUnit-based tests from within Drupal 8 by enabling the
  Testing module and then selecting the PHPUnit group from the testing page.
  As of this writing, this method does not provide any useful output.
  </p>
</li>
</ul>

<h3>Standard PHPUnit Practices</h3>
<p>You can (and really, should) run PHPUnit from the command line.</p>
<p>On Unix-based systems, this means you need to <code>cd core</code> and then
  <pre><code>./vendor/bin/phpunit</code></pre>
</p>
<p>On Windows-based systems, assuming you have php in your path,
  <pre><code>php ./vendor/phpunit/phpunit/composer/bin/phpunit --group phpunit_example</code></pre>
</p>
<p>Also, you should mark your tests as belonging to a group, so they can be run
   independently. You do this by annotating your test classes with
   <code>@group group_name</code>. You should have a <code>@group</code> for
   your module name, and you should also have a <code>@group</code> for
   integrations, such as <code>views</code>.
</p>
<p>So, for instance, to run all the PHPUnit example tests, you would type
  <pre><code>./vendor/bin/phpunit --group phpunit_example</code></pre>
</p>
<p>As you can see, including a <code>@group</code> annotation is a good idea.</p>

{% endtrans %}

File

modules/phpunit_example/templates/description.html.twig

View source
  1. {#
  2. Description text for the PHPUnit Example.
  3. #}
  4. {% trans %}
  5. <h2>PHPUnit for Drupal: A very basic how-to.</h2>
  6. <h3>How to use this example module</h3>
  7. <p>You really should be reading the various documentation comments in the test files.</p>
  8. <h3>How To:</h3>
  9. <ul>
  10. <li><p>PHPUnit tests belong in their own directory, so they will not be loaded
  11. by the autoloader during normal bootstrap. This means you should have a
  12. <code>/tests/src</code> directory in the root of your module directory.</p>
  13. </li>
  14. <li><p>Your tests should be in the <code>Drupal\Tests\[your_module]\Unit</code>
  15. namespace. Under Drupal&#39;s PSR-4 system, this means your PHPUnit-based
  16. tests should go in a <code>[your_module]/tests/src/Unit</code>
  17. directory.</p>
  18. </li>
  19. <li><p>Your test case should subclass <code>Drupal\Tests\UnitTestCase</code>.
  20. </p>
  21. </li>
  22. <li>
  23. <p>You can run PHPUnit-based tests from within Drupal 8 by enabling the
  24. Testing module and then selecting the PHPUnit group from the testing page.
  25. As of this writing, this method does not provide any useful output.
  26. </p>
  27. </li>
  28. </ul>
  29. <h3>Standard PHPUnit Practices</h3>
  30. <p>You can (and really, should) run PHPUnit from the command line.</p>
  31. <p>On Unix-based systems, this means you need to <code>cd core</code> and then
  32. <pre><code>./vendor/bin/phpunit</code></pre>
  33. </p>
  34. <p>On Windows-based systems, assuming you have php in your path,
  35. <pre><code>php ./vendor/phpunit/phpunit/composer/bin/phpunit --group phpunit_example</code></pre>
  36. </p>
  37. <p>Also, you should mark your tests as belonging to a group, so they can be run
  38. independently. You do this by annotating your test classes with
  39. <code>@group group_name</code>. You should have a <code>@group</code> for
  40. your module name, and you should also have a <code>@group</code> for
  41. integrations, such as <code>views</code>.
  42. </p>
  43. <p>So, for instance, to run all the PHPUnit example tests, you would type
  44. <pre><code>./vendor/bin/phpunit --group phpunit_example</code></pre>
  45. </p>
  46. <p>As you can see, including a <code>@group</code> annotation is a good idea.</p>
  47. {% endtrans %}