View | Details | Raw Unified | Return to bug 16500
Collapse All | Expand All

(-)a/t/db_dependent/TestBuilder.t (-2 / +4 lines)
Lines 24-29 use Test::Warn; Link Here
24
use Data::Dumper qw(Dumper);
24
use Data::Dumper qw(Dumper);
25
25
26
use Koha::Database;
26
use Koha::Database;
27
use Koha::Libraries;
27
28
28
BEGIN {
29
BEGIN {
29
    use_ok('t::lib::TestBuilder');
30
    use_ok('t::lib::TestBuilder');
Lines 53-59 subtest 'Start with some trivial tests' => sub { Link Here
53
54
54
    # return undef if a record exists
55
    # return undef if a record exists
55
    my $param = { source => 'Branch', value => { branchcode => 'MPL' } };
56
    my $param = { source => 'Branch', value => { branchcode => 'MPL' } };
56
    $builder->build( $param ); # at least it should exist now
57
    unless ( Koha::Libraries->find( 'MPL' ) ) {
58
        $builder->build( $param ); # at least it should exist now
59
    }
57
    warning_like { $builder->build( $param ) }
60
    warning_like { $builder->build( $param ) }
58
        qr/Violation of unique constraint/,
61
        qr/Violation of unique constraint/,
59
        'Catch warn on adding existing record';
62
        'Catch warn on adding existing record';
60
- 

Return to bug 16500