Annotation of embedaddon/php/ext/pspell/tests/003.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: pspell_config_ignore
3: --SKIPIF--
4: <?php
5: if (!extension_loaded('pspell')) die('skip');
6: if (!@pspell_new('en')) die('skip English dictionary is not available');
7: ?>
8: --FILE--
9: <?php
10:
11: $cfg = pspell_config_create('en', 'british', '', 'iso8859-1');
12: $cfg2 = pspell_config_create('en', 'british', '', 'b0rked');
13:
14: $p = pspell_new_config($cfg);
15: var_dump(pspell_check($p, 'yy'));
16:
17: $p2 = pspell_new_config($cfg2);
18: var_dump(pspell_check($p2, 'yy'));
19:
20: echo "---\n";
21: var_dump(pspell_config_ignore($cfg, 2));
22: $p = pspell_new_config($cfg);
23: var_dump(pspell_check($p, 'yy'));
24:
25: // segfault it?
26: var_dump(pspell_config_ignore($cfg, PHP_INT_MAX));
27:
28: ?>
29: --EXPECTF--
30: bool(false)
31:
32: Warning: pspell_new_config(): PSPELL couldn't open the dictionary. reason: The encoding "b0rked" is not known. This could also mean that the file "%sb0rked.%s" could not be opened for reading or does not exist. in %s003.php on line 9
33:
34: Warning: pspell_check(): 0 is not a PSPELL result index in %s003.php on line 10
35: bool(false)
36: ---
37: bool(true)
38: bool(true)
39: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>