public function pmDownloadCase::testSelect

8.0.x pmDownloadTest.php public pmDownloadCase::testSelect()
6.x pmDownloadTest.php public pmDownloadCase::testSelect()
7.x pmDownloadTest.php public pmDownloadCase::testSelect()
4.x pmDownloadTest.php public pmDownloadCase::testSelect()
5.x pmDownloadTest.php public pmDownloadCase::testSelect()
master pmDownloadTest.php public pmDownloadCase::testSelect()

File

tests/pmDownloadTest.php, line 70

Class

pmDownloadCase
pm-download testing

Code

public function testSelect() {
  $options = array(
    'cache' => NULL,
    'no' => NULL,
    'select' => NULL,
  );
  // --select. Specify 6.x since that has so many releases.
  $this->drush('pm-download', array('devel-6.x'), $options);
  $items = $this->getOutputAsList();
  $output = $this->getOutput();

  // The maximums below are higher then they usually appear since --verbose can add one.
  $this->assertLessThanOrEqual(8, count($items), '--select offerred no more than 3 options.');
  $this->assertContains('dev', $output, 'Dev release was shown by --select.');

  // --select --all. Specify 6.x since that has so many releases.
  $this->drush('pm-download', array('devel-6.x'), $options + array('all' => NULL));
  $items = $this->getOutputAsList();
  $output = $this->getOutput();
  $this->assertGreaterThanOrEqual(20, count($items), '--select --all offerred at least 16 options.');
  $this->assertContains('6.x-1.5', $output, 'Assure that --all lists very old releases.');

  // --select --dev. Specify 6.x since that has so many releases.
  $this->drush('pm-download', array('devel-6.x'), $options + array('dev' => NULL));
  $items = $this->getOutputAsList();
  $output = $this->getOutput();
  $this->assertLessThanOrEqual(6, count($items), '--select --dev expected to offer only one option.');
  $this->assertContains('6.x-1.x-dev', $output, 'Assure that --dev lists the only dev release.');
}