rfe #12123: Layouts related for export purposes

This commit is contained in:
Paul Driver 2011-05-09 09:59:53 -05:00
parent 3e161b3ead
commit f1538824f7
3 changed files with 32 additions and 14 deletions

View file

@ -647,9 +647,18 @@ subtest exportRelated => sub {
});
$tag->commit();
my $cleanup = guard { $tag->rollback; if ($old) { $old->setWorking(); } };
cmp_deeply(
# This will include some folders, because of the way Archive works
my $expected = $archive->getLineage(['self', 'descendants']);
push @$expected, $topic->getId;
# getContainer should be included; since parent is a Layout, the
# upward-recursion will stop there.
push @$expected, $topic->getContainer->getId;
cmp_bag(
$archive->exportGetAssetIds({ depth => 99, exportRelated => 1}),
superbagof(map { $_->getId } ($topic, $archive, $story)),
$expected,
'exporting archive includes topic with exportRelated'
);
is(0, scalar grep { $_ eq $topic->getId }