|
Lines 23-47
use C4::Letters;
Link Here
|
| 23 |
use Koha::Database; |
23 |
use Koha::Database; |
| 24 |
use Koha::DateUtils; |
24 |
use Koha::DateUtils; |
| 25 |
use Koha::Patrons; |
25 |
use Koha::Patrons; |
|
|
26 |
|
| 26 |
use t::lib::TestBuilder; |
27 |
use t::lib::TestBuilder; |
|
|
28 |
use t::lib::Mocks; |
| 27 |
|
29 |
|
| 28 |
use Test::More tests => 22; |
30 |
use Test::More tests => 22; |
| 29 |
use Test::MockModule; |
31 |
use Test::MockModule; |
| 30 |
use Test::Warn; |
32 |
use Test::Warn; |
| 31 |
use Carp; |
33 |
use Carp; |
| 32 |
|
34 |
|
| 33 |
my %mail; |
35 |
my ( $email_object, $sendmail_params ); |
| 34 |
my $module = Test::MockModule->new('Mail::Sendmail'); |
36 |
|
| 35 |
$module->mock( |
37 |
my $email_sender_module = Test::MockModule->new('Email::Stuffer'); |
| 36 |
'sendmail', |
38 |
$email_sender_module->mock( |
|
|
39 |
'send_or_die', |
| 37 |
sub { |
40 |
sub { |
| 38 |
carp 'Fake sendmail'; |
41 |
( $email_object, $sendmail_params ) = @_; |
| 39 |
%mail = @_; |
42 |
warn 'Fake sendmail'; |
| 40 |
} |
43 |
} |
| 41 |
); |
44 |
); |
| 42 |
|
45 |
|
| 43 |
use_ok('Koha::Patron::Password::Recovery'); |
46 |
use_ok('Koha::Patron::Password::Recovery'); |
| 44 |
|
47 |
|
|
|
48 |
t::lib::Mocks::mock_preference('KohaAdminEmailAddress', 'test@koha-community.org'); |
| 49 |
|
| 45 |
my $schema = Koha::Database->new()->schema(); |
50 |
my $schema = Koha::Database->new()->schema(); |
| 46 |
$schema->storage->txn_begin(); |
51 |
$schema->storage->txn_begin(); |
| 47 |
|
52 |
|
|
Lines 66-71
my $patron_category = $builder->build({ source => 'Category' });
Link Here
|
| 66 |
my $branch = $builder->build({ |
71 |
my $branch = $builder->build({ |
| 67 |
source => 'Branch', |
72 |
source => 'Branch', |
| 68 |
value => { |
73 |
value => { |
|
|
74 |
branchemail => undef, |
| 75 |
branchreplyto => undef, |
| 69 |
branchreturnpath => $email1, |
76 |
branchreturnpath => $email1, |
| 70 |
}, |
77 |
}, |
| 71 |
}); |
78 |
}); |
| 72 |
- |
|
|