2018-05-23 19:47:15 +00:00
|
|
|
--TEST--
|
|
|
|
init object with custom home_dir
|
|
|
|
--SKIPIF--
|
|
|
|
<?php if(!class_exists("gnupg")) die("skip"); ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
require_once "gnupgt.inc";
|
|
|
|
$homedir = __DIR__ . '/init_oo_home';
|
|
|
|
if (!is_dir($homedir)) {
|
|
|
|
mkdir($homedir);
|
|
|
|
}
|
|
|
|
|
|
|
|
$gpg = new gnupg(array('home_dir' => $homedir));
|
|
|
|
$gpg->seterrormode(gnupg::ERROR_WARNING);
|
|
|
|
$gpg->import($testkey);
|
|
|
|
$imported = false;
|
|
|
|
foreach (glob("$homedir/*") as $filename) {
|
|
|
|
$imported = true;
|
|
|
|
}
|
|
|
|
var_dump($imported);
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
bool(true)
|
|
|
|
--CLEAN--
|
|
|
|
<?php
|
|
|
|
foreach (glob(__DIR__ . '/init_oo_home/*') as $filename) {
|
|
|
|
unlink($filename);
|
|
|
|
}
|
|
|
|
rmdir($homedir);
|
2018-05-25 18:42:47 +00:00
|
|
|
?>
|