# Copyright (c) 2006-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: WikiForm.bunit,v 1.11 2010/04/03 17:22:21 nagler Exp $ my($path_info); FormModel({ setup_request => sub { req()->put(path_info => $path_info); return; }, }); my($path) = sub { my($p) = @_; return ( sub { req()->commit; req()->set_realm_and_user('guest', 'guest'); $path_info = $p; return 1; } => 1, ); }; req()->set_realm_and_user('guest', 'guest'); Bivio::Biz::Model->new('RealmFile')->unauth_delete_deep({ path => '/Wiki', }); [ $path->(), empty_case({ 'RealmFile.path_lc' => undef, content => undef, file_exists => 0, }), [{ 'RealmFile.path_lc' => 'BunitOne', content => 'b1', }] => [{ 'Model.RealmFile' => { path => '/Wiki/BunitOne', }, }], $path->('/BunitX.txt'), [{ 'RealmFile.path_lc' => 'BunitX.txt', }] => Bivio::DieCode->NOT_FOUND, $path->('/BunitOne'), empty_case({ 'RealmFile.path_lc' => 'BunitOne', content => "b1\n", file_exists => 1, }), $path->(), error_case({ 'RealmFile.path_lc' => 'BunitOne', content => "b1\n", }, { 'RealmFile.path_lc' => 'EXISTS', }), $path->('/BunitTwo'), empty_case({ 'RealmFile.path_lc' => 'BunitTwo', content => undef, file_exists => 0, }), [{ 'RealmFile.path_lc' => 'BunitTwo', content => "b2\n", }] => [{ 'Model.RealmFile' => { path => '/Wiki/BunitTwo', }, }], [{ 'RealmFile.path_lc' => 'BunitTwo', 'RealmFile.is_public' => 1, content => 'b2', }] => [{ 'Model.RealmFile' => { path => '/Public/Wiki/BunitTwo', }, }], [{ 'RealmFile.path_lc' => 'Bunit/Three', 'RealmFile.is_public' => 1, content => 'b3', }] => [{ 'Model.RealmFile' => { path => '/Public/Wiki/Bunit/Three', }, }], ];