Skip to content

Commit 28ff5ee

Browse files
authored
Merge pull request #72 from mlocati/release-urls-always
Always look for any stability in release URLs
2 parents 4f24e62 + fd7a5fd commit 28ff5ee

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

PhpManager/private/Get-PeclArchiveUrl.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
System.Array
2424
#>
2525
[OutputType([string])]
26+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'MaximumStability', Justification = 'Not used for now, but may be used in future')]
2627
param (
2728
[Parameter(Mandatory = $true, Position = 0)]
2829
[ValidateNotNull()]
@@ -60,9 +61,7 @@
6061
$rxMatch += '-' + [regex]::Escape($PhpVersion.Architecture)
6162
$rxMatch += '\.zip$'
6263
$urls = @()
63-
if ($MaximumStability -eq $Script:PEARSTATE_STABLE -or $MaximumStability -eq $Script:PEARSTATE_BETA) {
64-
$urls += "https://windows.php.net/downloads/pecl/releases/$handleLC/$PackageVersion"
65-
}
64+
$urls += "https://windows.php.net/downloads/pecl/releases/$handleLC/$PackageVersion"
6665
if ($MinimumStability -ne $Script:PEARSTATE_STABLE) {
6766
$urls += "https://windows.php.net/downloads/pecl/snaps/$handleLC/$PackageVersion"
6867
}

test/tests/Install-Enable-Extensions.Tests.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@
6969
$msgpack = Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'msgpack' }
7070
$msgpack | Should -HaveCount 1
7171
}
72+
It -Name 'should download and install pdo_sqlsrv-5.9.0-preview on PHP <version>' -TestCases $testCases {
73+
param ($path, $version)
74+
if ($version -ne '7.2') {
75+
Set-ItResult -Skipped -Because "Not supported on PHP $version"
76+
}
77+
if (-not(Get-ChildItem -Path "$($Env:WinDir)\System32" -Filter msodbcsql*.dll)) {
78+
Set-ItResult -Skipped -Because "Missing required system libraries"
79+
}
80+
Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'pdo_sqlsrv' } | Should -HaveCount 0
81+
Install-PhpExtension -Extension pdo_sqlsrv -Version 5.9.0 -MinimumStability devel -MaximumStability devel -Path $path
82+
Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'pdo_sqlsrv' } | Should -HaveCount 1
83+
}
84+
It -Name 'should download and install sqlsrv-5.9.0-preview on PHP <version>' -TestCases $testCases {
85+
param ($path, $version)
86+
if ($version -ne '7.2') {
87+
Set-ItResult -Skipped -Because "Not supported on PHP $version"
88+
}
89+
if (-not(Get-ChildItem -Path "$($Env:WinDir)\System32" -Filter msodbcsql*.dll)) {
90+
Set-ItResult -Skipped -Because "Missing required system libraries"
91+
}
92+
Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'sqlsrv' } | Should -HaveCount 0
93+
Install-PhpExtension -Extension sqlsrv -Version 5.9.0 -MinimumStability devel -MaximumStability devel -Path $path
94+
Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'sqlsrv' } | Should -HaveCount 1
95+
}
7296
It -Name 'should download and install yaml on PHP <version>' -TestCases $testCases {
7397
param ($path, $version)
7498
Get-PhpExtension -Path $path | Where-Object { $_.Handle -eq 'yaml' } | Should -HaveCount 0

0 commit comments

Comments
 (0)