|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 1; |
22 |
use Test::More tests => 2; |
| 23 |
|
23 |
|
| 24 |
use Koha::Database; |
24 |
use Koha::Database; |
| 25 |
use Koha::SMTP::Servers; |
25 |
use Koha::SMTP::Servers; |
|
Lines 93-95
subtest 'smtp_server() tests' => sub {
Link Here
|
| 93 |
|
93 |
|
| 94 |
$schema->storage->txn_rollback; |
94 |
$schema->storage->txn_rollback; |
| 95 |
}; |
95 |
}; |
| 96 |
- |
96 |
|
|
|
97 |
subtest 'smtp_server_info() tests' => sub { |
| 98 |
|
| 99 |
plan tests => 2; |
| 100 |
|
| 101 |
$schema->storage->txn_begin; |
| 102 |
|
| 103 |
my $library = $builder->build_object({ class => 'Koha::Libraries' }); |
| 104 |
my $smtp_server = $builder->build_object({ class => 'Koha::SMTP::Servers' }); |
| 105 |
|
| 106 |
# No SMTP server assigned to library, return system default |
| 107 |
is_deeply( $library->smtp_server_info, { name => 'system_default' }, 'System default is returned' ); |
| 108 |
|
| 109 |
# Assign an SMTP server |
| 110 |
$library->smtp_server({ smtp_server => $smtp_server }); |
| 111 |
is_deeply( $library->smtp_server_info, { name => $smtp_server->name, smtp_server_id => $smtp_server->id }, 'The right information is returned when SMTP server is assigned' ); |
| 112 |
|
| 113 |
$schema->storage->txn_rollback; |
| 114 |
}; |