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
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
{#

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 docblocks in the test files.</p>

<h3>How To:</h3>
<ul>
<li><p>PHPUnit tests belong in their own directory, so they won&#39;t 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 doesn&#39;t 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 of 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 docblocks in the test files.</p>
  8. <h3>How To:</h3>
  9. <ul>
  10. <li><p>PHPUnit tests belong in their own directory, so they won&#39;t 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 doesn&#39;t 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 of 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 %}