CommonTests   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetPrivateKey() 0 4 1
A testGetPublicKey() 0 4 1
A testConvertPrivateKey() 0 4 1
A testConvertPublicKey() 0 4 1
1
<?php
2
/**
3
 * @author Threema GmbH
4
 * @copyright Copyright (c) 2015-2016 Threema GmbH
5
 */
6
7
8
9
namespace Threema\MsgApi\Tests;
10
11
use Threema\Console\Common;
12
13
class CommonTests extends \PHPUnit_Framework_TestCase {
14
15
	public function testGetPrivateKey() {
16
		$realPrivateKey = Common::getPrivateKey(Constants::myPrivateKey);
17
		$this->assertEquals($realPrivateKey, Constants::myPrivateKeyExtract, 'getPrivateKey failed');
18
	}
19
20
	public function testGetPublicKey() {
21
		$realPublicKey = Common::getPublicKey(Constants::myPublicKey);
22
		$this->assertEquals($realPublicKey, Constants::myPublicKeyExtract, 'myPublicKey failed');
23
	}
24
25
	public function testConvertPrivateKey() {
26
		$p = Common::convertPrivateKey('PRIVKEYSTRING');
27
		$this->assertEquals($p, 'private:PRIVKEYSTRING', 'convertPrivateKey failed');
28
	}
29
30
	public function testConvertPublicKey() {
31
		$p = Common::convertPublicKey('PUBKEYSTRING');
32
		$this->assertEquals($p, 'public:PUBKEYSTRING', 'convertPublicKey failed');
33
	}
34
}
35