Annotation of embedaddon/php/ext/pspell/tests/005.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: pspell configs
        !             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: $wordlist = dirname(__FILE__).'/wordlist.txt';
        !            12: 
        !            13: var_dump(pspell_new_personal(__FILE__, 'en'));
        !            14: $p = pspell_new_personal($wordlist, 'en');
        !            15: 
        !            16: var_dump(pspell_check($p, 'dfnvnsafksfksf'));
        !            17: 
        !            18: echo "--\n";
        !            19: $cfg = pspell_config_create('en');
        !            20: var_dump(pspell_config_personal($cfg, "$wordlist.tmp"));
        !            21: $p = pspell_new_config($cfg);
        !            22: 
        !            23: copy($wordlist, "$wordlist.tmp");
        !            24: 
        !            25: var_dump(pspell_check($p, 'ola'));
        !            26: var_dump(pspell_add_to_personal($p, 'ola'));
        !            27: var_dump(pspell_check($p, 'ola'));
        !            28: 
        !            29: echo "--\n";
        !            30: var_dump(pspell_save_wordlist($p));
        !            31: var_dump(strpos(file_get_contents("$wordlist.tmp"), 'ola') !== FALSE);
        !            32: 
        !            33: unlink("$wordlist.tmp");
        !            34: ?>
        !            35: --EXPECTF--
        !            36: Warning: pspell_new_personal(): PSPELL couldn't open the dictionary. reason: The file "%s005.php" is not in the proper format. in %s005.php on line 5
        !            37: bool(false)
        !            38: bool(true)
        !            39: --
        !            40: bool(true)
        !            41: bool(false)
        !            42: bool(true)
        !            43: bool(true)
        !            44: --
        !            45: bool(true)
        !            46: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>