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