File Coverage

blib/lib/Mail/Message/Dummy.pm
Criterion Covered Total %
statement 20 24 83.3
branch 1 2 50.0
condition n/a
subroutine 6 8 75.0
pod 2 3 66.6
total 29 37 78.3


line stmt bran cond sub pod time code
1             # Copyrights 2001-2020 by [Mark Overmeer].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.02.
5             # This code is part of distribution Mail-Box. Meta-POD processed with
6             # OODoc into POD and HTML manual-pages. See README.md
7             # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8              
9             package Mail::Message::Dummy;
10 4     4   31 use vars '$VERSION';
  4         9  
  4         226  
11             $VERSION = '3.009';
12              
13 4     4   25 use base 'Mail::Message';
  4         8  
  4         384  
14              
15 4     4   28 use strict;
  4         11  
  4         102  
16 4     4   24 use warnings;
  4         9  
  4         125  
17              
18 4     4   24 use Carp;
  4         8  
  4         847  
19              
20              
21             sub init($)
22 10     10 0 81 { my ($self, $args) = @_;
23              
24 10         27 @$args{ qw/modified trusted/ } = (0, 1);
25 10         38 $self->SUPER::init($args);
26              
27             $self->log(ERROR => "Message-Id is required for a dummy.")
28 10 50       478 unless exists $args->{messageId};
29              
30 10         28 $self;
31             }
32            
33             #-------------------------------------------
34              
35             sub isDummy() { 1 }
36              
37              
38             sub head()
39 0     0 1   { shift->log(ERROR => "You cannot take the head of a dummy message");
40 0           ();
41             }
42              
43             sub body()
44 0     0 1   { shift->log(ERROR => "You cannot take the body of a dummy message");
45 0           ();
46             }
47              
48             1;