8 class pmRequestCase extends CommandUnishTestCase {
11 * Tests for pm_parse_version() on a bootstrapped site.
13 public function testVersionParser() {
14 // Setup a Drupal site. Skip install for speed.
15 $sites = $this->setUpDrupal(1, FALSE);
17 $root = $this->webroot();
19 $drupal_version = UNISH_DRUPAL_MAJOR_VERSION;
21 // Common options for below commands.
28 // Tests for core versions.
32 $expected = <<<EXPECTED
34 drupal_version: ${drupal_version}.x
36 version_major: ${drupal_version}
42 $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options);
43 $this->assertEquals($expected, $this->getOutput(), 'Core version not provided. Pick version of the bootstrapped site.');
46 $expected = <<<EXPECTED
56 $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options);
57 $this->assertEquals($expected, $this->getOutput(), 'Core version provided.');
59 // Tests for non-core versions.
63 $expected = <<<EXPECTED
65 drupal_version: ${drupal_version}.x
67 version_major: ${drupal_version}
73 $this->drush('php-eval', array("return pm_parse_version('${version}', ${is_core})"), $options);
74 $this->assertEquals($expected, $this->getOutput(), 'Project version not provided. Pick version of the bootstrapped site.');
77 $expected = <<<EXPECTED
78 version: ${drupal_version}.x-1.0
79 drupal_version: ${drupal_version}.x
80 project_version: '1.0'
87 $this->drush('php-eval', array("return pm_parse_version('${version}')"), $options);
88 $this->assertEquals($expected, $this->getOutput());
91 $expected = <<<EXPECTED
92 version: ${drupal_version}.x-1.x-dev
93 drupal_version: ${drupal_version}.x
94 project_version: 1.x-dev
101 $this->drush('php-eval', array("return pm_parse_version('${version}')"), $options);
102 $this->assertEquals($expected, $this->getOutput());