class releaseInfoCase

  1. 8.0.x tests/releaseInfoTest.php releaseInfoCase
  2. 6.x tests/releaseInfoTest.php releaseInfoCase
  3. 7.x tests/releaseInfoTest.php releaseInfoCase
  4. 5.x tests/releaseInfoTest.php releaseInfoCase
  5. master tests/releaseInfoTest.php releaseInfoCase

pm testing

@group pm




Expanded class hierarchy of releaseInfoCase


Contains filters are case sensitive
Namesort descending Modifiers Type Description
releaseInfoCase::testReleaseXML public function Pick right release from the XML (dev, latest published+recommended, ...).
UnishTestCase::$sites private static property A list of Drupal sites that have been recently installed.
UnishTestCase::bit_bucket function Borrowed from Drush. Checks operating system and returns supported bit bucket folder.
UnishTestCase::convert_path function Converts a Windows path (dir1\dir2\dir3) into a Unix path (dir1/dir2/dir3). Also converts a cygwin "drive emulation" path (/cygdrive/c/dir1) into a proper drive path, still with Unix slashes (c:/dir1).
UnishTestCase::db_driver function
UnishTestCase::db_url function
UnishTestCase::directory_cache function
UnishTestCase::drupalSitewideDirectory function
UnishTestCase::escapeshellarg public static function
UnishTestCase::fetchInstallDrupal function
UnishTestCase::getSites function
UnishTestCase::get_tar_executable public static function
UnishTestCase::is_windows public static function
UnishTestCase::log function Print a log message to the console.
UnishTestCase::log_level function
UnishTestCase::randomString public function Helper function to generate a random string of arbitrary length.
UnishTestCase::setUpDrupal function
UnishTestCase::setUpFreshSandBox public static function Remove any pre-existing sandbox, then create a new one.
UnishTestCase::tick function Print out a tick mark.
UnishTestCase::unish_file_aliases function Prepare the contents of an aliases file.
UnishTestCase::webroot function
UnishTestCase::writeSiteAlias function
UnishTestCase::_escapeshellarg_windows public static function
UnishTestCase::__construct function
UnitUnishTestCase::drush_major_version function
UnitUnishTestCase::setUpBeforeClass public static function Minimally bootstrap drush Overrides UnishTestCase::setUpBeforeClass
UnitUnishTestCase::tearDownAfterClass public static function Runs after all tests in a class are run. Remove sandbox directory. Overrides UnishTestCase::tearDownAfterClass


tests/releaseInfoTest.php, line 15
Tests for release_info engine.

View source
class releaseInfoCase extends UnitUnishTestCase {

   * Pick right release from the XML (dev, latest published+recommended, ...).
  public function testReleaseXML() {
    _drush_add_commandfiles(array(DRUSH_BASE_PATH . '/commands/pm'));
    $release_info = drush_include_engine('release_info', 'updatexml');

    // Use a local, static XML file because live files change over time.
    $xml = simplexml_load_file(dirname(__FILE__) . '/devel.xml');
    $project_release_info = new \Drush\UpdateService\Project($xml);

    // Pick specific release.
    $release = $project_release_info->getSpecificRelease('6.x-1.18');
    $this->assertEquals('6.x-1.18', $release['version']);

    // Pick latest recommended+published with no further specification.
    // 6.x-2.2 is skipped because it is unpublished.
    // 6.x-2.2-rc1 is skipped because it is not a stable release.
    $release = $project_release_info->getRecommendedOrSupportedRelease();
    $this->assertEquals('6.x-2.1', $release['version']);

    // Pick latest from a specific branch.
    $release = $project_release_info->getSpecificRelease('6.x-1');
    $this->assertEquals('6.x-1.23', $release['version']);

    // Pick latest from a different branch.
    // 6.x-2.2 is skipped because it is unpublished.
    // 6.x-2.2-rc1 is skipped because it is not a stable release.
    $release = $project_release_info->getSpecificRelease('6.x-2');
    $this->assertEquals('6.x-2.1', $release['version']);

    // Pick a -dev release.
    $release = $project_release_info->getSpecificRelease('6.x-1.x');
    $this->assertEquals('6.x-1.x-dev', $release['version']);

    // Test UpdateServiceProject::getSpecificRelease().
    // Test we get latest release in branch 1.
    $release = $project_release_info->getSpecificRelease('6.x-1');
    $this->assertEquals('6.x-1.23', $release['version']);

    // Test UpdateServiceProject::getDevRelease().
    $release = $project_release_info->getDevRelease();
    $this->assertEquals('6.x-1.x-dev', $release['version']);