Skip to content

Commit

Permalink
add test for php buildpack
Browse files Browse the repository at this point in the history
  • Loading branch information
dliebreich committed Jun 24, 2014
1 parent 3cc215a commit d149dba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/buildpacks_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package apps

import (
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
Expand Down Expand Up @@ -52,4 +54,15 @@ var _ = Describe("Buildpacks", func() {
Expect(helpers.CurlAppRoot(appName)).To(ContainSubstring("python, world"))
})
})

Describe("php", func() {
// This test requires more time during push, because the php buildpack is slower than your average bear
var phpPushTimeout = CF_PUSH_TIMEOUT + 2 * time.Minute

It("makes the app reachable via its bound route", func() {
Expect(cf.Cf("push", appName, "-p", helpers.NewAssets().Php).Wait(phpPushTimeout)).To(Exit(0))

Expect(helpers.CurlAppRoot(appName)).To(ContainSubstring("Hello from php"))
})
})
})
5 changes: 5 additions & 0 deletions assets/php/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

echo 'Hello from php';

?>
2 changes: 2 additions & 0 deletions helpers/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Assets struct {
Python string
LoggregatorLoadGenerator string
ServiceBroker string
Php string
}

func NewAssets() Assets {
Expand All @@ -21,5 +22,6 @@ func NewAssets() Assets {
Python: "../assets/python",
LoggregatorLoadGenerator: "../assets/loggregator-load-generator",
ServiceBroker: "../assets/service_broker",
Php: "../assets/php",
}
}

0 comments on commit d149dba

Please sign in to comment.