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

OpenSSLKeyLoaderTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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