aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Test.pm
blob: 6b6bc02bc8e7ebe12b8c2e9557f5a03e676e4a8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package FixMyStreet::Test;

use parent qw(Exporter);

use strict;
use warnings FATAL => 'all';
use utf8;
use Test::More;
use FixMyStreet::DB;

my $db = FixMyStreet::DB->schema->storage;

sub import {
    strict->import;
    warnings->import(FATAL => 'all');
    utf8->import;
    Test::More->export_to_level(1);
    $db->txn_begin;
}

BEGIN {
    use FixMyStreet;
    FixMyStreet->test_mode(1);
}

END {
    $db->txn_rollback if $db;
}

1;