UrlTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAddParamsToUrl() 0 8 1
A testSlashPrefix() 0 5 1
1
<?php
2
3
namespace Postpay\Tests\Http;
4
5
use PHPUnit\Framework\TestCase;
6
use Postpay\Http\Url;
7
8
class UrlTest extends TestCase
9
{
10
    public function testAddParamsToUrl()
11
    {
12
        $params = ['test' => true];
13
        $url = Url::addParamsToUrl('/', $params);
14
        parse_str(parse_url($url, PHP_URL_QUERY), $result);
15
16
        self::assertEquals($params, $result);
17
    }
18
19
    public function testSlashPrefix()
20
    {
21
        $path = Url::slashPrefix('');
22
        self::assertSame($path, '/');
23
    }
24
}
25