Completed
Push — master ( 90ae75...483516 )
by Jaap
13s
created

testDocblockWithAnnotationHavingZeroValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * This file is part of phpDocumentor.
5
 *
6
 *  For the full copyright and license information, please view the LICENSE
7
 *  file that was distributed with this source code.
8
 *
9
 *  @copyright 2010-2018 Mike van Riel<[email protected]>
10
 *  @license   http://www.opensource.org/licenses/mit-license.php MIT
11
 *  @link      http://phpdoc.org
12
 */
13
14
namespace phpDocumentor\Reflection;
15
16
use Mockery as m;
17
use PHPUnit\Framework\TestCase;
18
19
/**
20
 * @coversNothing
21
 */
22
final class DocblocksWithAnnotationsTest extends TestCase
23
{
24
    /**
25
     * Call Mockery::close after each test.
26
     */
27
    public function tearDown(): void
28
    {
29
        m::close();
30
    }
31
32
    public function testDocblockWithAnnotations(): void
33
    {
34
        $docComment = <<<DOCCOMMENT
35
            /**
36
     * @var \DateTime[]
37
     * @Groups({"a", "b"})
38
     * @ORM\Entity
39
     */
40
DOCCOMMENT;
41
42
        $factory = DocBlockFactory::createInstance();
43
        $docblock = $factory->create($docComment);
44
45
        $this->assertCount(3, $docblock->getTags());
46
    }
47
48
    public function testDocblockWithAnnotationHavingZeroValue(): void
49
    {
50
        $docComment = <<<DOCCOMMENT
51
            /**
52
     * @my-tag 0
53
     */
54
DOCCOMMENT;
55
56
        $factory = DocBlockFactory::createInstance();
57
        $docblock = $factory->create($docComment);
58
59
        $this->assertSame(0, printf('%i', $docblock->getTagsByName('my-tag')));
60
    }
61
}
62