From b3ff107ebfd3910fbd2e060d1a566e660af20204 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 29 Oct 2020 10:20:54 +0100 Subject: [PATCH] Also look for beta extensions in release URLs --- PhpManager/private/Get-PeclArchiveUrl.ps1 | 2 +- test/tests/Install-Enable-Extensions.Tests.ps1 | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PhpManager/private/Get-PeclArchiveUrl.ps1 b/PhpManager/private/Get-PeclArchiveUrl.ps1 index 748f821..b994f61 100644 --- a/PhpManager/private/Get-PeclArchiveUrl.ps1 +++ b/PhpManager/private/Get-PeclArchiveUrl.ps1 @@ -60,7 +60,7 @@ $rxMatch += '-' + [regex]::Escape($PhpVersion.Architecture) $rxMatch += '\.zip$' $urls = @() - if ($MaximumStability -eq $Script:PEARSTATE_STABLE) { + if ($MaximumStability -eq $Script:PEARSTATE_STABLE -or $MaximumStability -eq $Script:PEARSTATE_BETA) { $urls += "https://windows.php.net/downloads/pecl/releases/$handleLC/$PackageVersion" } if ($MinimumStability -ne $Script:PEARSTATE_STABLE) { diff --git a/test/tests/Install-Enable-Extensions.Tests.ps1 b/test/tests/Install-Enable-Extensions.Tests.ps1 index fb26b5b..50f8fc3 100644 --- a/test/tests/Install-Enable-Extensions.Tests.ps1 +++ b/test/tests/Install-Enable-Extensions.Tests.ps1 @@ -58,6 +58,17 @@ $imagick.Type | Should -BeExactly 'Php' $imagick.State | Should -BeExactly 'Disabled' } + It -Name 'should download and install msgpack-beta on PHP ' -TestCases $testCases { + param ($path, $version) + if ($version -ne '7.2') { + Set-ItResult -Skipped -Because "Not supported on PHP $version" + } + $msgpack = Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'msgpack' } + $msgpack | Should -HaveCount 0 + Install-PhpExtension -Extension msgpack -Path $path -MinimumStability beta -MaximumStability beta + $msgpack = Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'msgpack' } + $msgpack | Should -HaveCount 1 + } It -Name 'should download and install yaml on PHP ' -TestCases $testCases { param ($path, $version) Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'yaml' } | Should -HaveCount 0