Skip to content

Commit

Permalink
Merge pull request drush-ops#2146 from drush-ops/fix-6
Browse files Browse the repository at this point in the history
Fix tests for Drupal 6
  • Loading branch information
greg-1-anderson committed Apr 22, 2016
2 parents c504228 + 30a4108 commit be9785b
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 58 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ branches:
language: php
php:
# See master-fulltest branch for broader PHP version testing.
- 5.5
- 5.4
- 7.0

# http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/
Expand Down Expand Up @@ -58,6 +58,7 @@ env:

matrix:
exclude:
# Drupal 6 does not work with php 7, so skip all of the Drupal 6 tests with this php.
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=base
- php: 7.0
Expand All @@ -66,7 +67,19 @@ matrix:
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--group=pm
- php: 7.0
env: UNISH_DRUPAL_MAJOR_VERSION=6 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal

# Drupal 8 requires a minimum php of 5.5, so skip all of the Drupal 8 tests with this php.
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=make
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=base
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=commands
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=pm
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--group=quick-drupal
- php: 5.4
env: UNISH_DRUPAL_MAJOR_VERSION=8 PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal TEST_CHILDREN="drush-ops/config-extra"

before_install:
- echo 'mbstring.http_input = pass' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
"php": ">=5.4.5",
"psr/log": "~1.0",
"psy/psysh": "~0.6",
"symfony/yaml": "~2.3|~3.0",
"symfony/var-dumper": "~2.7|~3.0",
"symfony/yaml": "~2.3",
"symfony/var-dumper": "~2.7",
"symfony/console": "~2.7",
"pear/console_table": "~1.3.0"
},
"require-dev": {
Expand Down
106 changes: 53 additions & 53 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Drush/UpdateService/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function getInfo() {
*
* @return array|bool
*/
private static function getBestRelease(array $releases) {
public static function getBestRelease(array $releases) {
if (empty($releases)) {
return FALSE;
}
Expand Down
13 changes: 13 additions & 0 deletions lib/Drush/UpdateService/ReleaseInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,19 @@ public function selectReleaseBasedOnStrategy($request, $restrict_to = '', $selec
}
$releases = $project_release_info->filterReleases($filter, $version);

// Special checking: Drupal 6 is EOL, so there are no stable
// releases for ANY contrib project. In this case, we'll default
// to the best release, unless the user specified --select.
$version_major = drush_drupal_major_version();
if (($select != 'always') && ($version_major < 7)) {
$bestRelease = Project::getBestRelease($releases);
if (!empty($bestRelease)) {
$message = dt('Drupal !major has reached EOL, so there are no stable releases for any contrib projects. Selected the best release, !project.', array('!major' => $version_major, '!project' => $bestRelease['name']));
drush_log($message, LogLevel::WARNING);
return $bestRelease;
}
}

$options = array();
foreach($releases as $release) {
$options[$release['version']] = array($release['version'], '-', gmdate('Y-M-d', $release['date']), '-', implode(', ', $release['release_status']));
Expand Down
Loading

0 comments on commit be9785b

Please sign in to comment.