Passed
Push — master ( 90db0f...396226 )
by Jafar
03:16
created

OpenSSLKeyLoaderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoadInvalidPublicKey() 0 5 1
A testLoadInvalidPrivateKey() 0 5 1
A setUp() 0 4 1
1
<?php
2
/*
3
 * This file is part of the Guarded Authentication package.
4
 *
5
 * (c) Jafar Jabr <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Jafar\Bundle\GuardedAuthenticationBundle\Tests\Api\KeyLoader;
12
13
use Jafar\Bundle\GuardedAuthenticationBundle\Api\KeyLoader\OpenSSLKeyLoader;
14
15
/**
16
 * Class OpenSSLKeyLoaderTest.
17
 *
18
 * @author Jafar Jabr <[email protected]>
19
 */
20
class OpenSSLKeyLoaderTest extends AbstractTestKeyLoader
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function setUp()
26
    {
27
        $keys_path       = dirname(__FILE__).'\keys\\';
28
        $this->keyLoader = new OpenSSLKeyLoader('anyPassphrase', $keys_path);
29
    }
30
31
    /**
32
     * @expectedException        \RuntimeException
33
     */
34
    public function testLoadInvalidPublicKey()
35
    {
36
        touch('public.pem');
37
38
        $this->keyLoader->loadKey('public');
39
    }
40
41
    /**
42
     * @expectedException        \RuntimeException
43
     */
44
    public function testLoadInvalidPrivateKey()
45
    {
46
        touch('private.pem');
47
48
        $this->keyLoader->loadKey('private');
49
    }
50
}
51