aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2005-10-19 10:10:24 +0000
committerdakkar <dakkar@luxion>2005-10-19 10:10:24 +0000
commitd1cee65858943465d74738fbea11ea7e96c7b786 (patch)
tree948fd41b38b5932d439e3db69ecfaf7f9dd0016b /t
parentaggiunto il supporto per i nomi delle collezioni (diff)
downloadWebCoso-d1cee65858943465d74738fbea11ea7e96c7b786.tar.gz
WebCoso-d1cee65858943465d74738fbea11ea7e96c7b786.tar.bz2
WebCoso-d1cee65858943465d74738fbea11ea7e96c7b786.zip
aggiunto supporto per parent/child tra collezioni
git-svn-id: svn://luxion/repos/WebCoso/trunk@6 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 't')
-rw-r--r--t/01-config.t36
1 files changed, 35 insertions, 1 deletions
diff --git a/t/01-config.t b/t/01-config.t
index c10dad6..4393eef 100644
--- a/t/01-config.t
+++ b/t/01-config.t
@@ -100,6 +100,19 @@ is_deeply(
$props,
{name=>'coll1'},
'solo il nome');
+
+is_deeply(
+ [$collections[0]->get_parents()],
+ [],
+ 'no parents');
+is_deeply(
+ [$collections[0]->get_children()],
+ [],
+ 'no children');
+is_deeply(
+ [$collections[0]->get_resources()],
+ [],
+ 'no resources');
}
WebCoso::Config->clear();
@@ -107,7 +120,7 @@ WebCoso::Config->clear();
{
my $conf_file=<<'EOF';
my $c1=coll({it=>'coll1',en=>'coll1-en'});
-coll('coll2',[$c1]);
+coll('coll2',[],[$c1]);
EOF
ok(WebCoso::Config->read_scalar($conf_file,"$thisdir/config-in-test"),
@@ -116,6 +129,9 @@ ok(WebCoso::Config->read_scalar($conf_file,"$thisdir/config-in-test"),
my @collections=WebCoso::Config->get_all_collections();
is(scalar @collections,2,'due collezioni');
+# qui sto assumendo che le collezioni vengano registrate in ordine di
+# definizione. Forse non sarĂ  sempre vero
+
is_deeply(
[sort $collections[0]->axis('language')],
['en', 'it'],
@@ -128,4 +144,22 @@ is(
$collections[0]->properties(language=>'it')->{name},
'coll1',
'nome it');
+
+is_deeply(
+ [$collections[0]->get_parents()],
+ [$collections[1]],
+ 'c2 padre di c1');
+is_deeply(
+ [$collections[0]->get_children()],
+ [],
+ 'c1 no children');
+is_deeply(
+ [$collections[1]->get_parents()],
+ [],
+ 'c2 no parents');
+is_deeply(
+ [$collections[1]->get_children()],
+ [$collections[0]],
+ 'c1 figlio di c2');
+
}