Skip to content

Commit bbb3088

Browse files
committed
[MaxMindBinary] Upgrade tests (PHPUnit 9.5)
1 parent f04e25c commit bbb3088

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/Provider/MaxMindBinary/Tests/MaxMindBinaryTest.php

+12-16
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ public static function provideIps()
5252
];
5353
}
5454

55-
/**
56-
* @expectedException \Geocoder\Exception\InvalidArgument
57-
* @expectedExceptionMessage Given MaxMind dat file "not_exist.dat" does not exist.
58-
*/
5955
public function testThrowIfNotExistBinaryFileGiven()
6056
{
57+
$this->expectException(\Geocoder\Exception\InvalidArgument::class);
58+
$this->expectExceptionMessage('Given MaxMind dat file "not_exist.dat" does not exist.');
59+
6160
new MaxMindBinary('not_exist.dat');
6261
}
6362

@@ -162,34 +161,31 @@ public function testThrowIfIpAddressCouldNotBeLocated()
162161
$this->assertEquals(0, $result->count());
163162
}
164163

165-
/**
166-
* @expectedException \Geocoder\Exception\UnsupportedOperation
167-
* @expectedExceptionMessage The MaxMindBinary provider does not support IPv6 addresses.
168-
*/
169164
public function testThrowIfIpAddressIsNotIpV4()
170165
{
166+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
167+
$this->expectExceptionMessage('The MaxMindBinary provider does not support IPv6 addresses.');
168+
171169
$provider = new MaxMindBinary($this->binaryFile);
172170

173171
$provider->geocodeQuery(GeocodeQuery::create('2002:5018:1818:0:0:0:0:0'));
174172
}
175173

176-
/**
177-
* @expectedException \Geocoder\Exception\UnsupportedOperation
178-
* @expectedExceptionMessage The MaxMindBinary provider does not support street addresses.
179-
*/
180174
public function testThrowIfInvalidIpAddressGiven()
181175
{
176+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
177+
$this->expectExceptionMessage('The MaxMindBinary provider does not support street addresses.');
178+
182179
$provider = new MaxMindBinary($this->binaryFile);
183180

184181
$provider->geocodeQuery(GeocodeQuery::create('invalidIp'));
185182
}
186183

187-
/**
188-
* @expectedException \Geocoder\Exception\UnsupportedOperation
189-
* @expectedExceptionMessage The MaxMindBinary is not able to do reverse geocoding.
190-
*/
191184
public function testThrowOnReverseMethodUsage()
192185
{
186+
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
187+
$this->expectExceptionMessage('The MaxMindBinary is not able to do reverse geocoding.');
188+
193189
$provider = new MaxMindBinary($this->binaryFile);
194190

195191
$provider->reverseQuery(ReverseQuery::fromCoordinates(0, 0));

0 commit comments

Comments
 (0)