1515
1616final class RequestParametersTest extends \Facebook \HackTest \ HackTest {
1717 public function testStringParam (): void {
18- $parts = [new StringRequestParameter (
18+ $parts = varray [new StringRequestParameter (
1919 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
2020 ' foo' ,
2121 )];
2222 $data = dict [' foo' => ' bar' ];
23- expect ((new RequestParameters ($parts , [], $data ))-> getString(' foo' ))
23+ expect ((new RequestParameters ($parts , varray [], $data ))-> getString(' foo' ))
2424 -> toBeSame(' bar' );
2525 }
2626
2727 public function testIntParam (): void {
28- $parts = [new IntRequestParameter (' foo' )];
28+ $parts = varray [new IntRequestParameter (' foo' )];
2929 $data = dict [' foo' => ' 123' ];
30- expect ((new RequestParameters ($parts , [], $data ))-> getInt(' foo' ))-> toBeSame(
30+ expect ((new RequestParameters ($parts , varray [], $data ))-> getInt(' foo' ))-> toBeSame(
3131 123 ,
3232 );
3333 }
3434
3535 public function testFetchingStringAsInt (): void {
3636 expect (() ==> {
37- $parts = [new StringRequestParameter (
37+ $parts = varray [new StringRequestParameter (
3838 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
3939 ' foo' ,
4040 )];
4141 $data = dict [' foo' => ' bar' ];
42- (new RequestParameters ($parts , [], $data ))-> getInt(' foo' );
42+ (new RequestParameters ($parts , varray [], $data ))-> getInt(' foo' );
4343 })-> toThrow(InvariantException :: class );
4444 }
4545
4646 public function testEnumParam (): void {
47- $parts = [new EnumRequestParameter (TestIntEnum :: class , ' foo' )];
47+ $parts = varray [new EnumRequestParameter (TestIntEnum :: class , ' foo' )];
4848 $data = dict [' foo' => (string )TestIntEnum :: BAR ];
49- $value = (new RequestParameters ($parts , [], $data ))-> getEnum(
49+ $value = (new RequestParameters ($parts , varray [], $data ))-> getEnum(
5050 TestIntEnum :: class ,
5151 ' foo' ,
5252 );
@@ -85,7 +85,7 @@ public function testFromPattern(): void {
8585 ' bar' => ' 123' ,
8686 ' baz' => (string )TestIntEnum :: FOO ,
8787 ];
88- $params = new RequestParameters ($parts , [], $data );
88+ $params = new RequestParameters ($parts , varray [], $data );
8989 expect ($params -> getString(' foo' ))-> toBeSame(' some string' );
9090 expect ($params -> getInt(' bar' ))-> toBeSame(123 );
9191 expect ($params -> getEnum(TestIntEnum :: class , ' baz' ))-> toBeSame(
@@ -95,8 +95,8 @@ public function testFromPattern(): void {
9595
9696 public function testGetOptional (): void {
9797 $params = new RequestParameters (
98- [],
99- [new StringRequestParameter (
98+ varray [],
99+ varray [new StringRequestParameter (
100100 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
101101 ' foo' ,
102102 )],
@@ -107,8 +107,8 @@ public function testGetOptional(): void {
107107
108108 public function testGetMissingOptional (): void {
109109 $params = new RequestParameters (
110- [],
111- [new StringRequestParameter (
110+ varray [],
111+ varray [new StringRequestParameter (
112112 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
113113 ' foo' ,
114114 )],
@@ -120,8 +120,8 @@ public function testGetMissingOptional(): void {
120120 public function testGetOptionalAsRequired (): void {
121121 expect (() ==> {
122122 $params = new RequestParameters (
123- [],
124- [new StringRequestParameter (
123+ varray [],
124+ varray [new StringRequestParameter (
125125 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
126126 ' foo' ,
127127 )],
@@ -134,11 +134,11 @@ public function testGetOptionalAsRequired(): void {
134134 public function testGetRequiredAsOptional (): void {
135135 expect (() ==> {
136136 $params = new RequestParameters (
137- [new StringRequestParameter (
137+ varray [new StringRequestParameter (
138138 StringRequestParameterSlashes :: WITHOUT_SLASHES ,
139139 ' foo' ,
140140 )],
141- [],
141+ varray [],
142142 dict [' foo' => ' bar' ],
143143 );
144144 $params -> getOptionalString(' foo' );
0 commit comments