Completed
Push — develop ( 146f3e...4146c2 )
by Chris
03:08
created

RedirectTest::test302Redirect()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 8
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 5
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 GuzzleHttp\Psr7;
13
use GuzzleHttp\Psr7\Response;
14
use Xigen\ComodoDecodeCSR;
15
16
class RedirectTest extends XigenUnit
17
{
18
    protected $ComodoDecodeCSR;
19
20 2
    public function setUp()
21
    {
22 2
        $this->ComodoDecodeCSR = new ComodoDecodeCSR();
23 2
    }
24
25 1 View Code Duplication
    public function test301Redirect()
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...
26
    {
27 1
        $stream = Psr7\stream_for('{"data" : "test"}');
28 1
        $response = new Response(301, ['Location' => 'https://comododecodecsr.tk'], $stream);
29
30 1
        $test = $this->ComodoDecodeCSR->checkDVC($response);
31 1
        $this->assertFalse($test, "Failed to check 301 redirect");
32 1
    }
33
34 1 View Code Duplication
    public function test302Redirect()
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...
35
    {
36 1
        $stream = Psr7\stream_for('{"data" : "test"}');
37 1
        $response = new Response(302, ['Location' => 'https://comododecodecsr.tk'], $stream);
38
39 1
        $test = $this->ComodoDecodeCSR->checkDVC($response);
40 1
        $this->assertFalse($test, "Failed to check 302 redirect");
41 1
    }
42
}
43