File: 005.phpt

package info (click to toggle)
php5 5.6.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 150,376 kB
  • sloc: ansic: 727,510; php: 21,966; sh: 12,356; cpp: 8,763; xml: 6,105; yacc: 1,551; exp: 1,514; makefile: 1,461; pascal: 1,048; awk: 538; perl: 315; sql: 22
file content (46 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--TEST--
pspell configs
--SKIPIF--
<?php
if (!extension_loaded('pspell')) die('skip');
if (!@pspell_new('en')) die('skip English dictionary is not available');
?>
--FILE--
<?php

$wordlist = dirname(__FILE__).'/wordlist.txt';

var_dump(pspell_new_personal(__FILE__, 'en'));
$p = pspell_new_personal($wordlist, 'en');

var_dump(pspell_check($p, 'dfnvnsafksfksf'));

echo "--\n";
$cfg = pspell_config_create('en');
var_dump(pspell_config_personal($cfg, "$wordlist.tmp"));
$p = pspell_new_config($cfg);

copy($wordlist, "$wordlist.tmp");

var_dump(pspell_check($p, 'ola'));
var_dump(pspell_add_to_personal($p, 'ola'));
var_dump(pspell_check($p, 'ola'));

echo "--\n";
var_dump(pspell_save_wordlist($p));
var_dump(strpos(file_get_contents("$wordlist.tmp"), 'ola') !== FALSE);

unlink("$wordlist.tmp");
?>
--EXPECTF--
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
bool(false)
bool(true)
--
bool(true)
bool(false)
bool(true)
bool(true)
--
bool(true)
bool(true)