Skip to content

Commit 29dd82e

Browse files
authored
Merge pull request #487 from Scalingo/tests
feat(tests): add tests for PHP 8.4
2 parents 0466514 + c085ebe commit 29dd82e

File tree

38 files changed

+990
-895
lines changed

38 files changed

+990
-895
lines changed

test/composer

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
3+
test::composer::classic() {
4+
#
5+
# Test a deployment of a PHP app using Composer
6+
# Specifying the Composer version only via environment.
7+
#
8+
9+
COMPOSER_VERSION="2.7.0"
10+
export COMPOSER_VERSION
11+
12+
test::utils::setupFixture "defaults/composer"
13+
test::utils::compile
14+
test::helpers::enter_prod
15+
16+
test::helpers::composer "2.7.0"
17+
}
18+
19+
test::composer::composer() {
20+
#
21+
# Test a deployment of a PHP app using Composer
22+
# Specifying the Composer version only via composer.json.
23+
#
24+
25+
test::utils::setupFixture "composer-2.7.0/composer"
26+
test::utils::compile
27+
test::helpers::enter_prod
28+
29+
test::helpers::composer "2.7.0"
30+
}
31+
32+
test::composer::composer_over_lower_classic() {
33+
#
34+
# Test a deployment of a PHP app using Composer
35+
# Specifying Composer version via both composer.json and COMPOSER_VERSION.
36+
# And where the version specified in composer.json is greater than the one
37+
# specified in COMPOSER_VERSION.
38+
#
39+
40+
COMPOSER_VERSION="2.6.0"
41+
export COMPOSER_VERSION
42+
43+
test::utils::setupFixture "composer-2.7.0/composer"
44+
test::utils::compile
45+
test::helpers::enter_prod
46+
47+
test::helpers::composer "2.7.0"
48+
}
49+
50+
test::composer::composer_over_higher_classic() {
51+
#
52+
# Test a deployment of a PHP app using Composer
53+
# Specifying Composer version via both composer.json and COMPOSER_VERSION.
54+
# And where the version specified in composer.json is greater than the one
55+
# specified in COMPOSER_VERSION.
56+
#
57+
58+
COMPOSER_VERSION="2.7.0"
59+
export COMPOSER_VERSION
60+
61+
test::utils::setupFixture "composer-2.6.0/composer"
62+
test::utils::compile
63+
test::helpers::enter_prod
64+
65+
test::helpers::composer "2.6.0"
66+
}

test/defaults

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
declare -gA default_php
4+
declare -gA default_nginx
5+
declare -gA default_composer
6+
7+
# Defaults for scalingo-20:
8+
default_php["scalingo-20"]="8.1."
9+
default_nginx["scalingo-20"]="1.26."
10+
default_composer["scalingo-20"]="2.8."
11+
12+
# Defaults for scalingo-22:
13+
default_php["scalingo-22"]="8.1."
14+
default_nginx["scalingo-22"]="1.26."
15+
default_composer["scalingo-22"]="2.8."
16+
17+
18+
test::defaults::classic() {
19+
#
20+
# Test a deployment of a classic app (not using Composer)
21+
# With default settings
22+
#
23+
24+
test::utils::setupFixture "defaults/classic"
25+
test::helpers::classic_deploy \
26+
"${default_php["${STACK}"]}" \
27+
"${default_nginx["${STACK}"]}"
28+
}
29+
30+
test::defaults::composer() {
31+
#
32+
# Test a deployment of a PHP app using Composer
33+
# With default settings
34+
#
35+
36+
test::utils::setupFixture "defaults/composer"
37+
test::helpers::composer_deploy \
38+
"${default_php["${STACK}"]}" \
39+
"${default_nginx["${STACK}"]}" \
40+
"${default_composer["${STACK}"]}"
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"require": {
3+
"php": "~8.1",
4+
"ext-calendar": "*",
5+
"ext-ftp": "*",
6+
"ext-gettext": "*",
7+
"ext-gmp": "*",
8+
"ext-imap": "*",
9+
"ext-sodium": "*",
10+
"ext-tidy": "*"
11+
}
12+
}

test/fixtures/php-8.1/optional_builtin/composer.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"require": {
3+
"php": "~8.2",
4+
"ext-calendar": "*",
5+
"ext-ftp": "*",
6+
"ext-gettext": "*",
7+
"ext-gmp": "*",
8+
"ext-imap": "*",
9+
"ext-sodium": "*",
10+
"ext-tidy": "*"
11+
}
12+
}

test/fixtures/php-8.2/optional_builtin/composer.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"require": {
3+
"php": "~8.3",
4+
"ext-calendar": "*",
5+
"ext-ftp": "*",
6+
"ext-gettext": "*",
7+
"ext-gmp": "*",
8+
"ext-imap": "*",
9+
"ext-sodium": "*",
10+
"ext-tidy": "*"
11+
}
12+
}

test/fixtures/php-8.3/optional_builtin/composer.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"php": "~8.0"
3+
"php": "~8.4"
44
}
55
}

test/fixtures/composer_php-8.0/composer.lock test/fixtures/php-8.4/composer/composer.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"require": {
3+
"php": "~8.4",
4+
"ext-calendar": "*",
5+
"ext-ftp": "*",
6+
"ext-gettext": "*",
7+
"ext-gmp": "*",
8+
"ext-sodium": "*",
9+
"ext-tidy": "*"
10+
}
11+
}

test/fixtures/php-8.4/optional_builtin/composer.lock

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)