# Copyright (c) 2007 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: RealmCSSList.bunit,v 1.2 2009/05/07 17:23:39 dobbs Exp $ ListModel(); req()->initialize_fully; my($fourem) = unauth_model('RealmOwner', {name => 'fourem'})->get('realm_id'); my($site) = unauth_model('RealmOwner', {name => 'site'})->get('realm_id'); [ { method => 'load_all', compute_params => sub { my(undef, $params) = @_; req()->set_realm(shift(@$params)); req()->set_user(shift(@$params)); req()->initialize_fully(shift(@$params) || 'SHELL_UTIL'); my($browser) = shift(@$params); class('Type.UserAgent')->$browser->execute(req()) if $browser; return []; }, comparator => 'nested_contains', compute_return => sub { return shift->get('object')->map_rows; }, check_return => sub { my(undef, undef, $expect) = @_; return [map(+{ 'RealmFile.realm_id' => shift(@$_), 'RealmFile.path_lc' => shift(@$_), }, @$expect)]; }, } => [ [undef, undef] => [[$site, '/public/my.css']], [undef, 'root'] => [[$site, '/public/my.css']], [site => undef] => [[$site, '/public/my.css']], [qw(site demo)] => [[$site, '/public/my.css']], [qw(site root)] => [ [$site, '/public/my.css'], [$site, '/my.css'], ], [qw(site root HELP)] => [ [$site, '/public/my.css'], [$site, '/public/wiki/base.css'], [$site, '/my.css'], [$site, '/wiki/base.css'], ], [qw(site demo HELP)] => [ [$site, '/public/my.css'], [$site, '/public/wiki/base.css'], ], [fourem => undef, 'HELP'] => [ [$site, '/public/my.css'], [$fourem, '/public/my.css'], [$fourem, '/public/wiki/base.css'], ], [qw(fourem root HELP BROWSER_MSIE_5)] => [ [$site, '/public/my.css'], [$site, '/public/myie6.css'], [$fourem, '/public/my.css'], [$fourem, '/public/wiki/base.css'], [$fourem, '/my.css'], [$fourem, '/wiki/base.css'], ], ], ];