diff --git a/tests/Service/GeocodeTest.php b/tests/Service/GeocoderTest.php similarity index 84% rename from tests/Service/GeocodeTest.php rename to tests/Service/GeocoderTest.php index b70e32d..27961d9 100644 --- a/tests/Service/GeocodeTest.php +++ b/tests/Service/GeocoderTest.php @@ -16,7 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; /** * We sleep 1 second after API calls to prevent breaking the API T&Cs. */ -final class GeocodeTest extends KernelTestCase +final class GeocoderTest extends KernelTestCase { // Buckingham Palace private const string POSTCODE = 'SW1A 1AA'; @@ -30,17 +30,12 @@ final class GeocodeTest extends KernelTestCase $this->geocoder = $kernel->getContainer()->get('pcm_geocode.geocoder'); } - public function testGeocodeInstance(): void - { - $this->assertInstanceOf(Geocoder::class, $this->geocoder); - } - public function testGeocodePostcodeThrowsOnEmptyInput(): void { sleep(1); $this->expectException(ApiErrorException::class); $this->expectExceptionMessageMatches("/Nothing to search for.$/"); - $this->geocoder->geocodePostcode(''); + $this->geocoder->geocode(''); } public function testGeocodePostcodeThrowsOnInvalidPostcode(): void @@ -48,13 +43,13 @@ final class GeocodeTest extends KernelTestCase sleep(1); $this->expectException(NoResultsFoundException::class); $this->expectExceptionMessageMatches("/No results found.$/"); - $this->geocoder->geocodePostcode('ZZZZZZZZZZZZ'); + $this->geocoder->geocode('ZZZZZZZZZZZZ'); } public function testGeocodePostcodeReturnsGeoCoordinates(): GeoCoordinates { sleep(1); - $geoCoords = $this->geocoder->geocodePostcode(self::POSTCODE); + $geoCoords = $this->geocoder->geocode(self::POSTCODE); $this->assertNotNull($geoCoords); return $geoCoords;