Passed
Push — feature/custom-services-v2 ( f3d61c...0bc47e )
by Chema
03:49
created

DocBlockParserTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Unit\Framework\ClassResolver\CustomService;
6
7
use Gacela\Framework\ClassResolver\CustomService\DocBlockParser;
8
use PHPUnit\Framework\TestCase;
9
10
final class DocBlockParserTest extends TestCase
11
{
12
    private DocBlockParser $parser;
13
14
    protected function setUp(): void
15
    {
16
        $this->parser = new DocBlockParser();
17
    }
18
19
    public function test_get_class_from_empty_doc_block(): void
20
    {
21
        $input = '';
22
        self::assertSame('', $this->parser->getClassFromMethod($input, 'getClass()'));
23
    }
24
25
    public function test_get_class_from_method(): void
26
    {
27
        $input = <<<TXT
28
/**
29
 * @method \App\Module\ClassName getClass()
30
 */
31
TXT;
32
        self::assertSame(
33
            '\App\Module\ClassName',
34
            $this->parser->getClassFromMethod($input, 'getClass()')
35
        );
36
    }
37
}
38