Skip to content

Commit c36aa0f

Browse files
authored
Merge pull request #13 from chadicus/master
Add timezone-name field
2 parents 7f4fd8c + ba84d00 commit c36aa0f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/NetAcuity.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function __construct(Socket $socket, $apiId)
5858
* @type string $postal-conf
5959
* @type string $gmt-offset
6060
* @type string $in-dist
61+
* @type string $timezone-name
6162
* }
6263
*/
6364
public function getGeo($ip)
@@ -89,6 +90,7 @@ public function getGeo($ip)
8990
'postal-conf',
9091
'gmt-offset',
9192
'in-dist',
93+
'timezone-name',
9294
]
9395
);
9496
}

tests/NetAcuityTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getGeo()
3636
$socket = $this->getMockBuilder('\Socket\Raw\Socket')->disableOriginalConstructor()->setMethods(['write', 'read'])->getMock();
3737
$socket->expects($this->once())->method('write')->with("4;1;1.2.3.4\r\n")->will($this->returnValue(13));
3838
$socket->expects($this->once())->method('read')->with(1024)->will(
39-
$this->returnValue('xxxxUSA;something;reserved;broadband;2;123.456;789.101;12345;112;1314;1516;1;US;1;123;2;3;4;5;6;7xxx')
39+
$this->returnValue('xxxxUSA;something;reserved;broadband;2;123.456;789.101;12345;112;1314;1516;1;US;1;123;2;3;4;5;6;7;UTCxxx')
4040
);
4141

4242
$client = new NetAcuity($socket, 1);
@@ -64,6 +64,7 @@ public function getGeo()
6464
'postal-conf' => '5',
6565
'gmt-offset' => '6',
6666
'in-dist' => '7',
67+
'timezone-name' => 'UTC',
6768
],
6869
$client->getGeo('1.2.3.4')
6970
);

0 commit comments

Comments
 (0)