RedirectTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
    public function setUp()
21
    {
22
        $this->ComodoDecodeCSR = new ComodoDecodeCSR();
23
    }
24
25 View Code Duplication
    public function test301Redirect()
26
    {
27
        $stream = Psr7\stream_for('{"data" : "test"}');
28
        $response = new Response(301, ['Location' => 'https://comododecodecsr.tk'], $stream);
29
30
        $test = $this->ComodoDecodeCSR->checkDVC($response);
31
        $this->assertFalse($test, "Failed to check 301 redirect");
32
    }
33
34 View Code Duplication
    public function test302Redirect()
35
    {
36
        $stream = Psr7\stream_for('{"data" : "test"}');
37
        $response = new Response(302, ['Location' => 'https://comododecodecsr.tk'], $stream);
38
39
        $test = $this->ComodoDecodeCSR->checkDVC($response);
40
        $this->assertFalse($test, "Failed to check 302 redirect");
41
    }
42
}
43