class EnDisUnListCase

  1. 6.x tests/pmEnDisUnListTest.php EnDisUnListCase
  2. 4.x tests/pmEnDisUnListTest.php EnDisUnListCase
  3. 5.x tests/pmEnDisUnListTest.php EnDisUnListCase

Hierarchy

Expanded class hierarchy of EnDisUnListCase

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
Drush_TestCase::create_node_types_php function
Drush_TestCase::drush function Invoke drush in via execute().
Drush_TestCase::drush_major_version function
Drush_TestCase::escapeshellarg public static function
Drush_TestCase::execute function Actually runs the command. Does not trap the error stream output as this need PHP 4.3+.
Drush_TestCase::EXIT_ERROR constant
Drush_TestCase::EXIT_SUCCESS constant
Drush_TestCase::file_aliases function
Drush_TestCase::file_delete_recursive function Same code as drush_delete_dir().
Drush_TestCase::getOutput function Accessor for the last output.
Drush_TestCase::getOutputAsList function Accessor for the last output.
Drush_TestCase::is_windows public static function
Drush_TestCase::setUpBeforeClass public static function Assure that each class starts with an empty sandbox directory and a clean environment - http://drupal.org/node/1103568.
Drush_TestCase::setUpDrupal function
Drush_TestCase::tearDownAfterClass public static function Runs after each test case. Remove sandbox directory.
Drush_TestCase::_escapeshellarg_windows public static function
Drush_TestCase::__construct function
EnDisUnListCase::testEnDisUnList public function

File

tests/pmEnDisUnListTest.php, line 8

View source
class EnDisUnListCase extends Drush_TestCase {

  public function testEnDisUnList() {
    $this->setUpDrupal('dev', TRUE);
    $options = array(
      'yes' => NULL,
      'pipe' => NULL,
      'root' => $this->sites['dev']['root'],
      'uri' => 'dev',
    );
    $this->drush('pm-download', array('devel-7.x-1.0'), $options);
    $this->drush('pm-list', array(), $options + array('no-core' => NULL, 'status' => 'not installed'));
    $list = $this->getOutputAsList();
    $this->assertTrue(in_array('devel', $list));

    $this->drush('pm-enable', array('menu', 'devel'), $options);
    $this->drush('pm-list', array(), $options + array('status' => 'enabled'));
    $list = $this->getOutputAsList();
    $this->assertTrue(in_array('devel', $list));
    $this->assertTrue(in_array('bartik', $list), 'Themes are in the pm-list');

    $this->drush('pm-list', array(), $options + array('package' => 'Core'));
    $list = $this->getOutputAsList();
    $this->assertFalse(in_array('devel', $list), 'Devel is not part of core package');

    // For testing uninstall later.
    $this->drush('variable-set', array('devel_query_display', 1), $options);

    $this->drush('pm-disable', array('devel'), $options);
    $this->drush('pm-list', array(), $options + array('status' => 'disabled'));
    $list = $this->getOutputAsList();
    $this->assertTrue(in_array('devel', $list));

    $this->drush('pm-uninstall', array('devel'), $options);
    $this->drush('pm-list', array(), $options + array('status' => 'not installed', 'type' => 'module'));
    $list = $this->getOutputAsList();
    $this->assertTrue(in_array('devel', $list));


    // We expect an exit code of 1 so just call execute() directly.
    $exec = sprintf('%s variable-get %s --pipe --root=%s --uri=%s', UNISH_DRUSH, 'devel_query_display', $options['root'], $options['uri']);
    $this->execute($exec, self::EXIT_ERROR);
    $output = $this->getOutput();
    $this->assertEmpty($output, 'Devel variable was uninstalled.');
  }
}