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

(-)a/t/db_dependent/Koha/Patrons/Import.t (-5 / +11 lines)
Lines 18-24 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Test::More tests => 122;
21
use Test::More tests => 124;
22
use Test::Warn;
22
23
23
# To be replaced by t::lib::Mock
24
# To be replaced by t::lib::Mock
24
use Test::MockModule;
25
use Test::MockModule;
Lines 63-76 subtest 'test_attributes' => sub { Link Here
63
64
64
# Tests for Koha::Patrons::Import::import_patrons()
65
# Tests for Koha::Patrons::Import::import_patrons()
65
# Given ... nothing much. When ... Then ...
66
# Given ... nothing much. When ... Then ...
66
my $result = $patrons_import->import_patrons(undef);
67
my $result;
68
warning_is { $result = $patrons_import->import_patrons(undef) }
69
           { carped => 'No file handle passed in!' },
70
           " Koha::Patrons::Import->import_patrons carps if no file handle is passed";
67
is($result, undef, 'Got the expected undef from import_patrons with nothing much');
71
is($result, undef, 'Got the expected undef from import_patrons with nothing much');
68
72
69
# Given ... some params but no file handle.
73
# Given ... some params but no file handle.
70
my $params_0 = { some_stuff => 'random stuff', };
74
my $params_0 = { some_stuff => 'random stuff', };
71
75
72
# When ... Then ...
76
# When ... Then ...
73
my $result_0 = $patrons_import->import_patrons($params_0);
77
my $result_0;
78
warning_is { $result_0 = $patrons_import->import_patrons($params_0) }
79
           { carped => 'No file handle passed in!' },
80
           " Koha::Patrons::Import->import_patrons carps if no file handle is passed";
74
is($result_0, undef, 'Got the expected undef from import_patrons with no file handle');
81
is($result_0, undef, 'Got the expected undef from import_patrons with no file handle');
75
82
76
# Given ... a file handle to file with headers only.
83
# Given ... a file handle to file with headers only.
Lines 622-625 sub make_csv { Link Here
622
    return $filename;
629
    return $filename;
623
}
630
}
624
631
625
1;
632
1;
626
- 

Return to bug 12598