Update to Drupal 8.2.6. For more information, see https://www.drupal.org/project/drupal/releases/8.2.6

This commit is contained in:
Pantheon Automation 2017-02-02 16:28:38 -08:00 committed by Greg Anderson
parent db56c09587
commit f1e72395cb
588 changed files with 26857 additions and 2777 deletions

View file

@ -74,19 +74,18 @@ class ComposerIntegrationTest extends UnitTestCase {
public function testComposerJson() {
foreach ($this->getPaths() as $path) {
$json = file_get_contents($path . '/composer.json');
$result = json_decode($json);
$this->assertNotNull($result, $this->getErrorMessages()[json_last_error()]);
}
}
/**
* Tests composer.lock hash.
* Tests composer.lock content-hash.
*/
public function testComposerLockHash() {
$json = file_get_contents($this->root . '/composer.json');
$content_hash = self::getContentHash(file_get_contents($this->root . '/composer.json'));
$lock = json_decode(file_get_contents($this->root . '/composer.lock'), TRUE);
$this->assertSame(md5($json), $lock['hash']);
$this->assertSame($content_hash, $lock['content-hash']);
}
/**
@ -126,4 +125,50 @@ class ComposerIntegrationTest extends UnitTestCase {
}
}
// @codingStandardsIgnoreStart
/**
* The following method is copied from \Composer\Package\Locker.
*
* @see https://github.com/composer/composer
*/
/**
* Returns the md5 hash of the sorted content of the composer file.
*
* @param string $composerFileContents The contents of the composer file.
*
* @return string
*/
protected static function getContentHash($composerFileContents)
{
$content = json_decode($composerFileContents, true);
$relevantKeys = array(
'name',
'version',
'require',
'require-dev',
'conflict',
'replace',
'provide',
'minimum-stability',
'prefer-stable',
'repositories',
'extra',
);
$relevantContent = array();
foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {
$relevantContent[$key] = $content[$key];
}
if (isset($content['config']['platform'])) {
$relevantContent['config']['platform'] = $content['config']['platform'];
}
ksort($relevantContent);
return md5(json_encode($relevantContent));
}
// @codingStandardsIgnoreEnd
}