/
ResolveUriTest.php
37 lines (29 loc) · 1.06 KB
/
ResolveUriTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// Copyright (C) 2021 Ivan Stasiuk <brokeyourbike@gmail.com>.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
namespace BrokeYourBike\Tests\ResolveUri;
use PHPUnit\Framework\TestCase;
use BrokeYourBike\ResolveUri\ResolveUriTrait;
/**
* @author Ivan Stasiuk <brokeyourbike@gmail.com>
*/
class ResolveUriTest extends TestCase
{
/** @test */
public function it_uses_json_request_result_trait(): void
{
$usedTraits = class_uses(ApiClientFixture::class);
$this->assertArrayHasKey(ResolveUriTrait::class, $usedTraits);
}
/** @test */
public function it_can_resolve_uri_from_strings()
{
$apiClient = new ApiClientFixture();
$uri = $apiClient->resolveUriFor('https://example.com', 'hello-world');
$this->assertInstanceOf(\Psr\Http\Message\UriInterface::class, $uri);
$this->assertSame('https://example.com/hello-world', (string) $uri);
}
}