@@ -52,81 +52,81 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
52
52
);
53
53
}
54
54
55
- public function testMappableDirectly (): void {
55
+ public async function testMappableDirectly (): Awaitable < void > {
56
56
$code =
57
57
" <?hh\n " .
58
58
" final class MyController\n " .
59
59
" implements Facebook\HackRouter\IncludeInUriMap {}" ;
60
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
60
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
61
61
$class = $scanned -> getClass(' MyController' );
62
62
$facts = $this -> getFacts($scanned );
63
63
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
64
64
}
65
65
66
- public function testMappableDirectlyFromNamespace (): void {
66
+ public async function testMappableDirectlyFromNamespace (): Awaitable < void > {
67
67
$code =
68
68
" <?hh\n " .
69
69
" namespace MySite;\n " .
70
70
" final class MyController\n " .
71
71
" implements \Facebook\HackRouter\IncludeInUriMap {}" ;
72
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
72
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
73
73
$class = $scanned -> getClass(' MySite\MyController' );
74
74
$facts = $this -> getFacts($scanned );
75
75
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
76
76
}
77
77
78
- public function testMappableDirectlyWithPrecedingBackSlash (): void {
78
+ public async function testMappableDirectlyWithPrecedingBackSlash (): Awaitable < void > {
79
79
$code =
80
80
" <?hh\n " .
81
81
" final class MyController\n " .
82
82
" implements \Facebook\HackRouter\IncludeInUriMap {}" ;
83
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
83
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
84
84
$class = $scanned -> getClass(' MyController' );
85
85
$facts = $this -> getFacts($scanned );
86
86
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
87
87
}
88
88
89
- public function testMappableDirectlyWithUsedInterface (): void {
89
+ public async function testMappableDirectlyWithUsedInterface (): Awaitable < void > {
90
90
$code =
91
91
" <?hh\n " .
92
92
" use \Facebook\HackRouter\IncludeInUriMap;\n " .
93
93
" final class MyController implements IncludeInUriMap {}" ;
94
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
94
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
95
95
$class = $scanned -> getClass(' MyController' );
96
96
$facts = $this -> getFacts($scanned );
97
97
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
98
98
}
99
99
100
- public function testAbstractIsNotMappable (): void {
100
+ public async function testAbstractIsNotMappable (): Awaitable < void > {
101
101
$code =
102
102
" <?hh\n " .
103
103
" abstract class MyController\n " .
104
104
" implements Facebook\HackRouter\IncludeInUriMap {}" ;
105
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
105
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
106
106
$class = $scanned -> getClass(' MyController' );
107
107
$facts = $this -> getFacts($scanned );
108
108
expect ($this -> isMappable($facts , $class ))-> toBeFalse();
109
109
}
110
110
111
- public function testNoNonFinalNonAbstract (): void {
112
- expect (() ==> {
111
+ public async function testNoNonFinalNonAbstract (): Awaitable < void > {
112
+ expect (async () ==> {
113
113
$code = " <?hh\n " .
114
114
" class MyController\n " .
115
115
" implements Facebook\HackRouter\IncludeInUriMap {}" ;
116
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
116
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
117
117
$class = $scanned -> getClass(' MyController' );
118
118
$facts = $this -> getFacts($scanned );
119
119
$_throws = $this -> isMappable($facts , $class );
120
120
})-> toThrow(InvariantException :: class );
121
121
}
122
122
123
- public function testMappableByParentClass (): void {
123
+ public async function testMappableByParentClass (): Awaitable < void > {
124
124
$code =
125
125
" <?hh\n " .
126
126
" abstract class BaseController\n " .
127
127
" implements Facebook\HackRouter\IncludeInUriMap {}\n " .
128
128
" final class MyController extends BaseController {}" ;
129
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
129
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
130
130
$base = $scanned -> getClass(' BaseController' );
131
131
$final = $scanned -> getClass(' MyController' );
132
132
@@ -135,14 +135,14 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
135
135
expect ($this -> isMappable($facts , $base ))-> toBeFalse();
136
136
}
137
137
138
- public function testMappableByParentClassInNamespace (): void {
138
+ public async function testMappableByParentClassInNamespace (): Awaitable < void > {
139
139
$code =
140
140
" <?hh\n " .
141
141
" namespace Foo\Bar;\n " .
142
142
" abstract class BaseController\n " .
143
143
" implements \Facebook\HackRouter\IncludeInUriMap {}\n " .
144
144
" final class MyController extends BaseController {}" ;
145
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
145
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
146
146
$base = $scanned -> getClass(' Foo\\ Bar\\ BaseController' );
147
147
$final = $scanned -> getClass(' Foo\\ Bar\\ MyController' );
148
148
@@ -151,42 +151,42 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
151
151
expect ($this -> isMappable($facts , $base ))-> toBeFalse();
152
152
}
153
153
154
- public function testMappableByDerivedInterface (): void {
154
+ public async function testMappableByDerivedInterface (): Awaitable < void > {
155
155
$code =
156
156
" <?hh\n " .
157
157
" interface IController\n " .
158
158
" extends Facebook\HackRouter\IncludeInUriMap {}\n " .
159
159
" final class MyController implements IController {}" ;
160
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
160
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
161
161
$class = $scanned -> getClass(' MyController' );
162
162
163
163
$facts = $this -> getFacts($scanned );
164
164
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
165
165
}
166
166
167
- public function testMappableByTrait (): void {
167
+ public async function testMappableByTrait (): Awaitable < void > {
168
168
$code =
169
169
" <?hh\n " .
170
170
" trait TController\n " .
171
171
" implements Facebook\HackRouter\IncludeInUriMap {}\n " .
172
172
" final class MyController {\n " .
173
173
" use TController;\n " .
174
174
" }" ;
175
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
175
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
176
176
$class = $scanned -> getClass(' MyController' );
177
177
178
178
$facts = $this -> getFacts($scanned );
179
179
expect ($this -> isMappable($facts , $class ))-> toBeTrue();
180
180
}
181
181
182
- public function testGetController (): void {
182
+ public async function testGetController (): Awaitable < void > {
183
183
$code =
184
184
" <?hh\n " .
185
185
" final class MyController implements\n " .
186
186
" \Facebook\HackRouter\IncludeInUriMap,\n " .
187
187
" \Facebook\HackRouter\SupportsGetRequests {\n " .
188
188
" }" ;
189
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
189
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
190
190
$class = $scanned -> getClass(' MyController' );
191
191
192
192
$facts = $this -> getFacts($scanned );
@@ -195,14 +195,14 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
195
195
);
196
196
}
197
197
198
- public function testPostController (): void {
198
+ public async function testPostController (): Awaitable < void > {
199
199
$code =
200
200
" <?hh\n " .
201
201
" final class MyController implements\n " .
202
202
" \Facebook\HackRouter\IncludeInUriMap,\n " .
203
203
" \Facebook\HackRouter\SupportsPostRequests {\n " .
204
204
" }" ;
205
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
205
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
206
206
$class = $scanned -> getClass(' MyController' );
207
207
208
208
$facts = $this -> getFacts($scanned );
@@ -211,28 +211,28 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
211
211
);
212
212
}
213
213
214
- public function testGetAndPostController (): void {
215
- expect (() ==> {
214
+ public async function testGetAndPostController (): Awaitable < void > {
215
+ expect (async () ==> {
216
216
$code = " <?hh\n " .
217
217
" final class MyController implements\n " .
218
218
" \Facebook\HackRouter\IncludeInUriMap,\n " .
219
219
" \Facebook\HackRouter\SupportsGetRequests,\n " .
220
220
" \Facebook\HackRouter\SupportsPostRequests {\n " .
221
221
" }" ;
222
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
222
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
223
223
$class = $scanned -> getClass(' MyController' );
224
224
$facts = $this -> getFacts($scanned );
225
225
$_throws = $this -> getMethods($facts , $class );
226
226
})-> toThrow(InvariantException :: class );
227
227
}
228
228
229
- public function testControllerWithNoSupportedMethods (): void {
230
- expect (() ==> {
229
+ public async function testControllerWithNoSupportedMethods (): Awaitable < void > {
230
+ expect (async () ==> {
231
231
$code = " <?hh\n " .
232
232
" final class MyController implements\n " .
233
233
" \Facebook\HackRouter\IncludeInUriMap {\n " .
234
234
" }" ;
235
- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
235
+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
236
236
$class = $scanned -> getClass(' MyController' );
237
237
$facts = $this -> getFacts($scanned );
238
238
$_throws = $this -> getMethods($facts , $class );
0 commit comments