Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class SimpleShortUrlRelationResolverTest extends TestCase |
||
12 | { |
||
13 | private SimpleShortUrlRelationResolver $resolver; |
||
14 | |||
15 | public function setUp(): void |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @test |
||
22 | * @dataProvider provideDomains |
||
23 | */ |
||
24 | public function resolvesExpectedDomain(?string $domain): void |
||
25 | { |
||
26 | $result = $this->resolver->resolveDomain($domain); |
||
27 | |||
28 | if ($domain === null) { |
||
29 | self::assertNull($result); |
||
30 | } else { |
||
31 | self::assertInstanceOf(Domain::class, $result); |
||
32 | self::assertEquals($domain, $result->getAuthority()); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | public function provideDomains(): iterable |
||
37 | { |
||
38 | yield 'empty domain' => [null]; |
||
39 | yield 'non-empty domain' => ['domain.com']; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @test |
||
44 | * @dataProvider provideKeys |
||
45 | */ |
||
46 | public function alwaysReturnsNullForApiKeys(?string $key): void |
||
47 | { |
||
48 | self::assertNull($this->resolver->resolveApiKey($key)); |
||
|
|||
49 | } |
||
50 | |||
51 | public function provideKeys(): iterable |
||
55 | } |
||
56 | } |
||
57 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.