forked from hhvm/hhast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoFinalMethodInFinalClassLinterTest.hack
More file actions
47 lines (40 loc) · 1.01 KB
/
Copy pathNoFinalMethodInFinalClassLinterTest.hack
File metadata and controls
47 lines (40 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
namespace Facebook\HHAST;
final class NoFinalMethodInFinalClassLinterTest extends TestCase {
use AutoFixingLinterTestTrait<ASTLintError>;
<<__Override>>
protected function getLinter(string $file): NoFinalMethodInFinalClassLinter {
return NoFinalMethodInFinalClassLinter::fromPath($file);
}
<<__Override>>
public function getCleanExamples(): vec<(string)> {
return vec[
tuple(<<<FINAL_CLASS_NO_FINAL_METHOD
<?hh // strict
final class Herp {
public function derp(): void { }
}
FINAL_CLASS_NO_FINAL_METHOD
),
tuple(<<<NON_FINAL_CLASS_FINAL_METHOD
<?hh // strict
class Herp {
final public function derp(): void { }
}
NON_FINAL_CLASS_FINAL_METHOD
),
tuple(<<<FINAL_CLASS_NO_METHODS
<?hh // strict
final class Herp { }
FINAL_CLASS_NO_METHODS
),
];
}
}