function it_should_return_address_information_by_latitude_and_longitude(Response $response, Address $address) { $latitude = 51.5664; $longitude = 5.07718; $address->getStreet()->willReturn('Wilhelminapark'); $address->getPostcode()->willReturn('5041EB'); $address->getTown()->willReturn('Tilburg'); $address->getLatitude()->willReturn($latitude); $address->getLongitude()->willReturn($longitude); $address->getXPos()->willReturn(133504); $address->getYPos()->willReturn(397543); $response->getAddress()->willReturn($address); $this->client->wgs84($latitude, $longitude)->willReturn($response); /** @var Address $address */ $this->getAddressByLatitudeAndLongitude($latitude, $longitude)->shouldReturn($address); }