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-2023 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.03.
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   32 use vars '$VERSION';
  4         11  
  4         226  
11             $VERSION = '3.010';
12              
13 4     4   27 use base 'Mail::Message';
  4         14  
  4         414  
14              
15 4     4   29 use strict;
  4         10  
  4         93  
16 4     4   32 use warnings;
  4         8  
  4         147  
17              
18 4     4   49 use Carp;
  4         10  
  4         934  
19              
20              
21             sub init($)
22 10     10 0 85 { my ($self, $args) = @_;
23              
24 10         25 @$args{ qw/modified trusted/ } = (0, 1);
25 10         40 $self->SUPER::init($args);
26              
27             $self->log(ERROR => "Message-Id is required for a dummy.")
28 10 50       473 unless exists $args->{messageId};
29              
30 10         24 $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;