| 1 | # -*- mode: Perl; -*- | ||
| 2 | package Eve::ItemEntryTestBase; | ||
| 3 | |||
| 4 | 2 | ▶ | use parent qw(Eve::ItemTestBase); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use Test::More; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 2 | Eve::ItemEntryTestBase->SKIP_CLASS(1); | |
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | B<Eve::ItemEntryTestBase> - 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<Eve::ItemEntryTestBase> 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<Eve::ItemTestBase> and uses its methods | ||
| 30 | via C<SUPER> 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<get_argument_list()> | ||
| 36 | |||
| 37 | Returns test arguments for items, can be overridden to add inheritable | ||
| 38 | properties. | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | 3 | ▶ | sub get_argument_list { |
|
Subroutine
get_argument_list: called CC=1 SCAR=0.0
Pod
documented
| |||
| 43 | 3 | my $self = shift; | |
| 44 | |||
| 45 | return { | ||
| 46 | 3 | %{$self->SUPER::get_argument_list()}, | |
| 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<test_init()> | ||
| 54 | |||
| 55 | Performs initialization tests. | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | 1 | ▶ | sub test_init { |
|
Subroutine
test_init: called CC=1 SCAR=0.0
Pod
documented
| |||
| 60 | 1 | my $self = shift; | |
| 61 | |||
| 62 | 1 | $self->SUPER::test_init(); | |
| 63 | |||
| 64 | 1 | is($self->{'item'}->id, 123); | |
| 65 | 1 | is($self->{'item'}->created, '2011-03-16 17:03:45'); | |
| 66 | 1 | is($self->{'item'}->modified, '2011-03-16 17:04:33'); | |
| 67 | 1 | is($self->{'item'}->status, 1); | |
| 68 | } | ||
| 69 | |||
| 70 | =head2 B<test_constants> | ||
| 71 | |||
| 72 | Performs class constant tests. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | 1 | ▶ | sub test_constants { |
|
Subroutine
test_constants: called CC=1 SCAR=0.0
Pod
documented
| |||
| 77 | 1 | my $self = shift; | |
| 78 | |||
| 79 | 1 | $self->SUPER::test_constants(); | |
| 80 | |||
| 81 | 1 | is($self->{'item'}->STATUS_ACTIVE, 1); | |
| 82 | } | ||
| 83 | |||
| 84 | =head1 SEE ALSO | ||
| 85 | |||
| 86 | =over 4 | ||
| 87 | |||
| 88 | =item L<Eve::Test> | ||
| 89 | |||
| 90 | =item L<Eve::ItemTestBase> | ||
| 91 | |||
| 92 | =item L<Test::Class> | ||
| 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<Sergey Konoplev|mailto:gray.ru@gmail.com> | ||
| 111 | |||
| 112 | =item L<Igor Zinovyev|mailto:zinigor@gmail.com> | ||
| 113 | |||
| 114 | =back | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | 2 | 1; | |