mirror of
https://github.com/mlocati/docker-php-extension-installer
synced 2025-05-09 08:32:42 +00:00
Support installing custom languages for pspell (#621)
This commit is contained in:
parent
96362b2ba3
commit
51b16e983b
4 changed files with 46 additions and 3 deletions
|
@ -328,7 +328,7 @@ testExtensionFor() {
|
|||
printf ' - Docker image: %s\n' "$testExtensionFor_Image"
|
||||
testExtensionFor_out="$(mktemp)"
|
||||
testExtensionFor_start=$(date +%s)
|
||||
if $(docker run --rm --volume "$CI_BUILD_DIR:/app" --env CI=true --env IPE_FIX_CACERTS=1 --workdir /app "$testExtensionFor_Image" sh -c "./install-php-extensions $1 && php ./scripts/check-installed-extension.php $1" >"$testExtensionFor_out" 2>&1); then
|
||||
if $(docker run --rm --volume "$CI_BUILD_DIR:/app" --env CI=true --env IPE_FIX_CACERTS=1 --env IPE_ASPELL_LANGUAGES='en fr' --workdir /app "$testExtensionFor_Image" sh -c "./install-php-extensions $1 && php ./scripts/check-installed-extension.php $1" >"$testExtensionFor_out" 2>&1); then
|
||||
testExtensionFor_end=$(date +%s)
|
||||
testExtensionFor_delta=$(expr $testExtensionFor_end - $testExtensionFor_start)
|
||||
rm -rf "$testExtensionFor_out"
|
||||
|
|
31
scripts/tests/pspell
Executable file
31
scripts/tests/pspell
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/_bootstrap.php';
|
||||
|
||||
const ENGLISH_ONLY_WORD = 'Goodbye';
|
||||
const FRENCH_ONLY_WORD = 'Merci';
|
||||
|
||||
$rc = 0;
|
||||
|
||||
$english = pspell_new('en');
|
||||
$french = pspell_new('fr');
|
||||
|
||||
if (pspell_check($english, ENGLISH_ONLY_WORD) !== true) {
|
||||
fwrite(STDERR, "pspell failed to detect a correct English word ('" . ENGLISH_ONLY_WORD . "') as correct\n");
|
||||
$rc = 1;
|
||||
}
|
||||
if (pspell_check($french, ENGLISH_ONLY_WORD) !== false) {
|
||||
fwrite(STDERR, "pspell failed to detect a wrong French word ('" . ENGLISH_ONLY_WORD . "') as wrong\n");
|
||||
$rc = 1;
|
||||
}
|
||||
if (pspell_check($english, FRENCH_ONLY_WORD) !== false) {
|
||||
fwrite(STDERR, "pspell failed to detect a wrong English word ('" . FRENCH_ONLY_WORD . "') as wrong\n");
|
||||
$rc = 1;
|
||||
}
|
||||
if (pspell_check($french, FRENCH_ONLY_WORD) !== true) {
|
||||
fwrite(STDERR, "pspell failed to detect a correct French word ('" . FRENCH_ONLY_WORD . "') as correct\n");
|
||||
$rc = 1;
|
||||
}
|
||||
|
||||
exit($rc);
|
Loading…
Add table
Add a link
Reference in a new issue