diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-15 16:38:52 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-15 16:38:52 +0000 |
commit | 4dac760f5d5291437667b28b39af41d29545bda3 (patch) | |
tree | 971fef059954ef7cfd01d582639b3b919d500128 /t | |
parent | 93700ab136ce0b4f95935f150a092ca1fdae2109 (diff) |
Include areas in mock MapIt postcode calls.
Diffstat (limited to 't')
-rw-r--r-- | t/Mock/MapIt.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm index 2778df1ed..d5b73641a 100644 --- a/t/Mock/MapIt.pm +++ b/t/Mock/MapIt.pm @@ -55,7 +55,15 @@ sub dispatch_request { my ($self, $postcode) = @_; foreach (@PLACES) { if ($postcode eq $_->[0] || $postcode eq $_->[0] =~ s/ //gr) { - return $self->output({wgs84_lat => $_->[1], wgs84_lon => $_->[2], postcode => $postcode, coordsyst => 'G'}); + my %areas; + for (my $i=3; $i<@$_; $i+=3) { + $areas{"$_->[$i]"} = { id => $_->[$i], name => $_->[$i+1], type => $_->[$i+2] }; + } + return $self->output({ + wgs84_lat => $_->[1], wgs84_lon => $_->[2], + postcode => $postcode, coordsyst => 'G', + areas => \%areas, + }); } } my $response = { |