Completed
Push — master ( 28517b...4142e2 )
by Mike
13s queued 11s
created

ClassStringTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testClassStringStringifyCorrectly() 0 4 1
A provideClassStrings() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @link      http://phpdoc.org
12
 */
13
14
namespace phpDocumentor\Reflection\Types;
15
16
use phpDocumentor\Reflection\Fqsen;
17
use PHPUnit\Framework\TestCase;
18
19
/**
20
 * @coversDefaultClass \phpDocumentor\Reflection\Types\ClassString
21
 */
22
class ClassStringTest extends TestCase
23
{
24
    /**
25
     * @dataProvider provideClassStrings
26
     * @covers ::__toString
27
     */
28
    public function testClassStringStringifyCorrectly(ClassString $array, string $expectedString) : void
29
    {
30
        $this->assertSame($expectedString, (string) $array);
31
    }
32
33
    /**
34
     * @return mixed[]
35
     */
36
    public function provideClassStrings() : array
37
    {
38
        return [
39
            'generic clss string' => [new ClassString(), 'class-string'],
40
            'typed class string' => [new ClassString(new Fqsen('\Foo\Bar')), 'class-string<\Foo\Bar>'],
41
        ];
42
    }
43
}
44