generateUrl($address); // THEN expect($url)->toBe('https://www.openstreetmap.org/?mlat=48.8566&mlon=2.3522#map=16/48.8566/2.3522'); }); it('generates a Google Maps URL when coordinates are missing', function () { // GIVEN $service = new MapUrlService(); $address = new DeliveryAddress( name: 'My Shop', address: '123 Test St', postcode: '12345', city: 'Test City', phone: null, latitude: null, longitude: null, ); // WHEN $url = $service->generateUrl($address); // THEN $query = urlencode('My Shop 123 Test St 12345 Test City'); expect($url)->toBe("https://maps.google.com/?q={$query}"); }); });