aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-01 13:56:08 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-01 13:56:08 +0100
commit32dded5497a353069ce2db7169175fead1990870 (patch)
treeeda0b66bcc9f604a29faeedfc63ed378d6b2e9f5 /perllib/FixMyStreet/Cobrand.pm
parent0eec3a2bbe1eb94267a9694baa10d13a5fb484be (diff)
Fix tests with new ALLOWED_COBRANDS structure, fix admin test to skip Barnet tests if not present.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand.pm b/perllib/FixMyStreet/Cobrand.pm
index 647261e32..b88f6facc 100644
--- a/perllib/FixMyStreet/Cobrand.pm
+++ b/perllib/FixMyStreet/Cobrand.pm
@@ -109,4 +109,22 @@ sub get_class_for_moniker {
return 'FixMyStreet::Cobrand::Default';
}
+=head2 exists
+
+ FixMyStreet::Cobrand->exists( $moniker );
+
+Given a moniker, returns true if that cobrand is available to us for use
+
+=cut
+
+sub exists {
+ my ( $class, $moniker ) = @_;
+
+ foreach my $avail ( $class->available_cobrand_classes ) {
+ return 1 if $moniker eq $avail->{moniker};
+ }
+
+ return 0;
+}
+
1;