aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock/Tilma.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-04-08 16:55:12 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-04-08 16:55:12 +0100
commit75002bb7f3eb82fa1c8002e199e188501d7954a4 (patch)
treed9e285c6b5003663f8f400cb1f81697f6fb9f999 /t/Mock/Tilma.pm
parent970be3512091f60e988997b674f1aca320481f22 (diff)
parent3e437b5a5a3e27100473f095e91d8d6637f2a027 (diff)
Merge branch 'tfl-stroke-opacity'
Diffstat (limited to 't/Mock/Tilma.pm')
-rw-r--r--t/Mock/Tilma.pm27
1 files changed, 20 insertions, 7 deletions
diff --git a/t/Mock/Tilma.pm b/t/Mock/Tilma.pm
index 5a11209e3..7542b1f5e 100644
--- a/t/Mock/Tilma.pm
+++ b/t/Mock/Tilma.pm
@@ -10,6 +10,18 @@ has json => (
},
);
+sub as_json {
+ my ($self, $features) = @_;
+ my $json = mySociety::Locale::in_gb_locale {
+ $self->json->encode({
+ type => "FeatureCollection",
+ crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } },
+ features => $features,
+ });
+ };
+ return $json;
+}
+
sub dispatch_request {
my $self = shift;
@@ -25,15 +37,16 @@ sub dispatch_request {
[ 539408.94, 170607.58 ],
] ] } } ];
}
- my $json = mySociety::Locale::in_gb_locale {
- $self->json->encode({
- type => "FeatureCollection",
- crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } },
- features => $features,
- });
- };
+ my $json = $self->as_json($features);
return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
},
+
+ sub (GET + /mapserver/highways + ?*) {
+ my ($self, $args) = @_;
+ my $json = $self->as_json([]);
+ return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
+ },
+
}
__PACKAGE__->run_if_script;