Passed
Pull Request — master (#17)
by Mihail
15:10
created

UriIntegrationTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 17
c 1
b 0
f 1
dl 0
loc 47
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testUriModification2() 0 3 1
A testAuthority() 0 13 1
A createUri() 0 4 1
A testUriModification1() 0 3 1
1
<?php
2
3
namespace Tests\Koded\Http\Integration;
4
5
use Koded\Http\Uri;
6
use Psr\Http\Message\UriInterface;
7
8
/**
9
 * @group integration
10
 */
11
class UriIntegrationTest extends \Http\Psr7Test\UriIntegrationTest
12
{
13
    protected $skippedTests = [
14
        'testWithSchemeInvalidArguments' => 'Skipped, strict type implementation',
15
16
        'testGetPathNormalizesMultipleLeadingSlashesToSingleSlashToPreventXSS' => 'Is this test correct?',
17
18
        'testGetSize' => 'Skipping for now ...',
19
    ];
20
21
    /**
22
     * @param string $uri
23
     *
24
     * @return UriInterface
25
     */
26
    public function createUri($uri)
27
    {
28
        unset($_SERVER['HTTP_HOST']);
29
        return new Uri($uri);
30
    }
31
32
    /**
33
     * These tests are overridden.
34
     */
35
36
    public function testAuthority()
37
    {
38
        $uri = $this->createUri('/');
39
        $this->assertEquals('', $uri->getAuthority());
40
41
        $uri = $this->createUri('http://[email protected]:80/');
42
        $this->assertEquals('[email protected]', $uri->getAuthority());
43
44
        $uri = $this->createUri('http://[email protected]:81/');
45
        $this->assertEquals('[email protected]:81', $uri->getAuthority());
46
47
        $uri = $this->createUri('http://user:[email protected]/');
48
        $this->assertEquals('user:[email protected]', $uri->getAuthority());
49
    }
50
51
    public function testUriModification1()
52
    {
53
        $this->markTestSkipped('Garbage test');
54
    }
55
    public function testUriModification2()
56
    {
57
        $this->markTestSkipped('Garbage test');
58
    }
59
}