fix merge problems

This commit is contained in:
Doug Bell 2010-07-12 15:52:38 -05:00
parent babfa74209
commit 29b1f794cd
14 changed files with 174 additions and 357 deletions

View file

@ -150,29 +150,7 @@ $canViewMaker->prepare(
},
);
#### TestAsset class to test definition / update relationship
BEGIN { $INC{ 'WebGUI/Asset/TestAsset.pm' } = __FILE__ }
package WebGUI::Asset::TestAsset;
our @ISA = ( 'WebGUI::Asset' );
sub definition {
my ( $class, $session, $definition ) = @_;
# Alter assetData fields for testing purposes. Do not do
# this in normal circumstances. Ever.
$definition = $class->SUPER::definition( $session, $definition );
# Make synopsis serialized
$definition->[0]->{properties}->{synopsis}->{serialize} = 1;
return $definition;
}
package main;
plan tests => 132
+ scalar(@fixIdTests)
+ scalar(@fixTitleTests)
plan tests => 121
+ 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle
;
@ -323,40 +301,6 @@ isa_ok($tempNode, 'WebGUI::Asset::Wobject::Folder');
is($tempNode->getId, 'tempspace0000000000000', 'Tempspace Asset ID check');
is($tempNode->getParent->getId, $rootAsset->getId, 'Tempspace parent is Root Asset');
################################################################
#
# update
#
################################################################
# Create a new TestAsset instance
my $ta = $importNode->addChild( {
className => 'WebGUI::Asset::TestAsset',
} );
isa_ok( $ta, 'WebGUI::Asset::TestAsset', 'addChild returns correct object' );
ok(
eval { $ta->update({ synopsis => [ "one", "two" ] }); 1; },
'update() succeeds with ref on serialized property',
);
cmp_deeply(
$ta->get('synopsis'),
[ "one", "two" ],
"serialized property returns deserialized ref",
);
ok(
eval { $ta->update({ synopsis => '[ "two", "three" ]', }); 1; },
'update() succeeds with serialized string on serialized property',
);
cmp_deeply(
$ta->get('synopsis'),
[ "two", "three" ],
"serialized property returns deserialized ref",
);
$ta->purge;
################################################################
#
# urlExists

View file

@ -17,7 +17,7 @@ use WebGUI::Session;
use WebGUI::User;
use WebGUI::Asset;
use Test::More tests => 96; # increment this value for each test you create
use Test::More tests => 107; # increment this value for each test you create
use Test::Deep;
use Test::Exception;
use Data::Dumper;