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:
Doug Bell 2011-05-13 18:15:11 -05:00
commit 277faae8a1
783 changed files with 32041 additions and 25495 deletions

View file

@ -16,6 +16,7 @@
use strict;
use Test::More;
use Test::Deep;
use Test::LongString;
use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Test::MockAsset;
use WebGUI::Session;
@ -31,7 +32,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
plan tests => 77; # Increment this number for each test you create
plan tests => 83; # Increment this number for each test you create
#----------------------------------------------------------------------------
# put your tests here
@ -39,6 +40,7 @@ plan tests => 77; # Increment this number for each test you create
my $transaction = WebGUI::Shop::Transaction->new($session,{
amount => 40,
shippingAddressId => 'xxx1',
shippingOrganization => 'Ship To Us',
shippingAddressName => 'abc',
shippingAddress1 => 'def',
shippingAddress2 => 'hij',
@ -53,6 +55,7 @@ my $transaction = WebGUI::Shop::Transaction->new($session,{
shippingPrice => 5,
paymentAddressId => 'xxx3',
paymentAddressName => 'abc1',
paymentOrganization => 'Pay To Us',
paymentAddress1 => 'def1',
paymentAddress2 => 'hij1',
paymentAddress3 => 'lmn1',
@ -76,6 +79,7 @@ isa_ok($transaction->session, "WebGUI::Session");
is($transaction->amount, 40, "set and get amount");
is($transaction->shippingAddressId, 'xxx1', "set and get shipping address id");
is($transaction->shippingAddressName, 'abc', "set and get shipping address name");
is($transaction->shippingOrganization, 'Ship To Us', "set and get shipping organization");
is($transaction->shippingAddress1, 'def', "set and get shipping address 1");
is($transaction->shippingAddress2, 'hij', "set and get shipping address 2");
is($transaction->shippingAddress3, 'lmn', "set and get shipping address 3");
@ -89,6 +93,7 @@ is($transaction->shippingDriverLabel, 'foo', "set and get shipping driver label"
is($transaction->shippingPrice, 5, "set and get shipping price");
is($transaction->paymentAddressId, 'xxx3', "set and get payment address id");
is($transaction->paymentAddressName, 'abc1', "set and get payment address name");
is($transaction->paymentOrganization, 'Pay To Us', "set and get payment organization");
is($transaction->paymentAddress1, 'def1', "set and get payment address 1");
is($transaction->paymentAddress2, 'hij1', "set and get payment address 2");
is($transaction->paymentAddress3, 'lmn1', "set and get payment address 3");
@ -101,7 +106,6 @@ is($transaction->paymentDriverId, 'xxx4', "set and get payment driver id");
is($transaction->paymentDriverLabel, 'kkk', "set and get payment driver label");
is($transaction->taxes, 7, "set and get taxes");
$transaction->update({
isSuccessful => 1,
transactionCode => 'yyy',
@ -109,11 +113,11 @@ $transaction->update({
statusMessage => 'was a success',
});
is($transaction->get("isSuccessful"), 1,"update and get isSuccessful");
is($transaction->get("transactionCode"), 'yyy',"update and get transaction code");
is($transaction->get("statusCode"), 'jd31',"update and get status code");
is($transaction->get("statusMessage"), 'was a success',"update and get status message");
is($transaction->get('taxes'), 7, 'update does not modify things it was not sent');
is($transaction->isSuccessful, 1,"update and get isSuccessful");
is($transaction->transactionCode, 'yyy',"update and get transaction code");
is($transaction->statusCode, 'jd31',"update and get status code");
is($transaction->statusMessage, 'was a success',"update and get status message");
is($transaction->taxes, 7, 'update does not modify things it was not sent');
# make sure new() works
my $tcopy = WebGUI::Shop::Transaction->new($session, $transaction->getId);
@ -127,6 +131,7 @@ my $item = $transaction->addItem({
assetId => 'a',
configuredTitle => 'b',
options => {color=>'blue'},
shippingOrganization => 'organized',
shippingAddressId => 'c',
shippingName => 'd',
shippingAddress1 => 'e',
@ -161,6 +166,7 @@ is($item->get("shippingPhoneNumber"), 'l', "set and get shipping phone number");
is($item->get("quantity"), 5, "set and get quantity");
is($item->get("price"), 33, "set and get price");
is($item->get('taxRate'), 19, 'set and get taxRate' );
is($item->shippingOrganization, 'organized', 'set and get shipping organization' );
$item->update({
shippingTrackingNumber => 'adfs',
@ -279,6 +285,50 @@ $session->setting->set('shopReceiptEmailTemplateId', $templateId);
like($templateVars[1]->{viewDetailUrl}, qr/shop=transaction;method=view;/ , '... viewDetailUrl okay for admin');
}
#######################################################################
#
# formatAddress
#
#######################################################################
my $formattedAddress = $transaction->formatAddress({
name => 'Red',
address1 => 'Cell Block #5',
city => 'Shawshank',
state => 'MN',
code => 55555,
country => 'USA',
phoneNumber => '555.555.5555',
});
is_string $formattedAddress, 'Red<br />Cell Block #5<br />Shawshank, MN 55555<br />USA<br />555.555.5555', 'formatAddress: a regular address';
my $formattedAddress = $transaction->formatAddress({
name => 'Red',
address1 => 'Cell Block #5',
address2 => 'Next to Andy',
city => 'Shawshank',
state => 'MN',
code => 55555,
country => 'USA',
phoneNumber => '555.555.5555',
});
is_string $formattedAddress, 'Red<br />Cell Block #5<br />Next to Andy<br />Shawshank, MN 55555<br />USA<br />555.555.5555', '... a regular address with address2';
my $formattedAddress = $transaction->formatAddress({
name => 'Red',
organization => 'Shawshank Prison',
address1 => 'Cell Block #5',
city => 'Shawshank',
state => 'MN',
code => 55555,
country => 'USA',
phoneNumber => '555.555.5555',
});
is_string $formattedAddress, 'Red<br />Shawshank Prison<br />Cell Block #5<br />Shawshank, MN 55555<br />USA<br />555.555.5555', '... a regular address with address2';
#######################################################################
#
# delete