Merge commit '4635b91554' into WebGUI8. Syntax clean up to 7.10.2

This commit is contained in:
Colin Kuskie 2010-10-27 15:59:33 -07:00
commit 87326192a3
46 changed files with 956 additions and 969 deletions

View file

@ -0,0 +1,67 @@
# vim:syntax=perl
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------
# Test the featured page of the Wiki
#
#
use FindBin;
use strict;
use lib "$FindBin::Bin/../../../lib";
use Test::More;
use Test::Deep;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
my $import = WebGUI::Asset->getImportNode( $session );
my $templateId = 'WIKIMASTER_TEMPLATE___';
my $templateMock = Test::MockObject->new({});
$templateMock->set_isa('WebGUI::Asset::Template');
$templateMock->set_always('getId', $templateId);
my $templateVars;
$templateMock->mock('process', sub { $templateVars = $_[1]; } );
my $wiki
= $import->addChild( {
className => 'WebGUI::Asset::Wobject::WikiMaster',
searchTemplateId => $templateId,
} );
WebGUI::Test->addToCleanup($wiki);
#----------------------------------------------------------------------------
# Tests
plan tests => 1; # Increment this number for each test you create
$session->request->setup_body({
query => 'Red&Andy',
});
{
WebGUI::Test->mockAssetId($templateId, $templateMock);
$wiki->www_search();
WebGUI::Test->unmockAssetId($templateId);
}
is $templateVars->{addPageUrl},
$wiki->getUrl('func=add;class=WebGUI::Asset::WikiPage;title=Red%26Andy'),
'search encodes unsafe characters in addPageUrl';
#----------------------------------------------------------------------------
#
#vim:ft=perl