line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: Perl; -*- |
2
|
|
|
|
|
|
|
package Eve::ItemEntryTestBase; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
1517
|
use parent qw(Eve::ItemTestBase); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
38
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use Test::More; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Eve::ItemEntryTestBase->SKIP_CLASS(1); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
B - a base class for all entry item classes. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package SomeEntryItemTest; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use parent qw(Eve::ItemEntryTestBase); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# put your item test content here |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
B is the class that provides test case setup |
28
|
|
|
|
|
|
|
and some mandatory tests required to pass for all item entry |
29
|
|
|
|
|
|
|
classes. Is derived from the B and uses its methods |
30
|
|
|
|
|
|
|
via C call notation. All classes that derive from it should |
31
|
|
|
|
|
|
|
implement the tests in the same manner. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 METHODS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 B |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Returns test arguments for items, can be overridden to add inheritable |
38
|
|
|
|
|
|
|
properties. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_argument_list { |
43
|
3
|
|
|
3
|
1
|
3551
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return { |
46
|
3
|
|
|
|
|
5
|
%{$self->SUPER::get_argument_list()}, |
|
3
|
|
|
|
|
19
|
|
47
|
|
|
|
|
|
|
'id' => 123, |
48
|
|
|
|
|
|
|
'created' => '2011-03-16 17:03:45', |
49
|
|
|
|
|
|
|
'modified' => '2011-03-16 17:04:33', |
50
|
|
|
|
|
|
|
'status' => 1}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 B |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Performs initialization tests. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub test_init { |
60
|
1
|
|
|
1
|
1
|
115
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
7
|
$self->SUPER::test_init(); |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
18
|
is($self->{'item'}->id, 123); |
65
|
1
|
|
|
|
|
422
|
is($self->{'item'}->created, '2011-03-16 17:03:45'); |
66
|
1
|
|
|
|
|
395
|
is($self->{'item'}->modified, '2011-03-16 17:04:33'); |
67
|
1
|
|
|
|
|
378
|
is($self->{'item'}->status, 1); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 B |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Performs class constant tests. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub test_constants { |
77
|
1
|
|
|
1
|
1
|
167
|
my $self = shift; |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
8
|
$self->SUPER::test_constants(); |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
|
|
10
|
is($self->{'item'}->STATUS_ACTIVE, 1); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SEE ALSO |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over 4 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item L |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=back |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Copyright 2010-2013 Sergey Konoplev, Igor Zinovyev. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
101
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
102
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 AUTHOR |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=over 4 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item L |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item L |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=back |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |