aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-04 18:18:27 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-16 17:15:27 +0100
commit61eb613ddc31943e9d6504050c0e96f91340f752 (patch)
tree7e0ea449a00a21ff977f211fc4812a414386db5a /t/Mock
parent16b4d05dac360a1c81d4595b0e06bd9468f7e4a1 (diff)
[Oxfordshire] Send RDI reports by email.
Diffstat (limited to 't/Mock')
-rw-r--r--t/Mock/MapIt.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm
index 43d44d519..0b355983b 100644
--- a/t/Mock/MapIt.pm
+++ b/t/Mock/MapIt.pm
@@ -31,6 +31,7 @@ my @PLACES = (
[ '?', 50.78301, -0.646929 ],
[ 'GU51 4AE', 51.279456, -0.846216, 2333, 'Hart District Council', 'DIS', 2227, 'Hampshire County Council', 'CTY' ],
[ 'WS1 4NH', 52.563074, -1.991032, 2535, 'Sandwell Borough Council', 'MTD' ],
+ [ 'OX28 4DS', 51.784721, -1.494453 ],
);
sub dispatch_request {
@@ -105,6 +106,19 @@ sub dispatch_request {
my ($self, $area) = @_;
return [ 200, [ 'Content-Type' => 'application/json' ], [ '"AB12 1AA"' ] ];
},
+
+ sub (GET + /nearest/**.*) {
+ my ($self, $point) = @_;
+ foreach (@PLACES) {
+ if ($point eq "4326/$_->[2],$_->[1]") {
+ return $self->output({
+ postcode => { wgs84_lat => $_->[1], wgs84_lon => $_->[2], postcode => $_->[0] },
+ });
+ }
+ }
+ return $self->output({});
+ },
+
}
LWP::Protocol::PSGI->register(t::Mock::MapIt->to_psgi_app, host => 'mapit.uk');