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

StaticResolverTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 9
c 1
b 1
f 0
dl 0
loc 20
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGuzzleResolveWithPrefix() 0 8 1
A testGuzzleResolve() 0 8 1
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