# 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: WikiValidator.bunit,v 1.8 2011/11/05 23:41:52 nagler Exp $ config({ 'Bivio::Agent::Request' => { can_secure => 1, }, }); Request(); req()->set_realm('site'); req()->initialize_fully('FORUM_WIKI_VIEW'); [ class() => [ { method => 'validate_realm', compute_return => sub { my(undef, $actual) = @_; return $actual->[0]->get('errors') || []; }, } => [ [req()] => [ { entity => undef, message => qr{not a valid wiki}i, path => '/Public/Wiki/base.css', }, map(+{ path => '/Public/Wiki/WikiValidator_NOT_OK', message => 'Not found', line_num => $_->[0], entity => $_->[1], }, [2, '/site/bp/not-found.gif'], [3, '/site/bp/Not_Found'], [4, '/site/blog-entry/19990909090909'], #TODO: Test external links # [5, '^http://petshop.bivio.biz/not-found'], ), { entity => '/site/bp/NotFoundLabel', message => 'Not found', path => '/Public/WikiData/NOT_OK.bmenu', line_num => 2, }, { entity => '/site/bp/NotFoundLink', message => 'Not found', path => '/Public/WikiData/NOT_OK.bmenu', line_num => 3, }, { entity => undef, message => qr{not a valid wiki}i, path => '/Wiki/base.css', }, { entity => undef, message => qr{same name}i, path => '/Wiki/index', }, { entity => '/site/bp/NoSuchWiki', message => 'Not found', line_num => 2, path => '/Blog/200905/25123456', }, ], ], ], ];