1
0
Fork 0
mirror of https://github.com/mlocati/docker-php-extension-installer synced 2025-05-09 00:22:40 +00:00

Support installing custom languages for pspell (#621)

This commit is contained in:
Michele Locati 2022-08-03 18:41:24 +02:00 committed by GitHub
parent 96362b2ba3
commit 51b16e983b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 3 deletions

31
scripts/tests/pspell Executable file
View 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);