~ubuntu-branches/ubuntu/trusty/php-horde-crypt/trusty

« back to all changes in this revision

Viewing changes to Horde_Crypt-2.2.1/test/Horde/Crypt/SmimeTest.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2013-08-11 12:49:39 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130811124939-9q96bn4m4isywxkl
Tags: 2.2.1-1
New upstream version 2.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Horde_Crypt_Smime tests.
 
4
 *
 
5
 * @author     Michael Slusarz <slusarz@horde.org>
 
6
 * @category   Horde
 
7
 * @license    http://www.horde.org/licenses/lgpl21 LGPL 2.1
 
8
 * @package    Crypt
 
9
 * @subpackage UnitTests
 
10
 */
 
11
 
 
12
class Horde_Crypt_SmimeTest extends PHPUnit_Framework_TestCase
 
13
{
 
14
    protected function setUp()
 
15
    {
 
16
        if (!extension_loaded('openssl')) {
 
17
            $this->markTestSkipped('No openssl support in PHP.');
 
18
        }
 
19
    }
 
20
 
 
21
    public function testSubjectAltName()
 
22
    {
 
23
        $smime = Horde_Crypt::factory('Smime', array(
 
24
            'temp' => sys_get_temp_dir()
 
25
        ));
 
26
 
 
27
        $key = file_get_contents(__DIR__ . '/fixtures/smime_subjectAltName.pem');
 
28
 
 
29
        $this->assertEquals(
 
30
            'test1@example.com',
 
31
            $smime->getEmailFromKey($key)
 
32
        );
 
33
    }
 
34
 
 
35
}