From d149dba9fd30dd7a6aceb3f99d0c2fc5dab7d7c2 Mon Sep 17 00:00:00 2001 From: Dave Liebreich and Zach Robinson Date: Mon, 23 Jun 2014 17:23:58 -0700 Subject: [PATCH] add test for php buildpack --- apps/buildpacks_test.go | 13 +++++++++++++ assets/php/index.php | 5 +++++ helpers/assets.go | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 assets/php/index.php diff --git a/apps/buildpacks_test.go b/apps/buildpacks_test.go index 5a6c4170b..359d359a4 100644 --- a/apps/buildpacks_test.go +++ b/apps/buildpacks_test.go @@ -1,6 +1,8 @@ package apps import ( + "time" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gexec" @@ -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")) + }) + }) }) diff --git a/assets/php/index.php b/assets/php/index.php new file mode 100644 index 000000000..b1775c21e --- /dev/null +++ b/assets/php/index.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/helpers/assets.go b/helpers/assets.go index 238f2c282..e5c4942e8 100644 --- a/helpers/assets.go +++ b/helpers/assets.go @@ -9,6 +9,7 @@ type Assets struct { Python string LoggregatorLoadGenerator string ServiceBroker string + Php string } func NewAssets() Assets { @@ -21,5 +22,6 @@ func NewAssets() Assets { Python: "../assets/python", LoggregatorLoadGenerator: "../assets/loggregator-load-generator", ServiceBroker: "../assets/service_broker", + Php: "../assets/php", } }