File tree Expand file tree Collapse file tree
test/unit/DependencyResolver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,11 +94,11 @@ public static function fromComposerCompletePackage(CompletePackageInterface $com
9494 /** @var string|list<string> $method */
9595 $ method = $ phpExtOptions ['download-url-method ' ];
9696 if (is_array ($ method )) {
97- if (count ($ method ) !== 1 ) {
98- throw new InvalidArgumentException ('This extension requires a newer version of PIE. Multiple download-url-methods are not supported until PIE 1.4.0. ' );
97+ if (count ($ method ) === 1 ) {
98+ $ method = $ method [0 ];
99+ } else {
100+ $ method = DownloadUrlMethod::ComposerDefaultDownload->value ;
99101 }
100-
101- $ method = $ method [0 ];
102102 }
103103
104104 $ package ->downloadUrlMethod = DownloadUrlMethod::tryFrom ($ method );
Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ public function testDownloadUrlMethodWithMultiItemListIsNotYetSupported(): void
173173 $ composerCompletePackage = new CompletePackage ('vendor/foo ' , '1.2.3.0 ' , '1.2.3 ' );
174174 $ composerCompletePackage ->setPhpExt (['download-url-method ' => ['pre-packaged-source ' , 'composer-default ' ]]);
175175
176- $ this -> expectException (InvalidArgumentException::class );
177- $ this -> expectExceptionMessage ( ' This extension requires a newer version of PIE. Multiple download-url-methods are not supported until PIE 1.4.0. ' );
178- Package:: fromComposerCompletePackage ( $ composerCompletePackage );
176+ $ package = Package:: fromComposerCompletePackage ( $ composerCompletePackage );
177+
178+ self :: assertSame (DownloadUrlMethod::ComposerDefaultDownload, $ package -> downloadUrlMethod () );
179179 }
180180}
You can’t perform that action at this time.
0 commit comments