6 * Tests for site-install on a Drupal 6 installation.
10 class siteInstallD6Case extends CommandUnishTestCase {
13 if (UNISH_DRUPAL_MAJOR_VERSION != 6) {
14 $this->markTestSkipped('This test class is designed for Drupal 6.');
20 * Test a D6 install with extra options.
22 public function testExtraConfigurationOptions() {
23 // Set up codebase without installing Drupal.
24 $sites = $this->setUpDrupal(1, FALSE, '6');
25 $root = $this->webroot();
28 // Copy the "example" test profile into the newly created site's profiles directory
29 $profile_dir = "$root/profiles/example";
31 copy(dirname(__FILE__) . '/resources/example.profile', $profile_dir . '/example.profile');
33 $test_string = $this->randomString();
34 // example.profile Has values 0-2 defined as allowed.
35 $test_int = rand(0, 2);
36 $site_name = $this->randomString();
38 $this->drush('site-install', array(
39 // First argument is the profile name
41 // Then the extra profile options
42 "myopt1=$test_string",
46 'db-url' => $this->db_url($site),
48 'sites-subdir' => $site,
50 'site-name' => $site_name,
54 $this->checkVariable('site_name', $site_name, $site);
55 $this->checkVariable('myopt1', $test_string, $site);
56 $this->checkVariable('myopt2', $test_int, $site);
60 * Check the value of a Drupal variable against an expectation using drush.
65 * The expected value of this variable.
67 * The name of an individual multisite installation site.
69 private function checkVariable($name, $value, $site) {
71 'root' => $this->webroot(),
75 $this->drush('variable-get', array($name), $options);
76 $this->assertEquals("$name: $value", $this->getOutput());