Completed
Push — php70 ( 83abde...b6aa8a )
by Wim
05:28 queued 02:49
created

ForbiddenNegativeBitshiftSniffTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSettingTestVersion() 0 10 1
1
<?php
2
/**
3
 * Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0
4
 *
5
 * @package PHPCompatibility
6
 */
7
8
9
/**
10
 * Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0
11
 *
12
 * @uses BaseSniffTest
13
 * @package PHPCompatibility
14
 * @author Wim Godden <[email protected]>
15
 */
16
class ForbiddenNegativeBitshiftSniffTest extends BaseSniffTest
17
{
18
    /**
19
     * testSettingTestVersion
20
     *
21
     * @return void
22
     */
23
    public function testSettingTestVersion()
24
    {
25
        $file = $this->sniffFile('sniff-examples/forbidden_negative_bitshift.php', '5.6');
26
        $this->assertNoViolation($file, 3);
27
        $this->assertNoViolation($file, 5);
28
        
29
        $file = $this->sniffFile('sniff-examples/forbidden_negative_bitshift.php', '7.0');
30
        $this->assertError($file, 3, 'Bitwise shifts by negative number will throw an ArithmeticError in PHP 7.0');
31
        $this->assertNoViolation($file, 5);
32
    }
33
}
34
35