develDrushTest.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Unish;
  3. if (class_exists('Unish\CommandUnishTestCase')) {
  4. /**
  5. * PHPUnit Tests for devel. This uses Drush's own test framework, based on PHPUnit.
  6. * To run the tests, use run-tests-drush.sh from the devel directory.
  7. */
  8. class develCase extends CommandUnishTestCase {
  9. public function testFnCommands() {
  10. // Specify '8' just in case user has not set UNISH_DRUPAL_MAJOR_VERSION env variable.
  11. $sites = $this->setUpDrupal(1, TRUE, '8');
  12. // Symlink this module into the Site Under test so it can be enabled.
  13. $target = dirname(__DIR__);
  14. \symlink($target, $this->webroot() . '/modules/devel');
  15. $options = array(
  16. 'root' => $this->webroot(),
  17. 'uri' => key($sites),
  18. );
  19. $this->drush('pm-enable', array('devel'), $options + array('skip' => NULL, 'yes' => NULL));
  20. $this->drush('fn-view', array('drush_main'), $options);
  21. $output = $this->getOutput();
  22. $this->assertContains('@return', $output, 'Output contain @return Doxygen.');
  23. $this->assertContains('function drush_main() {', $output, 'Output contains function drush_main() declaration');
  24. // $this->drush('fn-hook', array('cron'), $options);
  25. // $output = $this->getOutputAsList();
  26. // $expected = array('dblog', 'file', 'field', 'system', 'update');
  27. // $this->assertSame($expected, $output);
  28. }
  29. }
  30. }