Merge commit 'v7.10.15' into 8
Conflicts: docs/gotcha.txt docs/previousVersion.sql docs/templates.txt lib/WebGUI.pm lib/WebGUI/Asset.pm lib/WebGUI/Asset/Event.pm lib/WebGUI/Asset/File.pm lib/WebGUI/Asset/MapPoint.pm lib/WebGUI/Asset/RichEdit.pm lib/WebGUI/Asset/Sku/Product.pm lib/WebGUI/Asset/Snippet.pm lib/WebGUI/Asset/Story.pm lib/WebGUI/Asset/Template.pm lib/WebGUI/Asset/Template/TemplateToolkit.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/Carousel.pm lib/WebGUI/Asset/Wobject/Collaboration.pm lib/WebGUI/Asset/Wobject/Dashboard.pm lib/WebGUI/Asset/Wobject/DataForm.pm lib/WebGUI/Asset/Wobject/Folder.pm lib/WebGUI/Asset/Wobject/Map.pm lib/WebGUI/Asset/Wobject/Search.pm lib/WebGUI/Asset/Wobject/Shelf.pm lib/WebGUI/Asset/Wobject/StockData.pm lib/WebGUI/Asset/Wobject/StoryTopic.pm lib/WebGUI/Asset/Wobject/SyndicatedContent.pm lib/WebGUI/Asset/Wobject/Thingy.pm lib/WebGUI/Asset/Wobject/WeatherData.pm lib/WebGUI/AssetClipboard.pm lib/WebGUI/AssetCollateral/DataForm/Entry.pm lib/WebGUI/AssetExportHtml.pm lib/WebGUI/AssetLineage.pm lib/WebGUI/AssetMetaData.pm lib/WebGUI/AssetTrash.pm lib/WebGUI/AssetVersioning.pm lib/WebGUI/Auth.pm lib/WebGUI/Cache/CHI.pm lib/WebGUI/Content/AssetManager.pm lib/WebGUI/Fork/ProgressBar.pm lib/WebGUI/Form/JsonTable.pm lib/WebGUI/Form/TimeField.pm lib/WebGUI/Form/Zipcode.pm lib/WebGUI/Group.pm lib/WebGUI/International.pm lib/WebGUI/Macro/AssetProxy.pm lib/WebGUI/Macro/FileUrl.pm lib/WebGUI/Operation/SSO.pm lib/WebGUI/Operation/User.pm lib/WebGUI/Role/Asset/Subscribable.pm lib/WebGUI/Shop/Cart.pm lib/WebGUI/Shop/Transaction.pm lib/WebGUI/Shop/TransactionItem.pm lib/WebGUI/Test.pm lib/WebGUI/URL/Content.pm lib/WebGUI/URL/Uploads.pm lib/WebGUI/User.pm lib/WebGUI/Workflow/Activity/ExtendCalendarRecurrences.pm lib/WebGUI/Workflow/Activity/SendNewsletters.pm lib/WebGUI/i18n/English/Asset.pm lib/WebGUI/i18n/English/WebGUI.pm sbin/installClass.pl sbin/rebuildLineage.pl sbin/search.pl sbin/testEnvironment.pl t/Asset/Asset.t t/Asset/AssetClipboard.t t/Asset/AssetLineage.t t/Asset/AssetMetaData.t t/Asset/Event.t t/Asset/File.t t/Asset/File/Image.t t/Asset/Post/notification.t t/Asset/Sku.t t/Asset/Story.t t/Asset/Template.t t/Asset/Wobject/Collaboration/templateVariables.t t/Asset/Wobject/Collaboration/unarchiveAll.t t/Asset/Wobject/Shelf.t t/Auth.t t/Macro/EditableToggle.t t/Macro/FilePump.t t/Shop/Cart.t t/Shop/Transaction.t t/Storage.t t/User.t t/Workflow.t
This commit is contained in:
commit
277faae8a1
783 changed files with 32041 additions and 25495 deletions
|
|
@ -11,13 +11,16 @@
|
|||
use strict;
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset::Event;
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
|
||||
plan tests => 30;
|
||||
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset::Event;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
|
|
@ -148,13 +151,98 @@ is ($event7->get('startDate'), '2000-09-01', 'startDate bumped by 1 day');
|
|||
is ($event7->get('endTime'), '00:00:00', 'endTime set to 00:00:00 if the hour is more than 23');
|
||||
is ($event7->get('endDate'), '2000-09-02', 'endDate bumped by 1 day');
|
||||
|
||||
#############################################################################
|
||||
# Valid dates
|
||||
$session->request->setup_body({ startDate => '0000-00-01', endDate => '1000-00-01' });
|
||||
my $event = $cal->addChild({ className => 'WebGUI::Asset::Event' }, undef, time()+10);
|
||||
my $output = $event->processEditForm;
|
||||
is( ref $output, 'ARRAY', 'returns error array' );
|
||||
is( scalar @$output, 2, 'has two errors' );
|
||||
|
||||
#######################################
|
||||
#
|
||||
# setRelatedLinks, getRelatedLinks
|
||||
#
|
||||
#######################################
|
||||
$event6->setRelatedLinks([
|
||||
{
|
||||
new_event => 1,
|
||||
sequenceNumber => 1,
|
||||
linkurl => 'http://www.nowhere.com',
|
||||
linktext => 'Great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => '27',
|
||||
},
|
||||
{
|
||||
new_event => 1,
|
||||
sequenceNumber => 2,
|
||||
linkurl => 'http://www.somewhere.com',
|
||||
linktext => 'Another great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => '28',
|
||||
},
|
||||
]);
|
||||
cmp_deeply(
|
||||
$event6->getRelatedLinks(),
|
||||
[{
|
||||
sequenceNumber => 1,
|
||||
linkURL => 'http://www.nowhere.com',
|
||||
linktext => 'Great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => '27',
|
||||
assetId => $event6->getId,
|
||||
},
|
||||
{
|
||||
sequenceNumber => 2,
|
||||
linkURL => 'http://www.somewhere.com',
|
||||
linktext => 'Another great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => '28',
|
||||
assetId => $event6->getId,
|
||||
}],
|
||||
'related links stored in the database correctly'
|
||||
);
|
||||
|
||||
#######################################
|
||||
#
|
||||
# duplicate
|
||||
#
|
||||
#######################################
|
||||
|
||||
|
||||
my $event6b = $event6->duplicate();
|
||||
ok($session->id->valid($event6b->get('storageId')), 'duplicated event got a valid storageId');
|
||||
isnt($event6b->get('storageId'), $event6->get('storageId'), 'duplicating an asset creates a new storage location');
|
||||
done_testing;
|
||||
cmp_deeply(
|
||||
$event6b->getRelatedLinks(),
|
||||
[{
|
||||
sequenceNumber => 1,
|
||||
linkURL => 'http://www.nowhere.com',
|
||||
linktext => 'Great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => ignore(),
|
||||
assetId => $event6b->getId,
|
||||
},
|
||||
{
|
||||
sequenceNumber => 2,
|
||||
linkURL => 'http://www.somewhere.com',
|
||||
linktext => 'Another great link',
|
||||
groupIdView => '7',
|
||||
eventlinkId => ignore(),
|
||||
assetId => $event6b->getId,
|
||||
}],
|
||||
'duplicated event has relatedLinks'
|
||||
);
|
||||
|
||||
#######################################
|
||||
#
|
||||
# purge
|
||||
#
|
||||
#######################################
|
||||
{
|
||||
my $storage = $event6b->getStorageLocation;
|
||||
my $assetId = $event6b->getId;
|
||||
$event6b->purge;
|
||||
my $count = $session->db->quickScalar('select count(*) from Event_relatedlink where assetId=?',[$assetId]);
|
||||
is $count, 0, 'purge: related links cleaned up in the database';
|
||||
ok ! -d $storage->getPath(), '... storage location removed, too';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue