UrlTest::testAddParamsToUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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