fix: ip
This commit is contained in:
@@ -28,11 +28,14 @@ class DeviceCountryTest extends TestCase
|
||||
'CONTENT_TYPE' => 'text/plain',
|
||||
'HTTP_X_TS' => $ts,
|
||||
'HTTP_CF_IPCOUNTRY' => 'US',
|
||||
'HTTP_CF_CONNECTING_IP' => '203.0.113.44',
|
||||
'HTTP_X_FORWARDED_FOR' => '1.2.3.4',
|
||||
], $enc['body'])->assertOk();
|
||||
|
||||
$device = Device::query()->where('device_id', '000C30D83CD0402E')->first();
|
||||
$this->assertNotNull($device);
|
||||
$this->assertSame('US', $device->country);
|
||||
$this->assertSame('203.0.113.44', $device->ip);
|
||||
$this->assertStringContainsString('(美国)', $device->formattedIp());
|
||||
|
||||
$admin = Admin::query()->create(['username' => 'admin', 'password' => 'admin123']);
|
||||
|
||||
Reference in New Issue
Block a user