| @@ 145-154 (lines=10) @@ | ||
| 142 | * |
|
| 143 | * @return void |
|
| 144 | */ |
|
| 145 | public function testTypeDeclaration($line, $testNoViolation = false) |
|
| 146 | { |
|
| 147 | $file = $this->sniffFile(self::TEST_FILE, '4.4'); |
|
| 148 | $this->assertError($file, $line, 'Type hints were not present in PHP 4.4 or earlier'); |
|
| 149 | ||
| 150 | if ($testNoViolation === true) { |
|
| 151 | $file = $this->sniffFile(self::TEST_FILE, '5.0'); |
|
| 152 | $this->assertNoViolation($file, $line); |
|
| 153 | } |
|
| 154 | } |
|
| 155 | ||
| 156 | /** |
|
| 157 | * Data provider. |
|
| @@ 56-67 (lines=12) @@ | ||
| 53 | * |
|
| 54 | * @return void |
|
| 55 | */ |
|
| 56 | public function testBinaryInteger($line, $binary, $testNoViolation = true) |
|
| 57 | { |
|
| 58 | ||
| 59 | $file = $this->sniffFile(self::TEST_FILE, '5.3'); |
|
| 60 | $this->assertError($file, $line, 'Binary integer literals were not present in PHP version 5.3 or earlier. Found: ' . $binary); |
|
| 61 | ||
| 62 | ||
| 63 | if ($testNoViolation === true) { |
|
| 64 | $file = $this->sniffFile(self::TEST_FILE, '5.4'); |
|
| 65 | $this->assertNoViolation($file, $line); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * dataBinaryInteger |
|