File tree Expand file tree Collapse file tree
tests/Humbug/Test/SelfUpdate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,9 +116,10 @@ public function getCurrentRemoteVersion(Updater $updater)
116116 * Setup remote URL if there's an actual version to download.
117117 */
118118 if (! empty ($ this ->remoteVersion )) {
119- $ chosenVersion = array_filter ($ package ['packages ' ][$ this ->getPackageName ()], function (array $ package ) {
119+ $ remoteVersionPackages = array_filter ($ package ['packages ' ][$ this ->getPackageName ()], function (array $ package ) {
120120 return $ package ['version ' ] === $ this ->remoteVersion ;
121- })[0 ];
121+ });
122+ $ chosenVersion = reset ($ remoteVersionPackages );
122123
123124 $ this ->remoteUrl = $ this ->getDownloadUrl ($ chosenVersion );
124125 }
Original file line number Diff line number Diff line change @@ -140,6 +140,9 @@ private function createTestPharAndKey(): void
140140 file_put_contents ($ this ->tmp .'/packages.json ' , json_encode ([
141141 'packages ' => [
142142 'humbug/test-phar ' => [
143+ [
144+ 'version ' => '2.0.0-beta.1 ' ,
145+ ],
143146 [
144147 'version ' => '1.0.1 ' ,
145148 'source ' => [
You can’t perform that action at this time.
0 commit comments