@@ -67,14 +67,14 @@ public function tearDown() : void {
6767 * Tests a simple composer install and update.
6868 */
6969 public function testComposerInstallAndUpdate () {
70- $ version = '8.9 .0 ' ;
70+ $ version = '9.5 .0 ' ;
7171 $ translations_directory = $ this ->tmpDir . DIRECTORY_SEPARATOR . 'translations ' . DIRECTORY_SEPARATOR . 'contrib ' ;
7272 $ core_directory = $ this ->tmpDir . DIRECTORY_SEPARATOR . 'core ' ;
7373 $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.fr.po ' ;
7474 $ es_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.es.po ' ;
7575
76- $ this ->assertFileNotExists ($ fr_translation_file , 'French translations file should not exist. ' );
77- $ this ->assertFileNotExists ($ es_translation_file , 'Spanish translations file should not exist. ' );
76+ $ this ->assertFileDoesNotExist ($ fr_translation_file , 'French translations file should not exist. ' );
77+ $ this ->assertFileDoesNotExist ($ es_translation_file , 'Spanish translations file should not exist. ' );
7878 $ this ->composer ('install ' );
7979 $ this ->assertFileExists ($ this ->tmpDir . DIRECTORY_SEPARATOR . 'core ' , 'Drupal core is installed. ' );
8080 $ this ->assertFileExists ($ fr_translation_file , 'French translations file should exist. ' );
@@ -94,24 +94,24 @@ public function testComposerInstallAndUpdate() {
9494 $ this ->assertFileExists ($ fr_translation_file , 'French translations file should exist. ' );
9595
9696 // Test downloading a new version of the translations.
97- $ version = '8.9.7 ' ;
97+ $ version = '9.5.3 ' ;
9898 $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.fr.po ' ;
9999 $ es_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.es.po ' ;
100- $ this ->assertFileNotExists ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
101- $ this ->assertFileNotExists ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
100+ $ this ->assertFileDoesNotExist ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
101+ $ this ->assertFileDoesNotExist ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
102102 $ this ->composer ('require --update-with-dependencies drupal/core:" ' . $ version . '" ' );
103103 $ this ->assertFileExists ($ fr_translation_file , "French translations file for version: $ version should exist. " );
104104 $ this ->assertFileExists ($ es_translation_file , "Spanish translations file for version: $ version should exist. " );
105105
106106 // Test that the translations for a dev version are not downloaded.
107- $ version = '8.9 .x-dev ' ;
107+ $ version = '9.5 .x-dev ' ;
108108 $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.fr.po ' ;
109109 $ es_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ version . '.es.po ' ;
110- $ this ->assertFileNotExists ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
111- $ this ->assertFileNotExists ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
110+ $ this ->assertFileDoesNotExist ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
111+ $ this ->assertFileDoesNotExist ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
112112 $ this ->composer ('require --update-with-dependencies drupal/core:" ' . $ version . '" ' );
113- $ this ->assertFileNotExists ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
114- $ this ->assertFileNotExists ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
113+ $ this ->assertFileDoesNotExist ($ fr_translation_file , "French translations file for version: $ version should not exist. " );
114+ $ this ->assertFileDoesNotExist ($ es_translation_file , "Spanish translations file for version: $ version should not exist. " );
115115 }
116116
117117 /**
@@ -120,50 +120,21 @@ public function testComposerInstallAndUpdate() {
120120 * Either if using semver or not.
121121 */
122122 public function testContribmodules () {
123- $ core_version = '8.9.0 ' ;
124- $ contrib_module = 'search404 ' ;
125- $ contrib_composer_version = '1.0.0 ' ;
126- $ contrib_drupal_version = '8.x-1.0 ' ;
127- $ translations_directory = $ this ->tmpDir . DIRECTORY_SEPARATOR . 'translations ' . DIRECTORY_SEPARATOR . 'contrib ' ;
128- $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . $ contrib_module . '- ' . $ contrib_drupal_version . '.fr.po ' ;
129-
130- $ this ->assertFileNotExists ($ fr_translation_file , 'French translations file should not exist. ' );
131- $ this ->composer ('install ' );
132- $ this ->composer ('require --update-with-dependencies drupal/core:" ' . $ core_version . '" ' );
133- $ this ->composer ('require drupal/ ' . $ contrib_module . ':" ' . $ contrib_composer_version . '" ' );
134- $ this ->assertFileExists ($ this ->tmpDir . DIRECTORY_SEPARATOR . 'core ' , 'Drupal core is installed. ' );
135- $ this ->assertFileExists ($ fr_translation_file , 'French translations file should exist. ' );
136-
137- // Test downloading a semantic version of the module.
138- $ contrib_composer_version = '2.0.0 ' ;
139- $ contrib_drupal_version = '2.0.0 ' ;
140- $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . $ contrib_module . '- ' . $ contrib_drupal_version . '.fr.po ' ;
141- $ this ->assertFileNotExists ($ fr_translation_file , "French translations file for version: $ contrib_drupal_version should not exist. " );
142- $ this ->composer ('require drupal/ ' . $ contrib_module . ':" ' . $ contrib_composer_version . '" ' );
143- $ this ->assertFileExists ($ fr_translation_file , "French translations file for version: $ contrib_drupal_version should exist. " );
144- }
145-
146- /**
147- * Tests that on Drupal 9, core and contrib modules are handled.
148- *
149- * Either if using semver or not.
150- */
151- public function testDrupal9 () {
152- $ core_version = '9.1.3 ' ;
123+ $ core_version = '9.5.3 ' ;
153124 $ contrib_module = 'entity_share ' ;
154- $ contrib_composer_version = '3.0.0-beta2 ' ;
155- $ contrib_drupal_version = '8.x-3.0-beta2 ' ;
125+ $ contrib_composer_version = '3.0.0-rc4 ' ;
126+ $ contrib_drupal_version = '8.x-3.0-rc4 ' ;
156127 $ semver_contrib_module = 'entity_share_cron ' ;
157- $ semver_contrib_composer_version = '3.0.0-beta1 ' ;
158- $ semver_contrib_drupal_version = '3.0.0-beta1 ' ;
128+ $ semver_contrib_composer_version = '3.0.1 ' ;
129+ $ semver_contrib_drupal_version = '3.0.1 ' ;
159130 $ translations_directory = $ this ->tmpDir . DIRECTORY_SEPARATOR . 'translations ' . DIRECTORY_SEPARATOR . 'contrib ' ;
160131 $ core_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ core_version . '.fr.po ' ;
161132 $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . $ contrib_module . '- ' . $ contrib_drupal_version . '.fr.po ' ;
162133 $ semver_fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . $ semver_contrib_module . '- ' . $ semver_contrib_drupal_version . '.fr.po ' ;
163134
164- $ this ->assertFileNotExists ($ core_translation_file , 'French translations file should not exist. ' );
165- $ this ->assertFileNotExists ($ fr_translation_file , 'French translations file should not exist. ' );
166- $ this ->assertFileNotExists ($ semver_fr_translation_file , 'French translations file should not exist. ' );
135+ $ this ->assertFileDoesNotExist ($ core_translation_file , 'French translations file should not exist. ' );
136+ $ this ->assertFileDoesNotExist ($ fr_translation_file , 'French translations file should not exist. ' );
137+ $ this ->assertFileDoesNotExist ($ semver_fr_translation_file , 'French translations file should not exist. ' );
167138 $ this ->composer ('install ' );
168139 $ this ->composer ('require --update-with-dependencies drupal/core:" ' . $ core_version . '" ' );
169140 $ this ->composer ('require drupal/ ' . $ contrib_module . ':" ' . $ contrib_composer_version . '" drupal/ ' . $ semver_contrib_module . ':" ' . $ semver_contrib_composer_version . '" ' );
@@ -184,8 +155,8 @@ public function testDrupal7() {
184155 $ core_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . 'drupal- ' . $ core_version . '.fr.po ' ;
185156 $ fr_translation_file = $ translations_directory . DIRECTORY_SEPARATOR . $ contrib_module . '- ' . $ contrib_drupal_version . '.fr.po ' ;
186157
187- $ this ->assertFileNotExists ($ core_translation_file , 'French translations file should not exist. ' );
188- $ this ->assertFileNotExists ($ fr_translation_file , 'French translations file should not exist. ' );
158+ $ this ->assertFileDoesNotExist ($ core_translation_file , 'French translations file should not exist. ' );
159+ $ this ->assertFileDoesNotExist ($ fr_translation_file , 'French translations file should not exist. ' );
189160 $ this ->composer ('install ' );
190161 $ this ->composer ('remove drupal/core ' );
191162 // Set Drupal repository to target Drupal 7.
@@ -236,8 +207,14 @@ protected function composerJsonDefaults() {
236207 ],
237208 'require ' => [
238209 'drupal-composer/drupal-l10n ' => $ this ->tmpReleaseTag ,
239- 'composer/installers ' => '^1.2 ' ,
240- 'drupal/core ' => '8.9.0 ' ,
210+ 'composer/installers ' => '2.* ' ,
211+ 'drupal/core ' => '9.5.0 ' ,
212+ ],
213+ 'config ' => [
214+ 'allow-plugins ' => [
215+ 'composer/installers ' => TRUE ,
216+ 'drupal-composer/drupal-l10n ' => TRUE ,
217+ ],
241218 ],
242219 'extra ' => [
243220 'drupal-l10n ' => [
0 commit comments