Passed
Push — master ( 1dce98...7ec404 )
by Kirill
08:02
created

StaticResolverTest::testGuzzleResolveWithPrefix()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 4
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Tests\Distribution\Resolver;
6
7
use Spiral\Distribution\Resolver\StaticResolver;
8
use Spiral\Tests\Distribution\TestCase;
9
10
class StaticResolverTest extends TestCase
11
{
12
    public function testGuzzleResolve(): void
13
    {
14
        $resolver = StaticResolver::create('http://localhost');
15
16
        $uri = $resolver->resolve('file.jpg');
17
18
        self::assertSame('http://localhost/file.jpg', (string)$uri);
19
        self::assertNull(error_get_last());
20
    }
21
22
    public function testGuzzleResolveWithPrefix(): void
23
    {
24
        $resolver = StaticResolver::create('http://localhost/upload/');
25
26
        $uri = $resolver->resolve('file.jpg');
27
28
        self::assertSame('http://localhost/upload/file.jpg', (string)$uri);
29
        self::assertNull(error_get_last());
30
    }
31
}
32