Code Duplication    Length = 18-18 lines in 2 locations

Tests/Sniffs/PHP/NewAnonymouseClassesSniffTest.php 1 location

@@ 16-33 (lines=18) @@
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class NewAnonymousClassesSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * Test anonymous classes
20
     *
21
     * @return void
22
     */
23
    public function testAnonymousClasses()
24
    {
25
        if (version_compare(PHP_CodeSniffer::VERSION, '2.3.4') >= 0) {
26
            $file = $this->sniffFile('sniff-examples/new_anonymous_classes.php', '5.6');
27
            $this->assertError($file, 4, "Anonymous classes are not supported in PHP 5.6 or earlier");
28
    
29
            $file = $this->sniffFile('sniff-examples/new_anonymous_classes.php', '7.0');
30
            $this->assertNoViolation($file, 4);
31
        }
32
    }
33
}
34

Tests/Sniffs/PHP/NewScalarReturnTypeDeclarationsSniffTest.php 1 location

@@ 16-33 (lines=18) @@
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class NewScalarReturnTypeDeclarationsSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * testSettingTestVersion
20
     *
21
     * @return void
22
     */
23
    public function testSettingTestVersion()
24
    {
25
        if (version_compare(PHP_CodeSniffer::VERSION, '2.3.4') >= 0) {
26
            $file = $this->sniffFile('sniff-examples/new_scalar_return_type_declarations.php', '7.0');
27
            $this->assertNoViolation($file, 3);
28
            $this->assertNoViolation($file, 5);
29
            $this->assertNoViolation($file, 7);
30
            $this->assertNoViolation($file, 9);
31
        }
32
    }
33
}
34
35