Skip to content

Commit

Permalink
Use custom ini file to show extensions can be loaded automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatcasey committed Apr 14, 2022
1 parent 4a3a4ee commit e783fb1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
3 changes: 1 addition & 2 deletions integration/testdata/with_extensions/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"ext-gd": "*",
"ext-fileinfo": "*",
"ext-mysqli": "*",
"ext-mbstring": "*",
"ext-foobar": "*"
"ext-mbstring": "*"
},
"scripts": {
"post-install-cmd": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extension=zip.so
extension=gd.so
extension=fileinfo.so
extension=mysqli.so
extension=mbstring.so
16 changes: 10 additions & 6 deletions integration/with_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func testWithExtensions(t *testing.T, context spec.G, it spec.S) {
docker = occam.NewDocker()
})

context.Pend("with extensions", func() {
context("with extensions", func() {
var (
image occam.Image
container occam.Container
Expand Down Expand Up @@ -86,11 +86,15 @@ func testWithExtensions(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("PostInstall [zip]")).OnPort(8765).WithEndpoint("/extensions.php"))
Eventually(container).Should(Serve(ContainSubstring("PostInstall [gd]")).OnPort(8765).WithEndpoint("/extensions.php"))
Eventually(container).Should(Serve(ContainSubstring("PostInstall [fileinfo]")).OnPort(8765).WithEndpoint("/extensions.php"))
Eventually(container).Should(Serve(ContainSubstring("PostInstall [mysqli]")).OnPort(8765).WithEndpoint("/extensions.php"))
Eventually(container).Should(Serve(ContainSubstring("PostInstall [mbstring]")).OnPort(8765).WithEndpoint("/extensions.php"))
extensionsMatcher := And(
ContainSubstring("zip"),
ContainSubstring("gd"),
ContainSubstring("fileinfo"),
ContainSubstring("mysqli"),
ContainSubstring("mbstring"),
)

Eventually(container).Should(Serve(extensionsMatcher).OnPort(8765).WithEndpoint("/extensions.php"))
})
})
}

0 comments on commit e783fb1

Please sign in to comment.