Passed
Push — feature/allow-using-interface-... ( 231f23 )
by Chema
04:54
created

DocBlockResolverCustomServicesAwareTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
c 0
b 0
f 0
dl 0
loc 29
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A test_existing_service() 0 6 1
A test_non_existing_service() 0 6 1
A setUp() 0 3 1
A test_service_as_interface() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Integration\Framework\DocBlockResolverAware;
6
7
use Gacela\Framework\Gacela;
8
use PHPUnit\Framework\TestCase;
9
10
final class DocBlockResolverCustomServicesAwareTest extends TestCase
11
{
12
    protected function setUp(): void
13
    {
14
        Gacela::bootstrap(__DIR__);
15
    }
16
17
    public function test_existing_service(): void
18
    {
19
        $dummy = new DummyDocBlockResolverAware();
20
        $actual = $dummy->getRepository()->findName();
21
22
        self::assertSame('name', $actual);
23
    }
24
25
    public function test_service_as_interface(): void
26
    {
27
        $dummy = new DummyDocBlockResolverAware();
28
        $actual = $dummy->getService()->getName();
29
30
        self::assertSame('fake-service.name', $actual);
31
    }
32
33
    public function test_non_existing_service(): void
34
    {
35
        $this->expectExceptionMessage('Missing the concrete return type for the method `getRepository()`');
36
37
        $dummy = new BadDummyDocBlockResolverAware();
38
        $dummy->getRepository();
39
    }
40
}
41