forked from hhvm/hhast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIgnorePHPFilesTest.hack
40 lines (36 loc) · 1.13 KB
/
IgnorePHPFilesTest.hack
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
/*
* 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;
use type Facebook\HackTest\HackTest;
final class IgnorePHPFilesTest extends HackTest {
public async function testUnparsablePHPFileAsync(): Awaitable<void> {
$lint_run = new __Private\LintRun(
null,
new DoNotSendMeEventsHandler(),
vec[__DIR__.'/../test-data/unparsable_php_file.php'],
);
await $lint_run->runAsync();
}
}
final class DoNotSendMeEventsHandler implements __Private\LintRunEventHandler {
public function linterRaisedErrorsAsync(
BaseLinter $_linter,
__Private\LintRunConfig::TFileConfig $_config,
Traversable<LintError> $_errors,
): Awaitable<nothing> {
invariant_violation('You may not raise an error on a PHP file');
}
public async function finishedFileAsync(
string $_path,
__Private\LintRunResult $_result,
): Awaitable<void> {}
public async function finishedRunAsync(
__Private\LintRunResult $_result,
): Awaitable<void> {}
}