/[Arh]/lib/Arh/Test.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Arh/Test.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (show annotations)
Thu Dec 6 16:57:13 2007 UTC (11 years, 10 months ago) by dpavlin
File size: 554 byte(s)
extract creation of test unit into new Arh::Test
1 package Arh::Test;
2
3 use strict;
4 use warnings;
5
6
7 sub create_unit {
8
9 my $place = Arh::Model::Place->new;
10 $place->create(
11 name => 'mjesto iskapanja',
12 ) || die "can't create place";
13
14 my $campaign = Arh::Model::Campaign->new;
15 $campaign->create(
16 place => $place,
17 name => 'prvo iskapanje',
18 date_from => '2007-11-28',
19 date_to => '2008-03-15',
20 ) || die "can't create capaign";
21
22 my $unit = Arh::Model::Unit->new;
23 $unit->create(
24 name => 'test unit',
25 inv_id => 42,
26 campaign => $campaign,
27 ) || die "can't create unit";
28
29 return $unit;
30
31 }
32
33 1;

  ViewVC Help
Powered by ViewVC 1.1.26