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

(-)a/t/Koha/Email.t (-4 / +5 lines)
Lines 25-31 use_ok('Koha::Email'); Link Here
25
25
26
subtest 'create() tests' => sub {
26
subtest 'create() tests' => sub {
27
27
28
    plan tests => 21;
28
    plan tests => 23;
29
29
30
    t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef );
30
    t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef );
31
31
Lines 56-62 subtest 'create() tests' => sub { Link Here
56
    is( $email->email->header('Subject'), 'Some subject', 'Value set correctly' );
56
    is( $email->email->header('Subject'), 'Some subject', 'Value set correctly' );
57
    is( $email->email->header('X-Mailer'), 'Koha', 'Value set correctly' );
57
    is( $email->email->header('X-Mailer'), 'Koha', 'Value set correctly' );
58
    is( $email->email->body, $html_body, "Body set correctly" );
58
    is( $email->email->body, $html_body, "Body set correctly" );
59
    is( $email->email->content_type, 'text/html; charset="utf-8"', "Content type set correctly");
59
    like( $email->email->content_type, qr|text/html|, "Content type set correctly");
60
    like( $email->email->content_type, qr|charset="utf-8"|, "Charset set correctly");
60
    like( $email->email->header('Message-ID'), qr/\<.*@.*\>/, 'Value set correctly' );
61
    like( $email->email->header('Message-ID'), qr/\<.*@.*\>/, 'Value set correctly' );
61
62
62
    t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'catchall@example.com' );
63
    t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'catchall@example.com' );
Lines 81-86 subtest 'create() tests' => sub { Link Here
81
    is( $email->email->header('ReplyTo'), 'replytodefault@example.com', 'ReplytoDefault picked when replyto not passed' );
82
    is( $email->email->header('ReplyTo'), 'replytodefault@example.com', 'ReplytoDefault picked when replyto not passed' );
82
    is( $email->email->header('Sender'), 'returnpathdefault@example.com', 'ReturnpathDefault picked when sender not passed' );
83
    is( $email->email->header('Sender'), 'returnpathdefault@example.com', 'ReturnpathDefault picked when sender not passed' );
83
    is( $email->email->body, $text_body, "Body set correctly" );
84
    is( $email->email->body, $text_body, "Body set correctly" );
84
    is( $email->email->content_type, 'text/plain; charset="utf-8"; format="flowed"', "Content type set correctly");
85
    like( $email->email->content_type, qr|text/plain|, "Content type set correctly");
86
    like( $email->email->content_type, qr|charset="utf-8"|, "Charset set correctly");
85
};
87
};
86
88
87
- 

Return to bug 22343