12 |
|
# new() : A new DocTester object |
13 |
|
# initdoc([docstore]) : initialise starter doc etc. |
14 |
|
# --- after initdoc can call |
15 |
< |
# newdoc(url) : create a new document with the given url |
15 |
> |
# newtestdoc(url) : create a new document with the given url |
16 |
|
# docstore() : return the base document store |
17 |
|
|
18 |
|
package ActiveDoc::DocTester; |
25 |
|
|
26 |
|
sub initdoc { |
27 |
|
my $self=shift; |
28 |
– |
# make a new tmp store |
28 |
|
if ( @_ ) { |
29 |
< |
$self->{docstore}=shift; |
29 |
> |
$self->{docstore}=shift; |
30 |
|
} |
31 |
< |
else { |
33 |
< |
$self->{storedir}=$self->temparea()."/DocTester"; |
34 |
< |
$self->{docstore}=ActiveDoc::ActiveConfig->new($self->{storedir}); |
35 |
< |
} |
36 |
< |
$self->{appl}=ActiveDoc::Application->new($self->{docstore}); |
37 |
< |
$self->{appl}->options(ActiveDoc::Query->new()); |
31 |
> |
$self->appl(); |
32 |
|
} |
33 |
|
|
34 |
< |
sub newdoc { |
34 |
> |
sub newtestdoc { |
35 |
|
my $self=shift; |
36 |
|
$self->{object}=$self->{appl}->activatedoc(@_); |
37 |
+ |
$self->{inttest}{"new"}++; |
38 |
+ |
} |
39 |
+ |
|
40 |
+ |
sub docstore { |
41 |
+ |
my $self=shift; |
42 |
+ |
if ( ! defined $self->{docstore} ) { |
43 |
+ |
$self->{storedir}=$self->temparea()."/DocTester/".$self->newfilename(); |
44 |
+ |
$self->{docstore}=ActiveDoc::ActiveConfig->new($self->{storedir}); |
45 |
+ |
} |
46 |
+ |
return $self->{docstore}; |
47 |
+ |
} |
48 |
+ |
|
49 |
+ |
sub appl { |
50 |
+ |
my $self=shift; |
51 |
+ |
if ( ! defined $self->{appl} ) { |
52 |
+ |
my $doc=$self->docstore(); |
53 |
+ |
$self->{appl}=ActiveDoc::Application->new($doc); |
54 |
+ |
|
55 |
+ |
} |
56 |
+ |
return $self->{appl}; |
57 |
|
} |
58 |
|
|
59 |
|
sub options { |
60 |
|
my $self=shift; |
61 |
< |
$self->{appl}->options(@_); |
61 |
> |
$self->appl()->options(@_); |
62 |
|
} |
63 |
|
|
64 |
< |
sub userinterface { |
64 |
> |
sub setoptions { |
65 |
|
my $self=shift; |
66 |
< |
$self->{appl}->userinterface(@_); |
66 |
> |
$self->appl()->setoptions(@_); |
67 |
|
} |
68 |
|
|
69 |
< |
sub docstore { |
69 |
> |
sub userinterface { |
70 |
|
my $self=shift; |
71 |
< |
$self->{docstore}; |
71 |
> |
$self->{appl}->userinterface(@_); |
72 |
|
} |