Code Duplication    Length = 16-17 lines in 4 locations

Tests/Sniffs/PHP/ForbiddenGlobalVariableVariableSniffTest.php 1 location

@@ 16-31 (lines=16) @@
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class ForbiddenGlobalVariableVariableSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * Verify that checking for a specific version works
20
     *
21
     * @return void
22
     */
23
    public function testGlobalVariableVariable()
24
    {
25
        $file = $this->sniffFile('sniff-examples/forbidden_global_variable_variable.php', '5.6');
26
        $this->assertNoViolation($file, 3);
27
        
28
        $file = $this->sniffFile('sniff-examples/forbidden_global_variable_variable.php', '7.0');
29
        $this->assertError($file, 3, "Global with variable variables are not allowed since PHP 7.0");
30
    }
31
}
32

Tests/Sniffs/PHP/ForbiddenFunctionParametersWithSameNameSniffTest.php 1 location

@@ 16-31 (lines=16) @@
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class ForbiddenForbiddenFunctionParametersWithSameNameSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * testSettingTestVersion
20
     *
21
     * @return void
22
     */
23
    public function testSettingTestVersion()
24
    {
25
        $file = $this->sniffFile('sniff-examples/forbidden_function_parameters_with_same_name.php', '5.6');
26
        $this->assertNoViolation($file, 3);
27
        
28
        $file = $this->sniffFile('sniff-examples/forbidden_function_parameters_with_same_name.php', '7.0');
29
        $this->assertError($file, 3, 'Functions can not have multiple parameters with the same name since PHP 7.0');
30
    }
31
}
32
33

Tests/Sniffs/PHP/DeprecatedPHP4StyleConstructorsSniffTest.php 1 location

@@ 15-30 (lines=16) @@
12
 * @package PHPCompatibility
13
 * @author Koen Eelen <[email protected]>
14
 */
15
class DeprecatedPHP4StyleConstructorsSniffTest extends BaseSniffTest
16
{
17
    /**
18
     * Test PHP4 style constructors
19
     *
20
     * @return void
21
     */
22
    public function testIsDeprecated()
23
    {
24
        $file = $this->sniffFile('sniff-examples/deprecated_php4style_constructors.php', '5.6');
25
        $this->assertNoViolation($file, 3);
26
27
        $file = $this->sniffFile('sniff-examples/deprecated_php4style_constructors.php', '7.0');
28
        $this->assertError($file, 3, 'Deprecated PHP4 style constructor are not supported since PHP7');
29
    }
30
}
31

Tests/Sniffs/PHP/NewFunctionParameterSniffTest.php 1 location

@@ 16-32 (lines=17) @@
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class NewFunctionParameterSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * Test dirname() depth parameter
20
     *
21
     * @return void
22
     */
23
    public function testDirnameDepth()
24
    {
25
        $file = $this->sniffFile('sniff-examples/new_function_parameter.php', '5.6');
26
        $this->assertError($file, 3, "The function dirname does not have a parameter depth in PHP version 5.6 or earlier");
27
28
        // Verify that sniff doesn't throw an error in version 5.2
29
        $file = $this->sniffFile('sniff-examples/new_function_parameter.php', '7.0');
30
        $this->assertNoViolation($file, 3);
31
    }
32
}
33