Skip to content

Commit 080041f

Browse files
committed
Add numeric tests
1 parent 06236dd commit 080041f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/EntityTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,20 @@ public function ipAddressProvider(): array
3737
[null, null, null],
3838
];
3939
}
40+
41+
public function testIpAddressHandlesStrings(): void
42+
{
43+
$visit = new Visit();
44+
$visit->setAttributes([
45+
'ip_address' => '2130706433',
46+
]);
47+
48+
$result = $visit->getIpAddress();
49+
$this->assertSame('127.0.0.1', $result);
50+
51+
$visit->setAttributes([
52+
'ip_address' => 'foo',
53+
]);
54+
$this->assertNull($visit->getIpAddress());
55+
}
4056
}

0 commit comments

Comments
 (0)