|
16 | 16 | */
|
17 | 17 | class MinFraudTest extends ServiceClientTester
|
18 | 18 | {
|
| 19 | + public function testMinFraud(): void |
| 20 | + { |
| 21 | + $minFraud = new MinFraud(0, '', ['hashEmail' => true, 'locales' => ['en', 'fr']]); |
| 22 | + $minFraud = $minFraud->withDevice(['ip_address' => '1.2.3.4']); |
| 23 | + |
| 24 | + $array = [ |
| 25 | + 'content' => ['device' => ['ip_address' => '1.2.3.4']], |
| 26 | + 'hashEmail' => true, |
| 27 | + 'locales' => ['en', 'fr'], |
| 28 | + ]; |
| 29 | + |
| 30 | + $this->assertSame( |
| 31 | + $array, |
| 32 | + $minFraud->jsonSerialize(), |
| 33 | + 'correctly implements JsonSerializable' |
| 34 | + ); |
| 35 | + } |
| 36 | + |
19 | 37 | /**
|
20 | 38 | * @dataProvider services
|
21 | 39 | */
|
@@ -195,7 +213,6 @@ public function testEmailHashingDisabled(): void
|
195 | 213 | // Reflection isn't ideal, but this is the easiest way to check.
|
196 | 214 | $class = new \ReflectionClass(MinFraud::class);
|
197 | 215 | $prop = $class->getProperty('content');
|
198 |
| - $prop->setAccessible(true); |
199 | 216 |
|
200 | 217 | $client = $this->createMinFraudRequestWithFullResponse(
|
201 | 218 | 'insights',
|
@@ -234,7 +251,6 @@ public function testEmailHashingEnabled(): void
|
234 | 251 | // Reflection isn't ideal, but this is the easiest way to check.
|
235 | 252 | $class = new \ReflectionClass(MinFraud::class);
|
236 | 253 | $prop = $class->getProperty('content');
|
237 |
| - $prop->setAccessible(true); |
238 | 254 |
|
239 | 255 | $client = $this->createMinFraudRequestWithFullResponse(
|
240 | 256 | 'insights',
|
|
0 commit comments