ValueHolderPropertyTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createProperty() 0 4 1
A testWillDocumentPropertyType() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManagerTest\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator;
6
7
use Laminas\Code\Generator\PropertyGenerator;
8
use ProxyManager\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator\ValueHolderProperty;
9
use ProxyManagerTest\ProxyGenerator\PropertyGenerator\AbstractUniquePropertyNameTest;
10
use ReflectionClass;
11
12
/**
13
 * Tests for {@see \ProxyManager\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator\ValueHolderProperty}
14
 *
15
 * @covers \ProxyManager\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator\ValueHolderProperty
16
 * @group Coverage
17
 */
18
final class ValueHolderPropertyTest extends AbstractUniquePropertyNameTest
19
{
20
    /**
21
     * {@inheritDoc}
22
     */
23
    protected function createProperty() : PropertyGenerator
24
    {
25
        return new ValueHolderProperty(new ReflectionClass(self::class));
26
    }
27
28
    /** @group #400 */
29
    public function testWillDocumentPropertyType() : void
30
    {
31
        $docBlock = (new ValueHolderProperty(new ReflectionClass(self::class)))->getDocBlock();
32
33
        self::assertNotNull($docBlock);
0 ignored issues
show
Bug introduced by
The method assertNotNull() does not seem to exist on object<ProxyManagerTest\...alueHolderPropertyTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
        self::assertEquals(
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<ProxyManagerTest\...alueHolderPropertyTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
            <<<'PHPDOC'
36
/**
37
 * @var \ProxyManagerTest\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator\ValueHolderPropertyTest|null wrapped object, if the proxy is initialized
38
 */
39
40
PHPDOC
41
            ,
42
            $docBlock->generate()
43
        );
44
    }
45
}
46