1- < ?hh // partial
1+ < ?hh // strict
22
33namespace Slack\Hack\JsonSchema\Tests ;
44
55use namespace HH\Lib\C ;
66use function Facebook\FBExpect\expect ;
77
8- use type Slack\Hack\JsonSchema\Tests\Generated\{
9- AddressSchemaFileValidator ,
10- AddressSchemaValidator ,
11- };
8+ use type Slack\Hack\JsonSchema\Tests\Generated\{AddressSchemaFileValidator , AddressSchemaValidator} ;
129
1310final class AddressSchemaValidatorTest extends BaseCodegenTestCase {
1411
1512 <<__Override >>
1613 public static async function beforeFirstTestAsync (): Awaitable <void > {
1714 $ret = self :: getBuilder(' address-schema.json' , ' AddressSchemaValidator' );
1815 $ret [' codegen' ]-> build();
19- $ret_remote = self :: getBuilder(
20- ' address-schema-remote.json' ,
21- ' AddressSchemaFileValidator' ,
22- );
16+ $ret_remote = self :: getBuilder(' address-schema-remote.json' , ' AddressSchemaFileValidator' );
2317 $ret_remote [' codegen' ]-> build();
2418 require_once ($ret [' path' ]);
2519 require_once ($ret_remote [' path' ]);
@@ -63,9 +57,7 @@ public function testAddressWithNumericPostalCode(): void {
6357 ]);
6458 $validator -> validate();
6559
66- expect ($validator -> isValid())-> toBeTrue(
67- ' numeric postal codes should be valid' ,
68- );
60+ expect ($validator -> isValid())-> toBeTrue(' numeric postal codes should be valid' );
6961 }
7062
7163 public function testAddressWithInvalidPostalCode (): void {
@@ -93,9 +85,7 @@ public function testAddressWithFileRef(): void {
9385 ]);
9486 $validator -> validate();
9587
96- expect ($validator -> isValid())-> toBeTrue(
97- ' file reference to phone type should be valid' ,
98- );
88+ expect ($validator -> isValid())-> toBeTrue(' file reference to phone type should be valid' );
9989 }
10090
10191 public function testAddressWithSizeAllOf (): void {
@@ -106,9 +96,7 @@ public function testAddressWithSizeAllOf(): void {
10696 ' size' => 200 ,
10797 ]);
10898 $validator -> validate();
109- expect ($validator -> isValid())-> toBeTrue(
110- ' should be valid as 200 is both an integer and a number' ,
111- );
99+ expect ($validator -> isValid())-> toBeTrue(' should be valid as 200 is both an integer and a number' );
112100 }
113101
114102 public function testAddressWithSizeAllOfFailure (): void {
@@ -119,9 +107,7 @@ public function testAddressWithSizeAllOfFailure(): void {
119107 ' size' => 200.5 ,
120108 ]);
121109 $validator -> validate();
122- expect ($validator -> isValid())-> toBeFalse(
123- ' should not be valid as 200.5 is not an integer' ,
124- );
110+ expect ($validator -> isValid())-> toBeFalse(' should not be valid as 200.5 is not an integer' );
125111 }
126112
127113 public function testAddressWithLongitudeNot (): void {
@@ -132,9 +118,7 @@ public function testAddressWithLongitudeNot(): void {
132118 ' longitude' => 200.5 ,
133119 ]);
134120 $validator -> validate();
135- expect ($validator -> isValid())-> toBeTrue(
136- ' should be valid as 200.5 is not an integer nor a string' ,
137- );
121+ expect ($validator -> isValid())-> toBeTrue(' should be valid as 200.5 is not an integer nor a string' );
138122 }
139123
140124 public function testAddressWithLongitudeNotFailure (): void {
@@ -145,9 +129,7 @@ public function testAddressWithLongitudeNotFailure(): void {
145129 ' longitude' => 200 ,
146130 ]);
147131 $validator -> validate();
148- expect ($validator -> isValid())-> toBeFalse(
149- ' should not be valid as 200 is an integer' ,
150- );
132+ expect ($validator -> isValid())-> toBeFalse(' should not be valid as 200 is an integer' );
151133 }
152134
153135 public function testAddressWithLatitudeOneOf (): void {
@@ -158,9 +140,7 @@ public function testAddressWithLatitudeOneOf(): void {
158140 ' latitude' => 200.5 ,
159141 ]);
160142 $validator -> validate();
161- expect ($validator -> isValid())-> toBeTrue(
162- ' should be valid as 200.5 is not an integer but is a number' ,
163- );
143+ expect ($validator -> isValid())-> toBeTrue(' should be valid as 200.5 is not an integer but is a number' );
164144 }
165145
166146 public function testAddressWithLatitudeOneOfFailure (): void {
@@ -171,9 +151,7 @@ public function testAddressWithLatitudeOneOfFailure(): void {
171151 ' latitude' => 200 ,
172152 ]);
173153 $validator -> validate();
174- expect ($validator -> isValid())-> toBeFalse(
175- ' should not be valid as 200 is an integer and number' ,
176- );
154+ expect ($validator -> isValid())-> toBeFalse(' should not be valid as 200 is an integer and number' );
177155 }
178156
179157 public function testAddressWithFailedFileRef (): void {
@@ -188,9 +166,7 @@ public function testAddressWithFailedFileRef(): void {
188166 ],
189167 ]);
190168 $validator -> validate();
191- expect ($validator -> isValid())-> toBeFalse(
192- ' file reference to phone type should be invalid' ,
193- );
169+ expect ($validator -> isValid())-> toBeFalse(' file reference to phone type should be invalid' );
194170 expect (C \count ($validator -> getErrors()))-> toBeSame(3 );
195171 }
196172
@@ -209,9 +185,7 @@ public function testAddressWithDifferentFileRef(): void {
209185 ]);
210186 $validator -> validate();
211187
212- expect ($validator -> isValid())-> toBeTrue(
213- ' file reference to phone type should be valid' ,
214- );
188+ expect ($validator -> isValid())-> toBeTrue(' file reference to phone type should be valid' );
215189 }
216190
217191 public function testAddressWithFalseDepthRefs (): void {
@@ -229,9 +203,7 @@ public function testAddressWithFalseDepthRefs(): void {
229203 ]);
230204 $validator -> validate();
231205
232- expect ($validator -> isValid())-> toBeFalse(
233- ' file reference to phone type should be valid' ,
234- );
206+ expect ($validator -> isValid())-> toBeFalse(' file reference to phone type should be valid' );
235207 expect (C \count ($validator -> getErrors()))-> toBeSame(2 );
236208 }
237209
0 commit comments