Code Duplication    Length = 10-11 lines in 4 locations

Tests/Sniffs/PHP/NewKeywordsSniffTest.php 3 locations

@@ 43-53 (lines=11) @@
40
     *
41
     * @return void
42
     */
43
    public function testInsteadOf()
44
    {
45
        $file = $this->sniffFile(self::TEST_FILE, '5.3');
46
        $this->assertError($file, 15, "\"insteadof\" keyword (for traits) is not present in PHP version 5.3 or earlier");
47
        $this->assertError($file, 16, "\"insteadof\" keyword (for traits) is not present in PHP version 5.3 or earlier");
48
49
50
        $file = $this->sniffFile(self::TEST_FILE, '5.4');
51
        $this->assertNoViolation($file, 15);
52
        $this->assertNoViolation($file, 16);
53
    }
54
55
    /**
56
     * Test namespace keyword
@@ 174-183 (lines=10) @@
171
     *
172
     * @return void
173
     */
174
    public function testNowdoc()
175
    {
176
        $file = $this->sniffFile(self::TEST_FILE, '5.2');
177
        $this->assertError($file, 37, "nowdoc functionality is not present in PHP version 5.2 or earlier");
178
        $this->assertError($file, 41, "nowdoc functionality is not present in PHP version 5.2 or earlier");
179
180
        $file = $this->sniffFile(self::TEST_FILE, '5.3');
181
        $this->assertNoViolation($file, 37);
182
        $this->assertNoViolation($file, 41);
183
    }
184
185
    /**
186
     * testConst
@@ 192-201 (lines=10) @@
189
     *
190
     * @return void
191
     */
192
    public function testConst()
193
    {
194
        $file = $this->sniffFile(self::TEST_FILE, '5.2');
195
        $this->assertError($file, 43, "\"const\" keyword is not present in PHP version 5.2 or earlier");
196
        $this->assertNoViolation($file, 46);
197
        $this->assertNoViolation($file, 47);
198
199
        $file = $this->sniffFile(self::TEST_FILE, '5.3');
200
        $this->assertNoViolation($file, 43);
201
    }
202
203
    /**
204
     * testCallable

Tests/Sniffs/PHP/NewLanguageConstructsSniffTest.php 1 location

@@ 93-102 (lines=10) @@
90
     *
91
     * @return void
92
     */
93
    public function testCoalescing()
94
    {
95
        $file = $this->sniffFile(self::TEST_FILE, '5.6');
96
        $this->assertError($file, 8, "null coalescing operator (??) is not present in PHP version 5.6 or earlier");
97
        $this->assertError($file, 10, "null coalescing operator (??) is not present in PHP version 5.6 or earlier");
98
99
        $file = $this->sniffFile(self::TEST_FILE, '7.0');
100
        $this->assertNoViolation($file, 8);
101
        $this->assertNoViolation($file, 10);
102
    }
103
104
    /**
105
     * Variadic functions using ...