mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-02-05 13:51:34 +00:00
Fix tests to work correctly with gpg1 and older gpgme versions
This commit is contained in:
parent
75a9b387ea
commit
542d121eca
4 changed files with 51 additions and 43 deletions
40
tests/gnupg_res_import.phpt
Normal file
40
tests/gnupg_res_import.phpt
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
--TEST--
|
||||
import a new key into the keyring
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gnupg")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once "gnupgt.inc";
|
||||
gnupgt::reset_key();
|
||||
|
||||
$gpg = gnupg_init();
|
||||
gnupg_seterrormode($gpg, GNUPG_ERROR_WARNING);
|
||||
$ret = gnupg_import($gpg, $testkey);
|
||||
var_dump($ret);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(9) {
|
||||
["imported"]=>
|
||||
int(1)
|
||||
["unchanged"]=>
|
||||
int(0)
|
||||
["newuserids"]=>
|
||||
int(0)
|
||||
["newsubkeys"]=>
|
||||
int(0)
|
||||
["secretimported"]=>
|
||||
int(1)
|
||||
["secretunchanged"]=>
|
||||
int(0)
|
||||
["newsignatures"]=>
|
||||
int(0)
|
||||
["skippedkeys"]=>
|
||||
int(0)
|
||||
["fingerprint"]=>
|
||||
string(40) "2DF0DD02DC9B70B7F64F572E669E775E0A6284B3"
|
||||
}
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once "gnupgt.inc";
|
||||
gnupgt::delete_key();
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue