diff --git a/images/macos/provision/core/php.sh b/images/macos/provision/core/php.sh index e269d42d..bc68692b 100644 --- a/images/macos/provision/core/php.sh +++ b/images/macos/provision/core/php.sh @@ -2,7 +2,8 @@ source ~/utils/utils.sh echo Installing PHP -brew_smart_install "php" +phpVersionToolset=$(get_toolset_value '.php.version') +brew_smart_install "php@${phpVersionToolset}" echo Installing composer brew_smart_install "composer" diff --git a/images/macos/tests/PHP.Tests.ps1 b/images/macos/tests/PHP.Tests.ps1 index 937c8746..ac34a9b4 100644 --- a/images/macos/tests/PHP.Tests.ps1 +++ b/images/macos/tests/PHP.Tests.ps1 @@ -6,12 +6,15 @@ Describe "PHP" -Skip:($os.IsMonterey) { Get-WhichTool "php" | Should -Not -BeLike "/usr/bin/php*" } It "PHP version" { - "php --version" | Should -ReturnZeroExitCode + $phpVersionToolset = Get-ToolsetValue 'php.version' + $phpInstalledVersion = php --version | Out-String | Select-String "${phpVersionToolset}" + $phpInstalledVersion | Should -BeLike "PHP ${phpVersionToolset}*" } } + Context "Composer" { It "Composer" { "composer --version" | Should -ReturnZeroExitCode } } -} \ No newline at end of file +} diff --git a/images/macos/toolsets/toolset-10.15.json b/images/macos/toolsets/toolset-10.15.json index 6597a3fe..cef4348d 100644 --- a/images/macos/toolsets/toolset-10.15.json +++ b/images/macos/toolsets/toolset-10.15.json @@ -341,6 +341,9 @@ "llvm": { "version": "13" }, + "php": { + "version": "8.0" + }, "mongodb": { "version": "5.0" }, diff --git a/images/macos/toolsets/toolset-11.json b/images/macos/toolsets/toolset-11.json index 35568ade..f0921898 100644 --- a/images/macos/toolsets/toolset-11.json +++ b/images/macos/toolsets/toolset-11.json @@ -293,10 +293,13 @@ "llvm": { "version": "13" }, + "php": { + "version": "8.0" + }, "mongodb": { "version": "5.0" }, "postgresql": { "version": "14" } -} \ No newline at end of file +} diff --git a/images/macos/toolsets/toolset-12.json b/images/macos/toolsets/toolset-12.json index 83a6ee5f..a0bd7936 100644 --- a/images/macos/toolsets/toolset-12.json +++ b/images/macos/toolsets/toolset-12.json @@ -191,6 +191,9 @@ "16" ] }, + "php": { + "version": "8.0" + }, "mongodb": { "version": "5.0" },