Skip to content

Commit cff5ad6

Browse files
committed
Adding tests on Google Maps
1 parent 801320a commit cff5ad6

File tree

7 files changed

+81
-5
lines changed

7 files changed

+81
-5
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: php
2+
sudo: false
3+
4+
php:
5+
- 7.0
6+
7+
before_install:
8+
- echo "Disable xdebug" && phpenv config-rm xdebug.ini
9+
10+
install:
11+
- composer update --prefer-dist
12+
13+
script:
14+
- ./vendor/bin/phpunit
15+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Create a test that looks like this:
1919

2020
```php
2121
use Http\Client\HttpClient;
22-
use Geocoder\IntegrationTests\ProviderIntegrationTest;
22+
use Geocoder\IntegrationTest\ProviderIntegrationTest;
2323
use Geocoder\Provider\GoogleMaps\GoogleMaps;
2424

2525
class IntegrationTest extends ProviderIntegrationTest

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@
2626
"require-dev": {
2727
"php-http/curl-client": "^1.7"
2828
},
29-
"autoload": {
29+
"autoload": {
3030
"psr-4": {
31-
"Geocoder\\IntegrationTests\\": "src/"
31+
"Geocoder\\IntegrationTest\\": "src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Geocoder\\IntegrationTest\\Test\\": "tests/"
3237
}
3338
}
3439
}

phpunit.xml.dist

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
bootstrap="vendor/autoload.php"
13+
>
14+
<testsuites>
15+
<testsuite name="Google Maps">
16+
<file>./tests/GoogleMapsTest.php</file>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist>
22+
<directory>./</directory>
23+
<exclude>
24+
<directory>./tests</directory>
25+
<directory>./vendor</directory>
26+
</exclude>
27+
</whitelist>
28+
</filter>
29+
</phpunit>

src/CachedResponseClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license MIT License
99
*/
1010

11-
namespace Geocoder\IntegrationTests;
11+
namespace Geocoder\IntegrationTest;
1212

1313
use Http\Client\HttpClient;
1414
use Psr\Http\Message\RequestInterface;

src/ProviderIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @license MIT License
99
*/
1010

11-
namespace Geocoder\IntegrationTests;
11+
namespace Geocoder\IntegrationTest;
1212

1313
use Geocoder\Model\Query\GeocodeQuery;
1414
use Geocoder\Model\Query\ReverseQuery;

tests/GoogleMapsTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Geocoder package.
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @license MIT License
9+
*/
10+
11+
namespace Geocoder\IntegrationTest\Test;
12+
13+
14+
use Http\Client\HttpClient;
15+
use Geocoder\IntegrationTest\ProviderIntegrationTest;
16+
use Geocoder\Provider\GoogleMaps\GoogleMaps;
17+
18+
/**
19+
* @author Tobias Nyholm <[email protected]>
20+
*/
21+
class GoogleMapsTest extends ProviderIntegrationTest
22+
{
23+
protected function createProvider(HttpClient $httpClient)
24+
{
25+
return new GoogleMaps($httpClient);
26+
}
27+
}

0 commit comments

Comments
 (0)