2
2
3
3
# ## Helpers functions
4
4
5
- test::helpers::classic_deploy () {
6
- # Deploys a classic PHP app step by step and tests that everything is
7
- # working as expected.
5
+ test::helpers::common_deploy () {
6
+ # Deploys a PHP app step by step and tests that everything related to the
7
+ # PHP setup is as expected.
8
8
# To do so, this function runs the buildpack scripts and mimicks the
9
9
# platform behavior wherever needed.
10
10
#
@@ -13,17 +13,17 @@ test::helpers::classic_deploy() {
13
13
# default_modules
14
14
#
15
15
# Arguments:
16
- # $1 > $php_version
17
- # See `test::helpers::php `.
16
+ # $1 > $detect_expectation
17
+ # See `test::helpers::detect `.
18
18
#
19
- # $2 > $nginx_version
20
- # See `test::helpers::nginx`
19
+ # $2 > $php_version
20
+ # See `test::helpers::php`.
21
21
22
- local php_version =" ${1} "
23
- local nginx_version =" ${2} "
22
+ local detect_expectation =" ${1} "
23
+ local php_version =" ${2} "
24
24
25
25
# Test bin/detect:
26
- test::helpers::detect " PHP (classic) "
26
+ test::helpers::detect " ${detect_expectation} "
27
27
28
28
# Test bin/compile:
29
29
test::helpers::compile
@@ -36,6 +36,28 @@ test::helpers::classic_deploy() {
36
36
37
37
# Test PHP default modules:
38
38
test::helpers::default_php_modules
39
+ }
40
+
41
+ test::helpers::classic_deploy () {
42
+ # Deploys a classic PHP app step by step and tests that everything is
43
+ # working as expected, including the Nginx version.
44
+ #
45
+ # Globals:
46
+ # STD_OUT
47
+ # default_modules
48
+ #
49
+ # Arguments:
50
+ # $1 > $php_version
51
+ # See `test::helpers::php`.
52
+ #
53
+ # $2 > $nginx_version
54
+ # See `test::helpers::nginx`
55
+
56
+ local php_version=" ${1} "
57
+ local nginx_version=" ${2} "
58
+
59
+ # Test everything related to PHP:
60
+ test::helpers::common_deploy " PHP (classic)" " ${php_version} "
39
61
40
62
# Test Nginx version:
41
63
test::helpers::nginx " ${nginx_version} "
@@ -45,10 +67,7 @@ test::helpers::classic_deploy() {
45
67
46
68
test::helpers::composer_deploy () {
47
69
# Deploys a Composer PHP app step by step and tests that everything is
48
- # working as expected.
49
- # To do so, this function runs the buildpack scripts and mimicks the
50
- # platform behavior wherever needed.
51
- # The different fixtures allow us to test different setup and conditions.
70
+ # working as expected, including the Nginx and the Composer versions.
52
71
#
53
72
# Globals:
54
73
# STD_OUT
@@ -68,20 +87,8 @@ test::helpers::composer_deploy() {
68
87
local nginx_version=" ${2} "
69
88
local composer_version=" ${3} "
70
89
71
- # Test bin/detect:
72
- test::helpers::detect " PHP (composer.json)"
73
-
74
- # Test bin/compile:
75
- test::helpers::compile
76
-
77
- # Switch environment:
78
- test::helpers::enter_prod
79
-
80
- # Test PHP version:
81
- test::helpers::php " ${php_version} "
82
-
83
- # Test default PHP defaults modules:
84
- test::helpers::default_php_modules
90
+ # Test everything related to PHP:
91
+ test::helpers::common_deploy " PHP (composer.json)" " ${php_version} "
85
92
86
93
# Test Nginx version:
87
94
test::helpers::nginx " ${nginx_version} "
0 commit comments