php-gnupg/tests/gnupg_oo_init_home_dir.phpt
2018-06-04 19:29:56 +01:00

34 lines
713 B
PHP

--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);
$engine = $gpg->getengineinfo();
var_dump($engine['home_dir'] === $homedir);
?>
--EXPECT--
bool(true)
bool(true)
--CLEAN--
<?php
$homedir = __DIR__ . '/init_oo_home';
foreach (glob($homedir . '/*') as $filename) {
unlink($filename);
}
rmdir($homedir);
?>