IssueTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
c 0
b 0
f 0
dl 0
loc 50
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 10 1
A tearDown() 0 3 1
A testInstantiation() 0 8 1
1
<?php
2
3
/**
4
 * Test case
5
 *
6
 * Copyright (c) 2007-2010, Mayflower GmbH
7
 * All rights reserved.
8
 *
9
 * Redistribution and use in source and binary forms, with or without
10
 * modification, are permitted provided that the following conditions
11
 * are met:
12
 *
13
 *   * Redistributions of source code must retain the above copyright
14
 *     notice, this list of conditions and the following disclaimer.
15
 *
16
 *   * Redistributions in binary form must reproduce the above copyright
17
 *     notice, this list of conditions and the following disclaimer in
18
 *     the documentation and/or other materials provided with the
19
 *     distribution.
20
 *
21
 *   * Neither the name of Mayflower GmbH nor the names of his
22
 *     contributors may be used to endorse or promote products derived
23
 *     from this software without specific prior written permission.
24
 *
25
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
 * POSSIBILITY OF SUCH DAMAGE.
37
 *
38
 * @category PHP_CodeBrowser
39
 *
40
 * @author Simon Kohlmeyer <[email protected]
41
 *
42
 * @copyright 2007-2010 Mayflower GmbH
43
 *
44
 * @license http://www.opensource.org/licenses/bsd-license.php  BSD License
45
 *
46
 * @version SVN: $Id$
47
 *
48
 * @link http://www.phpunit.de/
49
 *
50
 * @since File available since  0.1.0
51
 */
52
53
namespace PHPCodeBrowser\Tests;
54
55
use PHPCodeBrowser\Issue;
56
57
/**
58
 * IssueTest
59
 *
60
 * @category PHP_CodeBrowser
61
 *
62
 * @author Simon Kohlmeyer <[email protected]>
63
 *
64
 * @copyright 2007-2010 Mayflower GmbH
65
 *
66
 * @license http://www.opensource.org/licenses/bsd-license.php  BSD License
67
 *
68
 * @version Release: @package_version@
69
 *
70
 * @link http://www.phpunit.de/
71
 *
72
 * @since Class available since  0.1.0
73
 */
74
class IssueTest extends AbstractTestCase
75
{
76
    /**
77
     * Issue object to test
78
     *
79
     * @var Issue
80
     */
81
    protected $issue;
82
83
    /**
84
     * (non-PHPDoc)
85
     *
86
     * @see tests/cbAbstractTests#setUp()
87
     */
88
    protected function setUp(): void
89
    {
90
        parent::setUp();
91
        $this->issue = new Issue(
92
            'testFileName',
93
            23,
94
            27,
95
            'testFinder',
96
            'testDescription',
97
            'notice'
98
        );
99
    }
100
101
    /**
102
     * (non-PHPDoc)
103
     *
104
     * @see tests/cbAbstractTests#tearDown()
105
     */
106
    protected function tearDown(): void
107
    {
108
        parent::tearDown();
109
    }
110
111
    /**
112
     * Test constructor if variables are stored properly
113
     *
114
     * @return void
115
     */
116
    public function testInstantiation(): void
117
    {
118
        static::assertSame('testFileName', $this->issue->getFileName());
119
        static::assertSame(23, $this->issue->getLineStart());
120
        static::assertSame(27, $this->issue->getLineEnd());
121
        static::assertSame('testFinder', $this->issue->getFoundBy());
122
        static::assertSame('testDescription', $this->issue->getDescription());
123
        static::assertSame('notice', $this->issue->getSeverity());
124
    }
125
}
126