6 * core-quick-drupal tests.
11 class quickDrupalCase extends CommandUnishTestCase {
13 * Path to test make files.
15 protected $makefile_path;
18 * Initialize $makefile_path.
20 function __construct() {
21 $this->makefile_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'makefiles';
25 * Run a given quick-drupal test.
28 * The test makefile to run, as defined by $this->getQuickDrupalTestParameters();
30 private function runQuickDrupalTest($test) {
31 $config = $this->getQuickDrupalTestParameters($test);
32 $default_options = array(
36 $options = array_merge($config['options'], $default_options);
37 if (array_key_exists('makefile', $config)) {
38 $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile'];
39 $options['makefile'] = $makefile;
41 $return = !empty($config['fail']) ? self::EXIT_ERROR : self::EXIT_SUCCESS;
42 $target = UNISH_SANDBOX . '/qd-' . $test;
43 $options['root'] = $target;
44 $this->drush('core-quick-drupal', $config['args'], $options, NULL, NULL, $return);
46 // Use pm-list to determine if all of the correct modules were enabled
47 if (empty($config['fail'])) {
48 $this->drush('pm-list', array(), array('root' => $target, 'status' => 'enabled', 'no-core' => NULL, 'pipe' => NULL));
49 $output = $this->getOutput();
50 $this->assertEquals($config['expected-modules'], $output, 'quick-drupal included the correct set of modules');
54 function testQuickDrupal() {
55 $this->runQuickDrupalTest('devel');
58 function getQuickDrupalTestParameters($key) {
61 'name' => 'Test quick-drupal with a makefile that downloads devel',
62 'makefile' => 'qd-devel.make',
63 'expected-modules' => 'devel',
66 'skip' => NULL, // for speed up enable of devel module.
68 'profile' => UNISH_DRUPAL_MAJOR_VERSION == 6 ? 'standard' : 'testing',