Skip to content

Commit

Permalink
Allow PGP backend drivers to be tested separately
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Mar 25, 2015
1 parent 4ff8773 commit a5e5c6b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 65 deletions.
8 changes: 6 additions & 2 deletions framework/Crypt/package.xml
Expand Up @@ -332,11 +332,14 @@
<file name="pgp_signed2.txt" role="test" />
<file name="smime_subjectAltName.pem" role="test" />
</dir> <!-- /test/Horde/Crypt/fixtures -->
<dir name="Pgp">
<file name="BinaryTest.php" role="test" />
<file name="TestBase.php" role="test" />
</dir> <!-- /test/Horde/Crypt/Pgp -->
<file name="AllTests.php" role="test" />
<file name="bootstrap.php" role="test" />
<file name="conf.php.dist" role="test" />
<file name="PgpKeyserverTest.php" role="test" />
<file name="PgpTest.php" role="test" />
<file name="phpunit.xml" role="test" />
<file name="SmimeTest.php" role="test" />
</dir> <!-- /test/Horde/Crypt -->
Expand Down Expand Up @@ -537,7 +540,6 @@
<install as="Horde/Crypt/bootstrap.php" name="test/Horde/Crypt/bootstrap.php" />
<install as="Horde/Crypt/conf.php.dist" name="test/Horde/Crypt/conf.php.dist" />
<install as="Horde/Crypt/PgpKeyserverTest.php" name="test/Horde/Crypt/PgpKeyserverTest.php" />
<install as="Horde/Crypt/PgpTest.php" name="test/Horde/Crypt/PgpTest.php" />
<install as="Horde/Crypt/phpunit.xml" name="test/Horde/Crypt/phpunit.xml" />
<install as="Horde/Crypt/SmimeTest.php" name="test/Horde/Crypt/SmimeTest.php" />
<install as="Horde/Crypt/fixtures/bug_6601.asc" name="test/Horde/Crypt/fixtures/bug_6601.asc" />
Expand All @@ -550,6 +552,8 @@
<install as="Horde/Crypt/fixtures/pgp_signed.txt" name="test/Horde/Crypt/fixtures/pgp_signed.txt" />
<install as="Horde/Crypt/fixtures/pgp_signed2.txt" name="test/Horde/Crypt/fixtures/pgp_signed2.txt" />
<install as="Horde/Crypt/fixtures/smime_subjectAltName.pem" name="test/Horde/Crypt/fixtures/smime_subjectAltName.pem" />
<install as="Horde/Crypt/Pgp/BinaryTest.php" name="test/Horde/Crypt/Pgp/BinaryTest.php" />
<install as="Horde/Crypt/Pgp/TestBase.php" name="test/Horde/Crypt/Pgp/TestBase.php" />
</filelist>
</phprelease>
<changelog>
Expand Down
35 changes: 35 additions & 0 deletions framework/Crypt/test/Horde/Crypt/Pgp/BinaryTest.php
@@ -0,0 +1,35 @@
<?php
/**
* Tests for the PGP binary backend.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2015 Horde LLC
* @ignore
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Crypt
* @subpackage UnitTests
*/
class Horde_Crypt_Pgp_BinaryTest
extends Horde_Crypt_Pgp_TestBase
{
protected function _setUp()
{
$c = self::getConfig('CRYPTPGP_TEST_CONFIG', __DIR__ . '/../');
$gnupg = isset($c['gnupg'])
? $c['gnupg']
: '/usr/bin/gpg';

if (!is_executable($gnupg)) {
$this->markTestSkipped(sprintf(
'GPG binary not found at %s.',
$gnupg
));
}

return array(
new Horde_Crypt_Pgp_Backend_Binary($gnupg, sys_get_temp_dir())
);
}

}

0 comments on commit a5e5c6b

Please sign in to comment.