mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
new test for enchant pwl file
This commit is contained in:
parent
f3abea9f91
commit
3b004baaaa
2 changed files with 51 additions and 0 deletions
41
ext/enchant/tests/broker_request_pwl_dict.phpt
Normal file
41
ext/enchant/tests/broker_request_pwl_dict.phpt
Normal file
|
@ -0,0 +1,41 @@
|
|||
--TEST--
|
||||
resource enchant_broker_request_pwl_dict(resource $broker, string $filename); function
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('enchant')) die('skip, enchant not loader');
|
||||
if(!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
|
||||
if(!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, dont has dictionary install in this machine! \n");}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$broker = enchant_broker_init();
|
||||
$pathPwlDict = __DIR__ . "/enchant_broker_request_pwl_dict.pwl";
|
||||
|
||||
if (is_resource($broker)) {
|
||||
echo("OK\n");
|
||||
$requestDict = enchant_broker_request_pwl_dict($broker, $pathPwlDict);
|
||||
|
||||
if (is_resource($requestDict)) {
|
||||
echo("OK\n");
|
||||
$dictdescribe = enchant_dict_describe($requestDict);
|
||||
|
||||
if ($pathPwlDict === $dictdescribe['file']) {
|
||||
echo("OK\n");
|
||||
} else {
|
||||
echo("broker dict describe is not a resource failed\n");
|
||||
}
|
||||
} else {
|
||||
echo("dict broker request pwl has failed\n");
|
||||
}
|
||||
} else {
|
||||
echo("broker is not a resource; failed;\n");
|
||||
}
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
OK
|
||||
OK
|
||||
OK
|
10
ext/enchant/tests/enchant_broker_request_pwl_dict.pwl
Normal file
10
ext/enchant/tests/enchant_broker_request_pwl_dict.pwl
Normal file
|
@ -0,0 +1,10 @@
|
|||
java
|
||||
perl
|
||||
awk
|
||||
clang
|
||||
php
|
||||
python
|
||||
cplusplus
|
||||
csharp
|
||||
bash
|
||||
ruby
|
Loading…
Add table
Add a link
Reference in a new issue