Annotation of embedaddon/php/ext/pspell/tests/002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: pspell session
! 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: $p = pspell_new('en');
! 12:
! 13: var_dump(pspell_check('a'));
! 14: var_dump(pspell_check($p, 'somebogusword'));
! 15:
! 16: var_dump(pspell_add_to_session($p, ''));
! 17: var_dump(pspell_add_to_session($p, 'somebogusword'));
! 18: var_dump(pspell_check($p, 'somebogusword'));
! 19:
! 20: var_dump(pspell_clear_session(new stdclass));
! 21:
! 22: $res = @pspell_clear_session($p);
! 23: if ($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--
! 32: Warning: pspell_check() expects exactly 2 parameters, 1 given in %s on line %d
! 33: NULL
! 34: bool(false)
! 35: bool(false)
! 36: bool(true)
! 37: bool(true)
! 38:
! 39: Warning: pspell_clear_session() expects parameter 1 to be long, object given in %s on line %d
! 40: NULL
! 41: bool(true)
! 42: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>