Skip to content

Commit 9c47ed2

Browse files
authored
Fixed broken master (#125)
* Fixed broken master * Travis fix * Fixed typo * Allow to fail on HHVM
1 parent 08e48ae commit 9c47ed2

File tree

9 files changed

+30
-21
lines changed

9 files changed

+30
-21
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ php:
44
- 5.4
55
- 5.5
66
- 5.6
7-
- hhvm
87

98
env:
109
- SYMFONY_VERSION=2.3.*
1110
- SYMFONY_VERSION=2.5.*
1211
- SYMFONY_VERSION=2.7.*
12+
- SYMFONY_VERSION=2.8.*
1313
- SYMFONY_VERSION=dev-master
1414

1515
matrix:
1616
allow_failures:
1717
- env: SYMFONY_VERSION=dev-master
18-
18+
- php: hhvm
19+
dist: trusty
20+
env: SYMFONY_VERSION=2.7.*
1921

2022
before_script:
2123
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update

Tests/Command/GeocodeCommandTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public function testExecute()
3232
$country = new Country('France', 'FR');
3333
$address = new Address($coordinates, $bounds, '10', 'rue Gambetta', '75020', 'Paris', null, null, $country);
3434

35-
$geocoder = $this->getMock('Geocoder\\ProviderAggregator');
35+
$geocoder = $this->getMockBuilder('Geocoder\\ProviderAggregator')->getMock();
3636
$geocoder->expects($this->once())
3737
->method('geocode')
3838
->with(self::$address)
3939
->will($this->returnValue(new AddressCollection(array($address))));
4040

41-
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\Container');
41+
$container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')->getMock();
4242
$container->expects($this->once())
4343
->method('get')
4444
->with('bazinga_geocoder.geocoder')
@@ -48,10 +48,14 @@ public function testExecute()
4848
->disableOriginalConstructor()
4949
->getMock();
5050

51-
$kernel->expects($this->once())
51+
$kernel->expects($this->any())
5252
->method('getContainer')
5353
->will($this->returnValue($container));
5454

55+
$kernel->expects($this->any())
56+
->method('getBundles')
57+
->will($this->returnValue([]));
58+
5559
$app = new Application($kernel);
5660
$app->add(new GeocodeCommand());
5761

Tests/DependencyInjection/EventListener/FakeRequestListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testOnKernelRequest()
1616
{
1717
$listener = new FakeRequestListener('33.33.33.1');
1818

19-
$kernel = $this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
19+
$kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernelInterface')->getMock();
2020
$request = new Request();
2121
$event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
2222

Tests/DependencyInjection/Fixtures/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ bazinga_geocoder:
4040
maxmind:
4141
api_key: 123
4242
maxmind_binary:
43-
binary_file: %fixtures_dir%/maxmind.dat
43+
binary_file: "%fixtures_dir%/maxmind.dat"
4444
opencage:
4545
locale: en_US
4646
api_key: 123

Tests/DumperManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ protected function setup()
2121

2222
public function testSet()
2323
{
24-
$this->assertNull($this->manager->set('test', $this->getMock('Geocoder\\Dumper\\Dumper')));
24+
$this->assertNull($this->manager->set('test', $this->getMockBuilder('Geocoder\\Dumper\\Dumper')->getMock()));
2525
}
2626

2727
public function testGet()
2828
{
29-
$dumper = $this->getMock('Geocoder\\Dumper\\Dumper');
29+
$dumper = $this->getMockBuilder('Geocoder\\Dumper\\Dumper')->getMock();
3030
$this->manager->set('test', $dumper);
3131

3232
$this->assertEquals($dumper, $this->manager->get('test'));
@@ -43,13 +43,13 @@ public function testGetNotExistDumper()
4343
public function testHas()
4444
{
4545
$this->assertFalse($this->manager->has('test'));
46-
$this->manager->set('test', $this->getMock('Geocoder\\Dumper\\Dumper'));
46+
$this->manager->set('test', $this->getMockBuilder('Geocoder\\Dumper\\Dumper')->getMock());
4747
$this->assertTrue($this->manager->has('test'));
4848
}
4949

5050
public function testRemove()
5151
{
52-
$this->manager->set('test', $this->getMock('Geocoder\\Dumper\\Dumper'));
52+
$this->manager->set('test', $this->getMockBuilder('Geocoder\\Dumper\\Dumper')->getMock());
5353
$this->manager->remove('test');
5454
$this->assertFalse($this->manager->has('test'));
5555
}

Tests/Logger/GeocoderLoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GeocoderLoggerTest extends \PHPUnit_Framework_TestCase
2727

2828
public function setUp()
2929
{
30-
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
30+
$logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
3131
$logger
3232
->expects($this->any())
3333
->method('info')

Tests/Provider/CacheProviderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ public function testGeocode()
1616
$coordinates = array('lat' => 48.857049,'lng' => 2.35223);
1717
$cacheKey = 'geocoder_'.sha1($address);
1818

19-
$delegate = $this->getMock('Geocoder\\Provider\\Provider');
19+
$delegate = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
2020
$delegate->expects($this->once())
2121
->method('geocode')
2222
->with($address)
2323
->will($this->returnValue($coordinates));
2424

25-
$cache = $this->getMock('Doctrine\\Common\\Cache\\Cache');
25+
$cache = $this->getMockBuilder('Doctrine\\Common\\Cache\\Cache')->getMock();
2626
$cache->expects($this->once())
2727
->method('fetch')
2828
->with($cacheKey)
@@ -42,7 +42,7 @@ public function testCachedGeocode()
4242
$coordinates = array('lat' => 48.857049,'lng' => 2.35223);
4343
$cacheKey = 'geocoder_'.sha1($address);
4444

45-
$delegate = $this->getMock('Geocoder\\Provider\\Provider');
45+
$delegate = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
4646
$delegate->expects($this->once())
4747
->method('geocode')
4848
->with($address)
@@ -60,7 +60,7 @@ public function testReverse()
6060
{
6161
$coordinates = array('lat' => 48.857049, 'lon' => 2.35223);
6262

63-
$delegate = $this->getMock('Geocoder\\Provider\\Provider');
63+
$delegate = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
6464
$delegate->expects($this->once())
6565
->method('reverse')
6666
->with($coordinates['lat'], $coordinates['lon'])
@@ -76,8 +76,8 @@ public function testReverse()
7676

7777
public function testGetName()
7878
{
79-
$delegate = $this->getMock('Geocoder\\Provider\\Provider');
80-
$cache = $this->getMock('Doctrine\\Common\\Cache\\Cache');
79+
$delegate = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock();
80+
$cache = $this->getMockBuilder('Doctrine\\Common\\Cache\\Cache')->getMock();
8181

8282
$provider = new Cache($cache, $delegate);
8383

Tests/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
');
88
}
99

10-
require_once __DIR__.'/../vendor/maxromanovsky/php-maxmind-geoip/geoip.inc';
11-
require_once __DIR__.'/../vendor/maxromanovsky/php-maxmind-geoip/geoipcity.inc';
10+
require_once __DIR__.'/../vendor/geoip/geoip/src/geoip.inc';
11+
require_once __DIR__.'/../vendor/geoip/geoip/src/geoipcity.inc';
1212

1313
$loader->add('Doctrine\Tests', __DIR__.'/../vendor/doctrine/orm/tests');

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
"require-dev": {
1919
"php": ">=5.4",
2020
"symfony/yaml": "~2.1|~3.0",
21-
"maxromanovsky/php-maxmind-geoip": "~1.12",
21+
"geoip/geoip": "~1.17",
2222
"doctrine/cache": "~1.3",
2323
"doctrine/orm": "~2.3"
2424
},
25+
"conflict": {
26+
"willdurand/geocoder": "3.2"
27+
},
2528
"autoload": {
2629
"psr-0": { "Bazinga\\Bundle\\GeocoderBundle": "" }
2730
},

0 commit comments

Comments
 (0)