Add fixUrl tests for duplicate assets and generated urls.
This commit is contained in:
parent
8e52096a0a
commit
58dd3e075a
1 changed files with 13 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ use WebGUI::Asset::Wobject::Folder;
|
|||
use WebGUI::AssetVersioning;
|
||||
use WebGUI::VersionTag;
|
||||
|
||||
use Test::More tests => 47; # increment this value for each test you create
|
||||
use Test::More tests => 48; # increment this value for each test you create
|
||||
use Test::MockObject;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
|
@ -42,24 +42,31 @@ my $properties = {
|
|||
|
||||
my $fixUrlAsset = $defaultAsset->addChild($properties, $properties->{id});
|
||||
|
||||
# '1234567890123456789012'
|
||||
# '1234567890123456789012'
|
||||
$properties->{id} = 'fixUrlAsset00000000013';
|
||||
$properties->{url} = 'fixUrlFolderURL9';
|
||||
|
||||
my $fixUrlAsset2 = $defaultAsset->addChild($properties, $properties->{id});
|
||||
|
||||
# '1234567890123456789012'
|
||||
# '1234567890123456789012'
|
||||
$properties->{id} = 'fixUrlAsset00000000014';
|
||||
$properties->{url} = 'fixUrlFolderURL00';
|
||||
|
||||
my $fixUrlAsset3 = $defaultAsset->addChild($properties, $properties->{id});
|
||||
|
||||
# '1234567890123456789012'
|
||||
# '1234567890123456789012'
|
||||
$properties->{id} = 'fixUrlAsset00000000015';
|
||||
$properties->{url} = 'fixUrlFolderURL100';
|
||||
|
||||
my $fixUrlAsset4 = $defaultAsset->addChild($properties, $properties->{id});
|
||||
|
||||
delete $properties->{url};
|
||||
# '1234567890123456789012'
|
||||
$properties->{id} = 'fixUrlAsset00000000016';
|
||||
$properties->{menuTitle} = 'fix url folder url autogenerated';
|
||||
|
||||
my $fixUrlAsset5 = $defaultAsset->addChild($properties, $properties->{id});
|
||||
|
||||
$versionTag->commit;
|
||||
|
||||
# Test the new constructor
|
||||
|
|
@ -225,6 +232,8 @@ is($importNode->fixUrl('fixUrlFolderURL9'), 'fixurlfolderurl10', 'increments
|
|||
is($importNode->fixUrl('fixUrlFolderURL00'), 'fixurlfolderurl01', 'initial zeroes preserved 00 -> 01');
|
||||
is($importNode->fixUrl('fixUrlFolderURL100'), 'fixurlfolderurl101', '100->101');
|
||||
|
||||
is($fixUrlAsset5->fixUrl(), 'home/fix-url-folder-url-autogenerated', 'fixUrl will autogenerate a url if not provided one');
|
||||
|
||||
$session->setting->set('urlExtension', 'html');
|
||||
|
||||
END: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue