diff --git a/test/defaults b/test/defaults index 14cd6742..fdb75af2 100644 --- a/test/defaults +++ b/test/defaults @@ -8,14 +8,14 @@ declare -gA latest_composer # Defaults for scalingo-22: default_php["scalingo-22"]="8.1." # This one depends on the semver stable rule configuration default_nginx["scalingo-22"]="1.28." -default_composer["scalingo-22"]="2.8." -latest_composer["scalingo-22"]="2.8.12" +default_composer["scalingo-22"]="2.9." +latest_composer["scalingo-22"]="2.9.2" # Defaults for scalingo-24: default_php["scalingo-24"]="8.4." default_nginx["scalingo-24"]="1.28." -default_composer["scalingo-24"]="2.8." -latest_composer["scalingo-24"]="2.8.12" +default_composer["scalingo-24"]="2.9." +latest_composer["scalingo-24"]="2.9.2" test::defaults::classic() { diff --git a/test/fixtures/composer-2.9.2/composer/composer.json b/test/fixtures/composer-2.9.2/composer/composer.json new file mode 100644 index 00000000..6cdc38dd --- /dev/null +++ b/test/fixtures/composer-2.9.2/composer/composer.json @@ -0,0 +1,9 @@ +{ + "extra": { + "paas": { + "engines": { + "composer": "2.9.2" + } + } + } +} diff --git a/test/fixtures/composer-2.9.2/composer/composer.lock b/test/fixtures/composer-2.9.2/composer/composer.lock new file mode 100644 index 00000000..b3a75590 --- /dev/null +++ b/test/fixtures/composer-2.9.2/composer/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "5aac55146c9cabad521141fa4188bbda", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/test/fixtures/composer-latest b/test/fixtures/composer-latest index 328db78b..86eeaefd 120000 --- a/test/fixtures/composer-latest +++ b/test/fixtures/composer-latest @@ -1 +1 @@ -composer-2.8.12 \ No newline at end of file +composer-2.9.2 \ No newline at end of file diff --git a/test/fixtures/php-8.5/composer/composer.json b/test/fixtures/php-8.5/composer/composer.json new file mode 100644 index 00000000..1659532c --- /dev/null +++ b/test/fixtures/php-8.5/composer/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "php": "~8.5" + } +} diff --git a/test/fixtures/php-8.5/composer/composer.lock b/test/fixtures/php-8.5/composer/composer.lock new file mode 100644 index 00000000..6b0f8281 --- /dev/null +++ b/test/fixtures/php-8.5/composer/composer.lock @@ -0,0 +1,20 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "376fc9f81f2d9ad80d18e90efda04653", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "~8.5" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/test/fixtures/php-8.5/optional_builtin/composer.json b/test/fixtures/php-8.5/optional_builtin/composer.json new file mode 100644 index 00000000..90cf9165 --- /dev/null +++ b/test/fixtures/php-8.5/optional_builtin/composer.json @@ -0,0 +1,11 @@ +{ + "require": { + "php": "~8.5", + "ext-calendar": "*", + "ext-ftp": "*", + "ext-gettext": "*", + "ext-gmp": "*", + "ext-sodium": "*", + "ext-tidy": "*" + } +} diff --git a/test/fixtures/php-8.5/optional_builtin/composer.lock b/test/fixtures/php-8.5/optional_builtin/composer.lock new file mode 100644 index 00000000..1e13b8ba --- /dev/null +++ b/test/fixtures/php-8.5/optional_builtin/composer.lock @@ -0,0 +1,26 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "117f5b234daeb22fb27fa5cbd5b95676", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "~8.5", + "ext-calendar": "*", + "ext-ftp": "*", + "ext-gettext": "*", + "ext-gmp": "*", + "ext-sodium": "*", + "ext-tidy": "*" + }, + "platform-dev": {}, + "plugin-api-version": "2.6.0" +} diff --git a/test/php85 b/test/php85 new file mode 100644 index 00000000..44606ade --- /dev/null +++ b/test/php85 @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +readonly default_builtins_extensions_85=( + "bcmath" "bz2" "Core" "ctype" "curl" "date" "dom" "exif" "fileinfo" + "filter" "gd" "hash" "iconv" "intl" "json" "libxml" "mbstring" "mysqli" + "mysqlnd" "openssl" "pcntl" "pcre" "PDO" "pdo_mysql" "pdo_pgsql" + "pdo_sqlite" "pgsql" "Phar" "posix" "random" "readline" "Reflection" + "session" "shmop" "SimpleXML" "soap" "sockets" "SPL" "sqlite3" "standard" + "tokenizer" "xml" "xmlreader" "xmlwriter" "xsl" "Zend OPcache" "zip" "zlib" +) + +readonly default_pecl_extensions_85=( + "apcu" "mongodb" "redis" +) + +readonly optional_builtin_extensions_85=( + "calendar" "ftp" "gettext" "gmp" "sodium" "tidy" +) + +test::php85::classic() { +# +# Test a deployment of a classic app (not using Composer) +# Specifying we want PHP 8.4.x via environment +# + + PHP_VERSION="8.5" + export PHP_VERSION + + test::utils::setupFixture "defaults/classic" + test::helpers::classic_deploy \ + "8.5." \ + "${default_nginx["${STACK}"]}" +} + +test::php85::composer() { +# +# Test a deployment of a PHP app using Composer +# Specifying we want PHP 8.4.x via composer.json +# + + test::utils::setupFixture "php-8.5/composer" + test::helpers::composer_deploy \ + "8.5." \ + "${default_nginx["${STACK}"]}" \ + "${default_composer["${STACK}"]}" +} + +test::php85::extensions::default() { +# +# Test the presence of default enabled built-in extensions. +# + + test::utils::setupFixture "php-8.5/composer" + + test::utils::compile + test::helpers::enter_prod + + local extensions=("${default_builtin_extensions_85[@]}") + extensions+=("${default_pecl_extensions_85[@]}") + + test::helpers::enabled_extensions "${extensions[@]}" +} + +test::php85::extensions::optional_builtin() { +# +# Test the presence of available built-in extensions that are not +# enabled by default. +# + + test::utils::setupFixture "php-8.5/optional_builtin" + + test::utils::compile + test::helpers::enter_prod + + test::helpers::enabled_extensions "${optional_builtin_extensions_85[@]}" +} + diff --git a/test/tests b/test/tests index 4b5dada7..02da4d63 100755 --- a/test/tests +++ b/test/tests @@ -8,6 +8,7 @@ source "$( pwd )/test/php81" source "$( pwd )/test/php82" source "$( pwd )/test/php83" source "$( pwd )/test/php84" +source "$( pwd )/test/php85" source "$( pwd )/test/php" source "$( pwd )/test/composer" source "$( pwd )/test/nginx" @@ -42,6 +43,12 @@ suite_addTest test::php84::composer suite_addTest test::php84::extensions::default suite_addTest test::php84::extensions::optional_builtin +# PHP 8.5 +suite_addTest test::php85::classic +suite_addTest test::php85::composer +suite_addTest test::php85::extensions::default +suite_addTest test::php85::extensions::optional_builtin + # PHP suite_addTest test::php::composer_over_lower_classic suite_addTest test::php::composer_over_higher_classic