@@ -52,81 +52,81 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
5252 );
5353 }
5454
55- public function testMappableDirectly (): void {
55+ public async function testMappableDirectly (): Awaitable < void > {
5656 $code =
5757 " <?hh\n " .
5858 " final class MyController\n " .
5959 " implements Facebook\HackRouter\IncludeInUriMap {}" ;
60- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
60+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
6161 $class = $scanned -> getClass(' MyController' );
6262 $facts = $this -> getFacts($scanned );
6363 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
6464 }
6565
66- public function testMappableDirectlyFromNamespace (): void {
66+ public async function testMappableDirectlyFromNamespace (): Awaitable < void > {
6767 $code =
6868 " <?hh\n " .
6969 " namespace MySite;\n " .
7070 " final class MyController\n " .
7171 " implements \Facebook\HackRouter\IncludeInUriMap {}" ;
72- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
72+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
7373 $class = $scanned -> getClass(' MySite\MyController' );
7474 $facts = $this -> getFacts($scanned );
7575 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
7676 }
7777
78- public function testMappableDirectlyWithPrecedingBackSlash (): void {
78+ public async function testMappableDirectlyWithPrecedingBackSlash (): Awaitable < void > {
7979 $code =
8080 " <?hh\n " .
8181 " final class MyController\n " .
8282 " implements \Facebook\HackRouter\IncludeInUriMap {}" ;
83- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
83+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
8484 $class = $scanned -> getClass(' MyController' );
8585 $facts = $this -> getFacts($scanned );
8686 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
8787 }
8888
89- public function testMappableDirectlyWithUsedInterface (): void {
89+ public async function testMappableDirectlyWithUsedInterface (): Awaitable < void > {
9090 $code =
9191 " <?hh\n " .
9292 " use \Facebook\HackRouter\IncludeInUriMap;\n " .
9393 " final class MyController implements IncludeInUriMap {}" ;
94- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
94+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
9595 $class = $scanned -> getClass(' MyController' );
9696 $facts = $this -> getFacts($scanned );
9797 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
9898 }
9999
100- public function testAbstractIsNotMappable (): void {
100+ public async function testAbstractIsNotMappable (): Awaitable < void > {
101101 $code =
102102 " <?hh\n " .
103103 " abstract class MyController\n " .
104104 " implements Facebook\HackRouter\IncludeInUriMap {}" ;
105- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
105+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
106106 $class = $scanned -> getClass(' MyController' );
107107 $facts = $this -> getFacts($scanned );
108108 expect ($this -> isMappable($facts , $class ))-> toBeFalse();
109109 }
110110
111- public function testNoNonFinalNonAbstract (): void {
112- expect (() ==> {
111+ public async function testNoNonFinalNonAbstract (): Awaitable < void > {
112+ expect (async () ==> {
113113 $code = " <?hh\n " .
114114 " class MyController\n " .
115115 " implements Facebook\HackRouter\IncludeInUriMap {}" ;
116- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
116+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
117117 $class = $scanned -> getClass(' MyController' );
118118 $facts = $this -> getFacts($scanned );
119119 $_throws = $this -> isMappable($facts , $class );
120120 })-> toThrow(InvariantException :: class );
121121 }
122122
123- public function testMappableByParentClass (): void {
123+ public async function testMappableByParentClass (): Awaitable < void > {
124124 $code =
125125 " <?hh\n " .
126126 " abstract class BaseController\n " .
127127 " implements Facebook\HackRouter\IncludeInUriMap {}\n " .
128128 " final class MyController extends BaseController {}" ;
129- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
129+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
130130 $base = $scanned -> getClass(' BaseController' );
131131 $final = $scanned -> getClass(' MyController' );
132132
@@ -135,14 +135,14 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
135135 expect ($this -> isMappable($facts , $base ))-> toBeFalse();
136136 }
137137
138- public function testMappableByParentClassInNamespace (): void {
138+ public async function testMappableByParentClassInNamespace (): Awaitable < void > {
139139 $code =
140140 " <?hh\n " .
141141 " namespace Foo\Bar;\n " .
142142 " abstract class BaseController\n " .
143143 " implements \Facebook\HackRouter\IncludeInUriMap {}\n " .
144144 " final class MyController extends BaseController {}" ;
145- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
145+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
146146 $base = $scanned -> getClass(' Foo\\ Bar\\ BaseController' );
147147 $final = $scanned -> getClass(' Foo\\ Bar\\ MyController' );
148148
@@ -151,42 +151,42 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
151151 expect ($this -> isMappable($facts , $base ))-> toBeFalse();
152152 }
153153
154- public function testMappableByDerivedInterface (): void {
154+ public async function testMappableByDerivedInterface (): Awaitable < void > {
155155 $code =
156156 " <?hh\n " .
157157 " interface IController\n " .
158158 " extends Facebook\HackRouter\IncludeInUriMap {}\n " .
159159 " final class MyController implements IController {}" ;
160- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
160+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
161161 $class = $scanned -> getClass(' MyController' );
162162
163163 $facts = $this -> getFacts($scanned );
164164 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
165165 }
166166
167- public function testMappableByTrait (): void {
167+ public async function testMappableByTrait (): Awaitable < void > {
168168 $code =
169169 " <?hh\n " .
170170 " trait TController\n " .
171171 " implements Facebook\HackRouter\IncludeInUriMap {}\n " .
172172 " final class MyController {\n " .
173173 " use TController;\n " .
174174 " }" ;
175- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
175+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
176176 $class = $scanned -> getClass(' MyController' );
177177
178178 $facts = $this -> getFacts($scanned );
179179 expect ($this -> isMappable($facts , $class ))-> toBeTrue();
180180 }
181181
182- public function testGetController (): void {
182+ public async function testGetController (): Awaitable < void > {
183183 $code =
184184 " <?hh\n " .
185185 " final class MyController implements\n " .
186186 " \Facebook\HackRouter\IncludeInUriMap,\n " .
187187 " \Facebook\HackRouter\SupportsGetRequests {\n " .
188188 " }" ;
189- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
189+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
190190 $class = $scanned -> getClass(' MyController' );
191191
192192 $facts = $this -> getFacts($scanned );
@@ -195,14 +195,14 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
195195 );
196196 }
197197
198- public function testPostController (): void {
198+ public async function testPostController (): Awaitable < void > {
199199 $code =
200200 " <?hh\n " .
201201 " final class MyController implements\n " .
202202 " \Facebook\HackRouter\IncludeInUriMap,\n " .
203203 " \Facebook\HackRouter\SupportsPostRequests {\n " .
204204 " }" ;
205- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
205+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
206206 $class = $scanned -> getClass(' MyController' );
207207
208208 $facts = $this -> getFacts($scanned );
@@ -211,28 +211,28 @@ final class ControllerFactsTest extends \Facebook\HackTest\HackTest {
211211 );
212212 }
213213
214- public function testGetAndPostController (): void {
215- expect (() ==> {
214+ public async function testGetAndPostController (): Awaitable < void > {
215+ expect (async () ==> {
216216 $code = " <?hh\n " .
217217 " final class MyController implements\n " .
218218 " \Facebook\HackRouter\IncludeInUriMap,\n " .
219219 " \Facebook\HackRouter\SupportsGetRequests,\n " .
220220 " \Facebook\HackRouter\SupportsPostRequests {\n " .
221221 " }" ;
222- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
222+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
223223 $class = $scanned -> getClass(' MyController' );
224224 $facts = $this -> getFacts($scanned );
225225 $_throws = $this -> getMethods($facts , $class );
226226 })-> toThrow(InvariantException :: class );
227227 }
228228
229- public function testControllerWithNoSupportedMethods (): void {
230- expect (() ==> {
229+ public async function testControllerWithNoSupportedMethods (): Awaitable < void > {
230+ expect (async () ==> {
231231 $code = " <?hh\n " .
232232 " final class MyController implements\n " .
233233 " \Facebook\HackRouter\IncludeInUriMap {\n " .
234234 " }" ;
235- $scanned = FileParser :: fromData ($code , __FUNCTION__ );
235+ $scanned = await FileParser :: fromDataAsync ($code , __FUNCTION__ );
236236 $class = $scanned -> getClass(' MyController' );
237237 $facts = $this -> getFacts($scanned );
238238 $_throws = $this -> getMethods($facts , $class );
0 commit comments