Skip to content

Commit db78bbb

Browse files
Add test for the behavior when using composer install with an existing composer.lock.
1 parent 6af57e7 commit db78bbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/PluginTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function tearDown() {
6868
public function testComposerInstallAndUpdate() {
6969
$version = '8.3.0';
7070
$translations_directory = $this->tmpDir . DIRECTORY_SEPARATOR . 'translations' . DIRECTORY_SEPARATOR . 'contrib';
71+
$core_directory = $this->tmpDir . DIRECTORY_SEPARATOR . 'core';
7172
$fr_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.fr.po';
7273
$es_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.es.po';
7374

@@ -84,6 +85,13 @@ public function testComposerInstallAndUpdate() {
8485
$this->composer('drupal:l10n');
8586
$this->assertFileExists($fr_translation_file, 'French translations file was downloaded by custom command.');
8687

88+
// We remove a downloaded file and a package, so we can check the file was
89+
// downloaded after the command install has been executed.
90+
$this->fs->remove($fr_translation_file);
91+
$this->fs->removeDirectory($core_directory);
92+
$this->composer('install');
93+
$this->assertFileExists($fr_translation_file, 'French translations file should exist.');
94+
8795
// Test downloading a new version of the translations.
8896
$version = '8.3.1';
8997
$fr_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.fr.po';

0 commit comments

Comments
 (0)