Skip to content

Commit

Permalink
Add test for the behavior when using composer install with an existin…
Browse files Browse the repository at this point in the history
…g composer.lock.
  • Loading branch information
FlorentTorregrosa committed Mar 20, 2020
1 parent 6af57e7 commit db78bbb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function tearDown() {
public function testComposerInstallAndUpdate() {
$version = '8.3.0';
$translations_directory = $this->tmpDir . DIRECTORY_SEPARATOR . 'translations' . DIRECTORY_SEPARATOR . 'contrib';
$core_directory = $this->tmpDir . DIRECTORY_SEPARATOR . 'core';
$fr_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.fr.po';
$es_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.es.po';

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

// We remove a downloaded file and a package, so we can check the file was
// downloaded after the command install has been executed.
$this->fs->remove($fr_translation_file);
$this->fs->removeDirectory($core_directory);
$this->composer('install');
$this->assertFileExists($fr_translation_file, 'French translations file should exist.');

// Test downloading a new version of the translations.
$version = '8.3.1';
$fr_translation_file = $translations_directory . DIRECTORY_SEPARATOR . 'drupal-' . $version . '.fr.po';
Expand Down

0 comments on commit db78bbb

Please sign in to comment.