mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2026-02-05 13:51:34 +00:00
Refactore all test to be independent
This commit is contained in:
parent
3bb4d28798
commit
4aabe3c966
26 changed files with 306 additions and 108 deletions
|
|
@ -1,16 +1,18 @@
|
|||
--TEST--n
|
||||
sign a text with sigmode SIG_MODE_CLEAR
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gnupg")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once(dirname(__FILE__)."/vars.inc");
|
||||
require_once "gnupgt.inc";
|
||||
gnupgt::import_key();
|
||||
|
||||
$gpg = gnupg_init();
|
||||
gnupg_seterrormode($gpg, GNUPG_ERROR_WARNING);
|
||||
gnupg_setsignmode($gpg, GNUPG_SIG_MODE_CLEAR);
|
||||
gnupg_addsignkey($gpg, $fingerprint, $passphrase);
|
||||
$ret = gnupg_sign($gpg, $plaintext);
|
||||
|
||||
$gpg = NULL;
|
||||
|
||||
$gpg = gnupg_init();
|
||||
$tmp = false;
|
||||
$ret = gnupg_verify($gpg, $ret, false, $tmp);
|
||||
|
|
@ -36,3 +38,8 @@ array(1) {
|
|||
}
|
||||
string(8) "foo bar
|
||||
"
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once "gnupgt.inc";
|
||||
gnupgt::delete_key();
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue