mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
Adjust CI tests for enchant
This commit is contained in:
@@ -58,22 +58,22 @@ docker run \
|
|||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
if [ -f \"\${1:-}\" ]; then
|
if [ -f \"\${1:-}\" ]; then
|
||||||
fail=0
|
error=0
|
||||||
printf \"[TEST] %s\" \"\${1}\"
|
|
||||||
|
|
||||||
if script -e -c \"php \${1}\" /dev/null 2>&1 | grep -Ei \"core|segmentation|fatal|except|err|warn|notice\" 2>&1 >/dev/null; then
|
if script -e -c \"php \${1}\" /dev/null 2>&1 | grep -Ei \"core|segmentation|fatal|except|err|warn|notice\" 2>&1 >/dev/null; then
|
||||||
fail=1
|
|
||||||
fi
|
|
||||||
if ! php \"\${1}\" 2>&1 | grep -E \"^(OK|SKIP)$\" 2>&1 >/dev/null; then
|
|
||||||
fail=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ \"\${fail}\" != \"0\" ]; then
|
|
||||||
printf \"\\r[FAIL] %s\\n\" \"\${1}\"
|
printf \"\\r[FAIL] %s\\n\" \"\${1}\"
|
||||||
php \"\${1}\" || true
|
php \"\${1}\" || true
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
printf \"\\r[OK] %s\\n\" \"\${1}\"
|
if php \"\${1}\" 2>&1 | grep -E \"^(OK)$\" 2>&1 >/dev/null; then
|
||||||
|
printf \"\\r[OK] %s\\n\" \"\${1}\"
|
||||||
|
elif php \"\${1}\" 2>&1 | grep -E \"^(SKIP)$\" 2>&1 >/dev/null; then
|
||||||
|
printf \"\\r[SKIP] %s\\n\" \"\${1}\"
|
||||||
|
else
|
||||||
|
printf \"\\r[FAIL] %s\\n\" \"\${1}\"
|
||||||
|
php \"\${1}\" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ ini_set('display_startup_errors', 1);
|
|||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// FIXME: Currently disabled for PHP 7.3 and PHP 7.4
|
||||||
|
if (PHP_MAJOR_VERSION == 7) {
|
||||||
|
if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$backend = 'aspell';
|
$backend = 'aspell';
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ ini_set('display_startup_errors', 1);
|
|||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// FIXME: Currently disabled for PHP 7.3 and PHP 7.4
|
||||||
|
if (PHP_MAJOR_VERSION == 7) {
|
||||||
|
if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$backend = 'hspell';
|
$backend = 'hspell';
|
||||||
|
|
||||||
|
|||||||
51
tests/mods/modules/enchant/enchant-hunspell.php
Normal file
51
tests/mods/modules/enchant/enchant-hunspell.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This page should print 'OK' if everything works,
|
||||||
|
* 'FAIL' or nothing if an error occured.
|
||||||
|
*/
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// FIXME: Currently disabled for PHP 7.3 and PHP 7.4
|
||||||
|
if (PHP_MAJOR_VERSION == 7) {
|
||||||
|
if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMPORTANT:
|
||||||
|
* ----------
|
||||||
|
* The Myspell backend has been renamed to Hunspell to match the upstream
|
||||||
|
* project. Users with their own enchant.ordering files will need to change
|
||||||
|
* "myspell" to "hunspell" (as of enchant 2.0)
|
||||||
|
* https://github.com/AbiWord/enchant/blob/master/NEWS
|
||||||
|
*/
|
||||||
|
// Only available since 5.4.0
|
||||||
|
if (version_compare(PHP_VERSION, '7.3.0', '<')) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$backend = 'hunspell';
|
||||||
|
|
||||||
|
$tag = 'en_US';
|
||||||
|
if (($r = enchant_broker_init()) === FALSE) {
|
||||||
|
echo 'FAIL: enchant_broker_init()';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
if (($bprovides = enchant_broker_describe($r)) === FALSE) {
|
||||||
|
echo 'FAIL: enchant_broker_describe()';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($bprovides as $be) {
|
||||||
|
if ($be['name'] == $backend) {
|
||||||
|
echo 'OK';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo 'FAIL: "'. $backend . '" not available';
|
||||||
|
exit(1);
|
||||||
@@ -7,6 +7,22 @@ ini_set('display_startup_errors', 1);
|
|||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// FIXME: Currently disabled for PHP 7.3 and PHP 7.4
|
||||||
|
if (PHP_MAJOR_VERSION == 7) {
|
||||||
|
if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: Currently not available for PHP 8.0 and PHP 8.1
|
||||||
|
if (PHP_MAJOR_VERSION == 8) {
|
||||||
|
if (PHP_MINOR_VERSION == 0 || PHP_MINOR_VERSION == 1) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$backend = 'ispell';
|
$backend = 'ispell';
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,27 @@ ini_set('display_startup_errors', 1);
|
|||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// FIXME: Currently disabled for PHP 7.3 and PHP 7.4
|
||||||
|
if (PHP_MAJOR_VERSION == 7) {
|
||||||
|
if (PHP_MINOR_VERSION == 3 || PHP_MINOR_VERSION == 4) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMPORTANT:
|
||||||
|
* ----------
|
||||||
|
* The Myspell backend has been renamed to Hunspell to match the upstream
|
||||||
|
* project. Users with their own enchant.ordering files will need to change
|
||||||
|
* "myspell" to "hunspell" (as of enchant 2.0)
|
||||||
|
* https://github.com/AbiWord/enchant/blob/master/NEWS
|
||||||
|
*/
|
||||||
|
// Only available since 5.4.0
|
||||||
|
if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
|
||||||
|
echo 'SKIP';
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
$backend = 'myspell';
|
$backend = 'myspell';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user