forked from heroku/heroku-buildpack-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Apache file path and add suite of buildpack-testrunner test
- Loading branch information
1 parent
286bebe
commit 9db64d4
Showing
4 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
testCompile() { | ||
touch ${BUILD_DIR}/index.php | ||
|
||
compile | ||
assertCapturedSuccess | ||
assertCaptured "Bundling Apache" | ||
assertTrue "Apache should be installed" "[ -d ${BUILD_DIR}/apache ]" | ||
assertTrue "Apache config should be copied" "[ -f ${BUILD_DIR}/apache/conf/httpd.conf ]" | ||
assertTrue "Apache should include mod_expires module" "[ -f ${BUILD_DIR}/apache/modules/mod_expires.so ]" | ||
assertTrue "Apache should include mod_headers module" "[ -f ${BUILD_DIR}/apache/modules/mod_headers.so ]" | ||
assertFileContains "Apache should load include expires_module" "LoadModule expires_module" "${BUILD_DIR}/apache/conf/httpd.conf" | ||
assertFileContains "Apache should load include headers_module" "LoadModule headers_module" "${BUILD_DIR}/apache/conf/httpd.conf" | ||
|
||
assertCaptured "Bundling PHP" | ||
assertTrue "PHP should be installed" "[ -d ${BUILD_DIR}/php ]" | ||
assertTrue "PHP config should be copied" "[ -f ${BUILD_DIR}/php/php.ini ]" | ||
assertTrue "PHP should include Redis extension" "[ -f ${BUILD_DIR}/php/ext/redis.so ]" | ||
assertFileContains "PHP should load Redis extension" "extension=redis.so" "${BUILD_DIR}/php/php.ini" | ||
|
||
assertTrue "bin dir should be created" "[ -d ${BUILD_DIR}/bin ]" | ||
assertTrue "boot.sh dir should be created and be executable" "[ -x ${BUILD_DIR}/boot.sh ]" | ||
assertEquals "cache should be cleared" "" "$(ls ${CACHE_DIR})" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
testNoDetect() { | ||
detect | ||
|
||
assertNoAppDetected | ||
} | ||
|
||
testDetect_PHP() { | ||
touch ${BUILD_DIR}/index.php | ||
|
||
detect | ||
|
||
assertAppDetected "PHP" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
testRelease() { | ||
release | ||
|
||
assertCapturedSuccess | ||
assertCaptured "web: sh boot.sh" | ||
} |