[Windows] Add PHP to the toolset (#4493)

This commit is contained in:
V-Zabayrachny
2021-11-16 11:32:09 +03:00
committed by GitHub
parent 06c90a3200
commit d3e74a5d7d
5 changed files with 21 additions and 7 deletions

View File

@@ -1,13 +1,16 @@
Describe "PHP" {
It "Check <ToolName> in the PATH" -TestCases @(
@{ ToolName = "php" }
@{ ToolName = "composer" }
) {
"$ToolName --version" | Should -ReturnZeroExitCode
It "Check PHP version" {
$phpMajorMinor = (Get-ToolsetContent).php.version
$phpInstalledVersion = php --version | Select-String -Pattern "PHP $phpMajorMinor"
$phpInstalledVersion | Should -BeLike "*${phpMajorMinor}*"
}
It "Check Composer in the PATH" {
"composer --version" | Should -ReturnZeroExitCode
}
It "PHP Environment variables is set." {
${env:PHPROOT} | Should -Not -BeNullOrEmpty
${env:PHPROOT} | Should -Exist
}
}
}