| @@ 43-53 (lines=11) @@ | ||
| 40 | * |
|
| 41 | * @return void |
|
| 42 | */ |
|
| 43 | public function testInsteadOf() |
|
| 44 | { |
|
| 45 | $file = $this->sniffFile(self::TEST_FILE, '5.3'); |
|
| 46 | $this->assertError($file, 15, "\"insteadof\" keyword (for traits) is not present in PHP version 5.3 or earlier"); |
|
| 47 | $this->assertError($file, 16, "\"insteadof\" keyword (for traits) is not present in PHP version 5.3 or earlier"); |
|
| 48 | ||
| 49 | ||
| 50 | $file = $this->sniffFile(self::TEST_FILE, '5.4'); |
|
| 51 | $this->assertNoViolation($file, 15); |
|
| 52 | $this->assertNoViolation($file, 16); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Test namespace keyword |
|
| @@ 176-185 (lines=10) @@ | ||
| 173 | * |
|
| 174 | * @return void |
|
| 175 | */ |
|
| 176 | public function testNowdoc() |
|
| 177 | { |
|
| 178 | $file = $this->sniffFile(self::TEST_FILE, '5.2'); |
|
| 179 | $this->assertError($file, 37, "nowdoc functionality is not present in PHP version 5.2 or earlier"); |
|
| 180 | $this->assertError($file, 41, "nowdoc functionality is not present in PHP version 5.2 or earlier"); |
|
| 181 | ||
| 182 | $file = $this->sniffFile(self::TEST_FILE, '5.3'); |
|
| 183 | $this->assertNoViolation($file, 37); |
|
| 184 | $this->assertNoViolation($file, 41); |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * testConst |
|
| @@ 194-203 (lines=10) @@ | ||
| 191 | * |
|
| 192 | * @return void |
|
| 193 | */ |
|
| 194 | public function testConst() |
|
| 195 | { |
|
| 196 | $file = $this->sniffFile(self::TEST_FILE, '5.2'); |
|
| 197 | $this->assertError($file, 43, "\"const\" keyword is not present in PHP version 5.2 or earlier"); |
|
| 198 | $this->assertNoViolation($file, 46); |
|
| 199 | $this->assertNoViolation($file, 47); |
|
| 200 | ||
| 201 | $file = $this->sniffFile(self::TEST_FILE, '5.3'); |
|
| 202 | $this->assertNoViolation($file, 43); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * testCallable |
|
| @@ 93-102 (lines=10) @@ | ||
| 90 | * |
|
| 91 | * @return void |
|
| 92 | */ |
|
| 93 | public function testCoalescing() |
|
| 94 | { |
|
| 95 | $file = $this->sniffFile(self::TEST_FILE, '5.6'); |
|
| 96 | $this->assertError($file, 8, "null coalescing operator (??) is not present in PHP version 5.6 or earlier"); |
|
| 97 | $this->assertError($file, 10, "null coalescing operator (??) is not present in PHP version 5.6 or earlier"); |
|
| 98 | ||
| 99 | $file = $this->sniffFile(self::TEST_FILE, '7.0'); |
|
| 100 | $this->assertNoViolation($file, 8); |
|
| 101 | $this->assertNoViolation($file, 10); |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * Variadic functions using ... |
|