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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2013-04-07 15:44:20 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130407154420-c39qgb7itdsbv373
Tags: 2.1.3-1
New upstream version 2.1.3

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
 
}