forked from geocoder-php/Geocoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractProviderTest.php
More file actions
46 lines (38 loc) · 1.06 KB
/
Copy pathAbstractProviderTest.php
File metadata and controls
46 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Geocoder\Tests\Provider;
use Geocoder\Tests\TestCase;
use Geocoder\Provider\AbstractProvider;
use Ivory\HttpAdapter\AbstractHttpAdapter;
use Ivory\HttpAdapter\Message\InternalRequestInterface;
/**
* @author William Durand <william.durand1@gmail.com>
*/
class AbstractProviderTest extends TestCase
{
public function testGetLocalhostDefaults()
{
$adapter = new MockHttpAdapter();
$provider = new MockProvider($adapter);
$result = $provider->getLocalhostDefaults();
$this->assertEquals(2, count($result));
$this->assertEquals('localhost', $result['locality']);
$this->assertEquals('localhost', $result['country']);
}
}
class MockProvider extends AbstractProvider
{
public function getLocalhostDefaults()
{
return parent::getLocalhostDefaults();
}
}
class MockHttpAdapter extends AbstractHttpAdapter
{
public function getName()
{
return 'mock_http_adapter';
}
protected function sendInternalRequest(InternalRequestInterface $internalRequest)
{
}
}