Completed
Push — master ( facf10...129baf )
by Chris
02:33
created

DiffrentTextfileCSRTest::testWithJustSH1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author     Chris Hilsdon <[email protected]>
4
 * @package    ComodoDecodeCSR
5
 * @copyright  2016 Xigen
6
 * @license    GNU General Public License v3
7
 * @link       https://github.com/XigenChris/ComodoDecodeCSR
8
 */
9
10
namespace Xigen\Tests;
11
12
use Xigen\ComodoDecodeCSR;
13
14
class DiffrentTextfileCSRTest extends XigenUnit
15
{
16
    protected $ComodoDecodeCSR;
17
    protected $Hashes;
18
19 5
    public function setUp()
20
    {
21 5
        $this->ComodoDecodeCSR = new ComodoDecodeCSR();
22 5
        $this->ComodoDecodeCSR->setCSR($this->loadTestCSR());
23 5
        $this->Hashes = $this->ComodoDecodeCSR->fetchHashes();
24 5
    }
25
26 5
    private function checkresponse($response)
27
    {
28 5
        return $this->ComodoDecodeCSR->checkDVC($response);
29
    }
30
31 1
    public function testWithEmptyresponse()
32
    {
33 1
        $response = "";
34 1
        $test = $this->checkresponse($response);
35 1
        $this->assertFalse($test);
36 1
    }
37
38 1
    public function testWithTrailingReturn()
39
    {
40 1
        $response = "\n";
41 1
        $test = $this->checkresponse($response);
42 1
        $this->assertFalse($test);
43 1
    }
44
45 1
    public function testWithJustSH1()
46
    {
47 1
        $response = $this->validSHA1 . "\n";
48 1
        $test = $this->checkresponse($response);
49 1
        $this->assertFalse($test);
50 1
    }
51
52 1 View Code Duplication
    public function testWithSH1AndComdoText()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
53
    {
54 1
        $response = $this->validSHA1 . "\n";
55 1
        $response .= "comodoca.com\n";
56 1
        $test = $this->checkresponse($response);
57 1
        $this->assertTrue($test);
58 1
    }
59
60 1 View Code Duplication
    public function testWithSH1AndComdoTextNoTrailingReturn()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
61
    {
62 1
        $response = $this->validSHA1 . "\n";
63 1
        $response .= "comodoca.com";
64 1
        $test = $this->checkresponse($response);
65 1
        $this->assertTrue($test);
66 1
    }
67
}
68