Failed Conditions
Pull Request — master (#90)
by
unknown
02:30
created

RuntimeReflectionServiceTest::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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests_PHP74\Persistence\Mapping;
6
7
use Doctrine\Common\Reflection\TypedNoDefaultReflectionProperty;
8
use Doctrine\Persistence\Mapping\RuntimeReflectionService;
9
use PHPUnit\Framework\TestCase;
10
use ReflectionProperty;
11
12
/**
13
 * @group DCOM-93
14
 */
15
class RuntimeReflectionServiceTest extends TestCase
16
{
17
    /** @var RuntimeReflectionService */
18
    private $reflectionService;
19
20
    /** @var mixed */
21
    private string $typedNoDefaultProperty;
0 ignored issues
show
introduced by
The private property $typedNoDefaultProperty is not used, and could be removed.
Loading history...
22
23
    /** @var mixed */
24
    private string $typedDefaultProperty = '';
0 ignored issues
show
introduced by
The private property $typedDefaultProperty is not used, and could be removed.
Loading history...
25
26
    protected function setUp() : void
27
    {
28
        $this->reflectionService = new RuntimeReflectionService();
29
    }
30
31
    public function testGetTypedNoDefaultReflectionProperty() : void
32
    {
33
        $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'typedNoDefaultProperty');
34
        self::assertInstanceOf(TypedNoDefaultReflectionProperty::class, $reflProp);
35
    }
36
37
    public function testGetTypedDefaultReflectionProperty() : void
38
    {
39
        $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'typedDefaultProperty');
40
        self::assertInstanceOf(ReflectionProperty::class, $reflProp);
41
        self::assertNotInstanceOf(TypedNoDefaultReflectionProperty::class, $reflProp);
42
    }
43
}
44