diff --git a/tests/gnupg_oo_keyinfo.phpt b/tests/gnupg_oo_keyinfo.phpt index 4bac273..0f28907 100644 --- a/tests/gnupg_oo_keyinfo.phpt +++ b/tests/gnupg_oo_keyinfo.phpt @@ -16,14 +16,38 @@ gnupgt::check_array(false, $ret, 0, 'revoked'); gnupgt::check_array(false, $ret, 0, 'is_secret'); gnupgt::check_array(true, $ret, 0, 'can_sign'); gnupgt::check_array(true, $ret, 0, 'can_encrypt'); -gnupgt::check_array('testkey', $ret, 0, 'uuids', 0, 'name'); -gnupgt::check_array('testkey', $ret, 0, 'uuids', 0, 'comment'); -gnupgt::check_array('test@example.net', $ret, 0, 'uuids', 0, 'email'); -gnupgt::check_array('testkey (testkey) test@example.net', $ret, 0, 'uuids', 0, 'uid'); -gnupgt::check_array(false, $ret, 0, 'uuids', 0, 'revoked'); -gnupgt::check_array(false, $ret, 0, 'uuids', 0, 'invalid'); +// uid +gnupgt::check_array('testkey', $ret, 0, 'uids', 0, 'name'); +gnupgt::check_array('testkey', $ret, 0, 'uids', 0, 'comment'); +gnupgt::check_array('test@example.net', $ret, 0, 'uids', 0, 'email'); +gnupgt::check_array('testkey (testkey) ', $ret, 0, 'uids', 0, 'uid'); +gnupgt::check_array(false, $ret, 0, 'uids', 0, 'revoked'); +gnupgt::check_array(false, $ret, 0, 'uids', 0, 'invalid'); +gnupgt::check_array(false, $ret, 0, 'uids', 0, 'invalid'); +// subkey 1 +gnupgt::check_array("64DF06E42FCF2094590CDEEE2E96F141B3DD2B2E", $ret, 0, 'subkeys', 0, 'fingerprint'); +gnupgt::check_array("2E96F141B3DD2B2E", $ret, 0, 'subkeys', 0, 'keyid'); +gnupgt::check_array(1129316524, $ret, 0, 'subkeys', 0, 'timestamp'); +gnupgt::check_array(0, $ret, 0, 'subkeys', 0, 'expires'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 0, 'is_secret'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 0, 'can_encrypt'); +gnupgt::check_array(true, $ret, 0, 'subkeys', 0, 'can_sign'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 0, 'disabled'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 0, 'expired'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 0, 'revoked'); +// subkey 2 +gnupgt::check_array("A3437D3651E27CF9864198F0BFE8D07DDACDEAC8", $ret, 0, 'subkeys', 1, 'fingerprint'); +gnupgt::check_array("BFE8D07DDACDEAC8", $ret, 0, 'subkeys', 1, 'keyid'); +gnupgt::check_array(1129316525, $ret, 0, 'subkeys', 1, 'timestamp'); +gnupgt::check_array(0, $ret, 0, 'subkeys', 1, 'expires'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 1, 'is_secret'); +gnupgt::check_array(true, $ret, 0, 'subkeys', 1, 'can_encrypt'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 1, 'can_sign'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 1, 'disabled'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 1, 'expired'); +gnupgt::check_array(false, $ret, 0, 'subkeys', 1, 'revoked'); -//var_dump($ret); +var_dump($ret); ?> --EXPECT-- array(1) { diff --git a/tests/gnupgt.inc b/tests/gnupgt.inc index 4ee8556..16264fc 100644 --- a/tests/gnupgt.inc +++ b/tests/gnupgt.inc @@ -71,10 +71,10 @@ class gnupgt { return self::error( sprintf( - "key %s value %s does not match expected %s", + "key %s value %s does not match expected %s\n", $key, var_export($value, true), - var_export($value, true) + var_export($expected, true) ) ); }