develDrushTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * PHPUnit Tests for devel.
  5. *
  6. * This uses Drush's own test framework, based on PHPUnit.
  7. * To run the tests, use
  8. * @code
  9. * phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc.
  10. * @endcode
  11. * Note that we are pointing to the drush_testcase.inc file under /tests subdir
  12. * in drush.
  13. */
  14. /**
  15. * Class for testing Drush integration.
  16. */
  17. class develCase extends Drush_CommandTestCase {
  18. /**
  19. * Tests the printing of a function and its Doxygen comment.
  20. */
  21. public function testFnView() {
  22. $sites = $this->setUpDrupal(1, TRUE);
  23. $options = array(
  24. 'root' => $this->webroot(),
  25. 'uri' => key($sites),
  26. );
  27. $this->drush('pm-download', array('devel'), $options + array('cache' => NULL));
  28. $this->drush('pm-enable', array('devel'), $options + array('skip' => NULL, 'yes' => NULL));
  29. $this->drush('fn-view', array('drush_main'), $options);
  30. $output = $this->getOutput();
  31. $this->assertContains('@return', $output, 'Output contain @return Doxygen.');
  32. $this->assertContains('function drush_main() {', $output, 'Output contains function drush_main() declaration');
  33. }
  34. }