line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Cmis::Test::ACE; |
2
|
1
|
|
|
1
|
|
609
|
use base qw(WebService::Cmis::Test); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
522
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use strict; |
5
|
|
|
|
|
|
|
use warnings; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Test::More; |
8
|
|
|
|
|
|
|
use Error qw(:try); |
9
|
|
|
|
|
|
|
use WebService::Cmis qw(:collections :utils :relations :namespaces :contenttypes); |
10
|
|
|
|
|
|
|
use WebService::Cmis::ACE; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub test_ACE_empty : Test(2) { |
13
|
|
|
|
|
|
|
my $this = shift; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $acl = new WebService::Cmis::ACE(); |
16
|
|
|
|
|
|
|
ok(defined $acl); |
17
|
|
|
|
|
|
|
isa_ok($acl, 'WebService::Cmis::ACE'); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub test_ACE_create : Test(8) { |
21
|
|
|
|
|
|
|
my $this = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $ace = new WebService::Cmis::ACE( |
24
|
|
|
|
|
|
|
principalId => 'jdoe', |
25
|
|
|
|
|
|
|
direct => 'true', |
26
|
|
|
|
|
|
|
permissions => 'cmis:write' |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
ok(defined $ace->{principalId}); |
30
|
|
|
|
|
|
|
is($ace->{principalId}, 'jdoe'); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
ok(defined $ace->{direct}); |
33
|
|
|
|
|
|
|
is($ace->{direct}, 'true'); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
ok(defined $ace->{permissions}); |
36
|
|
|
|
|
|
|
is(ref($ace->{permissions}), 'ARRAY'); |
37
|
|
|
|
|
|
|
is(scalar(@{$ace->{permissions}}), 1); |
38
|
|
|
|
|
|
|
is($ace->{permissions}[0], 'cmis:write'); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |