Clone stopped working in several tests in 5.14.2. Remove it in favor of Storable::dclone.

Clone handles being passed scalar data, but dclone does not.
This commit is contained in:
Colin Kuskie 2012-10-23 10:00:53 -07:00
parent 1b4f7c33fa
commit be37f12ab1
23 changed files with 70 additions and 49 deletions

View file

@ -89,7 +89,7 @@ ok( !$posts->[0]->{'user.isVisitor'}, 'first post made by visitor');
ok( $posts->[0]->{'hideProfileUrl'}, 'hide profile url, and user is visitor');
ok( !$posts->[0]->{'lastReply.user.isVisitor'}, 'lastReply not made by visitor');
ok( $posts->[0]->{'lastReply.hideProfileUrl'}, 'lastReply hide profile url, since user is visitor');
is( $posts->[0]->{'lastReply.url'}, $threads[1]->getUrl.'?pn=1#id'.$threads[1]->getId, 'lastReply url has a query fragment prefixed by "id"');
is( $posts->[0]->{'lastReply.url'}, $threads[1]->getUrl.'#id'.$threads[1]->getId, 'lastReply url has a query fragment prefixed by "id"');
is( $posts->[0]->{'url'}, $threads[1]->getUrl.'#id'.$threads[1]->getId, 'url has a query fragment prefixed by "id"');

View file

@ -13,7 +13,7 @@ use Data::Dumper;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
use JSON;
use Clone qw/clone/;
use Storable qw/dclone/;
#----------------------------------------------------------------------------
# Init
@ -2112,13 +2112,13 @@ sub buildSectionSkeleton {
my $sections = [];
my ($bareSection, $bareQuestion, $bareAnswer) = getBareSkeletons();
foreach my $questionSpec ( @{ $spec } ) {
my $section = clone $bareSection;
my $section = dclone $bareSection;
push @{ $sections }, $section;
foreach my $answers ( @{$questionSpec} ) {
my $question = clone $bareQuestion;
my $question = dclone $bareQuestion;
push @{ $section->{questions} }, $question;
while ($answers-- > 0) {
my $answer = clone $bareAnswer;
my $answer = dclone $bareAnswer;
push @{ $question->{answers} }, $answer;
}
}

View file

@ -13,7 +13,6 @@ use Data::Dumper;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
use JSON;
use Clone qw/clone/;
#----------------------------------------------------------------------------
# Init

View file

@ -9,7 +9,7 @@ use lib "$FindBin::Bin/../../../lib";
use Test::More;
use Test::Deep;
use Data::Dumper;
use Clone qw/clone/;
use Storable qw/dclone/;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
WebGUI::Error->Trace(1); # Turn on tracing of uncaught Exception::Class exceptions
@ -52,7 +52,7 @@ ok exists $asset_data->{question_types}->{toes}, 'the toes type in a question ty
explain $asset_data;
ok !exists $asset_data->{question_types}->{name}, 'name question not in question types';
$asset_data->{question_types}->{fingers} = clone $asset_data->{question_types}->{toes};
$asset_data->{question_types}->{fingers} = $asset_data->{question_types}->{toes};
$survey->importAssetCollateralData($asset_data);

View file

@ -19,7 +19,7 @@ use strict;
use lib "$FindBin::Bin/../../lib";
use Test::More;
use Test::Deep;
use Clone qw/clone/;
use Storable qw/dclone/;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
@ -64,7 +64,7 @@ my $templateMock = Test::MockObject->new({});
$templateMock->set_isa('WebGUI::Asset::Template');
$templateMock->set_always('getId', $templateId);
my $templateVars;
$templateMock->mock('process', sub { $templateVars = clone $_[1]; } );
$templateMock->mock('process', sub { $templateVars = dclone $_[1]; } );
my $asset = $node->addChild( {
className => 'WebGUI::Asset::Wobject::WeatherData',