xref: /PHP-5.5/ext/pspell/tests/002.phpt (revision fe0403d3)
1--TEST--
2pspell session
3--SKIPIF--
4<?php
5if (!extension_loaded('pspell')) die('skip');
6if (!@pspell_new('en')) die('skip English dictionary is not available');
7?>
8--FILE--
9<?php
10
11$p = pspell_new('en');
12
13var_dump(pspell_check('a'));
14var_dump(pspell_check($p, 'somebogusword'));
15
16var_dump(pspell_add_to_session($p, ''));
17var_dump(pspell_add_to_session($p, 'somebogusword'));
18var_dump(pspell_check($p, 'somebogusword'));
19
20var_dump(pspell_clear_session(new stdclass));
21
22$res = @pspell_clear_session($p);
23if ($res) {
24	var_dump($res);
25	var_dump(pspell_check($p, 'somebogusword'));
26} else {
27	echo "bool(true)\n";
28	echo "bool(false)\n";
29}
30?>
31--EXPECTF--
32Warning: pspell_check() expects exactly 2 parameters, 1 given in %s on line %d
33NULL
34bool(false)
35bool(false)
36bool(true)
37bool(true)
38
39Warning: pspell_clear_session() expects parameter 1 to be long, object given in %s on line %d
40NULL
41bool(true)
42bool(false)
43