diff options
Diffstat (limited to 't/Cobrand.t')
-rwxr-xr-x | t/Cobrand.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/t/Cobrand.t b/t/Cobrand.t new file mode 100755 index 000000000..95f3ac73b --- /dev/null +++ b/t/Cobrand.t @@ -0,0 +1,40 @@ +#!/usr/bin/perl -w +# +# Cobrand.t: +# Tests for the cobranding functions +# +# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. +# Email: louise@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: Cobrand.t,v 1.1 2009-08-27 08:42:46 louise Exp $ +# + +use strict; +use warnings; +use Test::More tests => 3; +use Test::Exception; + +use FindBin; +use lib "$FindBin::Bin"; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../../perllib"; + +use Cobrand; +use MockQuery; + +sub test_cobrand_page{ + my $q = new MockQuery('mysite'); + # should get the result of the page function in the cobrand module if one exists + my ($html, $params) = Cobrand::cobrand_page($q); + like($html, qr/A cobrand produced page/, 'cobrand_page returns output from cobrand module'); + + # should return 0 if no cobrand module exists + $q = new MockQuery('mynonexistingsite'); + ($html, $params) = Cobrand::cobrand_page($q); + is($html, 0, 'cobrand_page returns 0 if there is no cobrand module'); + return 1; + +} + + +ok(test_cobrand_page() == 1, 'Ran all tests for the cobrand_page function'); |