Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions fixtures/php_all_modules/.bp-config/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"mailparse",
"maxminddb",
"mbstring",
"mcrypt",
"memcached",
"mongodb",
"msgpack",
Expand Down Expand Up @@ -63,7 +62,6 @@
"tidy",
"xsl",
"yaml",
"yaf",
"zip",
"zlib",
"phalcon"
Expand Down
1 change: 0 additions & 1 deletion fixtures/php_all_modules_composer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"ext-yaml": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ext-yaf" : "*",
"ext-phalcon": "*"
}
}
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language: php
default_versions:
- name: php
version: 8.1.32
version: 8.3.x
- name: httpd
version: 2.4.66
- name: nginx
Expand Down
19 changes: 14 additions & 5 deletions src/php/integration/modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"

"github.com/cloudfoundry/switchblade"
"github.com/sclevine/spec"

. "github.com/cloudfoundry/switchblade/matchers"
. "github.com/onsi/gomega"
"github.com/sclevine/spec"
"gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -69,13 +69,22 @@ func testModules(platform switchblade.Platform, fixtures string) func(*testing.T
}
}

// Resolve wildcard default (e.g. "8.3.x") to the highest matching
// exact version present in the manifest dependencies.
prefix := strings.TrimSuffix(phpVersion, "x")
var resolvedVersion string
var modules []SubDependency
for _, d := range manifest.Dependencies {
if d.Name == "php" && d.Version == phpVersion {
modules = d.Modules
break
if d.Name == "php" && strings.HasPrefix(d.Version, prefix) {
if resolvedVersion == "" || d.Version > resolvedVersion {
resolvedVersion = d.Version
modules = d.Modules
}
}
}
if resolvedVersion != "" {
phpVersion = resolvedVersion
}

Eventually(deployment).Should(Serve(
ContainSubstring(fmt.Sprintf("PHP %s", phpVersion)),
Expand Down
Loading