# Copyright (c) 2009 bivio Software Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: RealmFileVersionsList.bunit,v 1.2 2009/11/04 21:36:37 aviggio Exp $ ListModel(); req()->set_realm_and_user('realmfileversionslist_bunit', 'root'); model('RealmFile')->delete_all; map( { my($path) = @$_; map(+{ path => model('RealmFile')->create_or_update_with_content( {path => b_use("Type.FilePath")->to_absolute($path, $_)}, \("Lorem ipsum\n"), )->get('path'), }, 1 .. 3), } ['test.txt'], ['test.doc'], ); options({ compute_params => sub { my(undef, $params) = @_; req()->put(path_info => $params->[0]); return []; }, }); [ load_all => [ [] => undef, ['/Public'] => undef, ['/Public/test.txt'] => [ { 'RealmFile.path_lc' => qr{test\.txt$}, revision_number => 'current', }, { 'RealmFile.path_lc' => qr{;2\.txt$}, revision_number => 2, }, { 'RealmFile.path_lc' => qr{;1\.txt$}, revision_number => 1, }, ], ['/Public/test.doc'] => [ {'RealmFile.path_lc' => qr{test\.doc$}}, {'RealmFile.path_lc' => qr{;2\.doc$}}, {'RealmFile.path_lc' => qr{;1\.doc$}}, ], ], ];