Completed
Push — master ( 9cf5c1...719e81 )
by Jaap
01:46
created

NullableTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNullableTypeWrapsCorrectly() 0 8 1
A testNullableStringifyCorrectly() 0 4 1
1
<?php
2
/**
3
 * This file is part of phpDocumentor.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright 2010-2017 Mike van Riel<[email protected]>
9
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link      http://phpdoc.org
11
 */
12
13
namespace phpDocumentor\Reflection\Types;
14
15
/**
16
 * @coversDefaultClass \phpDocumentor\Reflection\Types\Nullable
17
 */
18
class NullableTest extends \PHPUnit_Framework_TestCase
19
{
20
    /**
21
     * @covers ::__construct
22
     * @covers ::getActualType
23
     */
24
    public function testNullableTypeWrapsCorrectly()
25
    {
26
        $realType = new String_();
27
28
        $nullableString = new Nullable($realType);
29
30
        $this->assertSame($realType, $nullableString->getActualType());
31
    }
32
33
    /**
34
     * @covers ::__toString
35
     */
36
    public function testNullableStringifyCorrectly()
37
    {
38
        $this->assertSame('?string', (string)(new Nullable(new String_())));
39
    }
40
}
41