TestSetupInterface.php 618 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Drupal\TestSite;
  3. /**
  4. * Allows setting up an environment as part of a test site install.
  5. *
  6. * @see \Drupal\TestSite\Commands\TestSiteInstallCommand
  7. */
  8. interface TestSetupInterface {
  9. /**
  10. * Run the code to setup the test environment.
  11. *
  12. * You have access to any API provided by any installed module. For example,
  13. * to install modules use:
  14. * @code
  15. * \Drupal::service('module_installer')->install(['my_module'])
  16. * @endcode
  17. *
  18. * Check out TestSiteInstallTestScript for an example.
  19. *
  20. * @see \Drupal\TestSite\TestSiteInstallTestScript
  21. */
  22. public function setup();
  23. }