Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function testUseDeclaration() |
||
24 | { |
||
25 | if (version_compare(PHP_CodeSniffer::VERSION, '2.3.4') >= 0) { |
||
26 | $file = $this->sniffFile('sniff-examples/new_use_declarations.php', '5.5'); |
||
27 | $this->assertError($file, 4, "`use const` declarations are not allowed in PHP 5.5 or earlier"); |
||
28 | $this->assertError($file, 5, "`use const` declarations are not allowed in PHP 5.5 or earlier"); |
||
29 | |||
30 | $this->assertError($file, 7, "`use function` declarations are not allowed in PHP 5.5 or earlier"); |
||
31 | $this->assertError($file, 8, "`use function` declarations are not allowed in PHP 5.5 or earlier"); |
||
32 | |||
33 | $file = $this->sniffFile('sniff-examples/new_group_use_declarations.php', '5.6'); |
||
34 | $this->assertNoViolation($file, 4); |
||
35 | $this->assertNoViolation($file, 5); |
||
36 | $this->assertNoViolation($file, 7); |
||
37 | $this->assertNoViolation($file, 8); |
||
38 | } |
||
39 | } |
||
40 | } |