Merge commit '41575d24bb' into webgui8. Some tests still failing.

Conflicts:
	docs/gotcha.txt
	lib/WebGUI.pm
	lib/WebGUI/Asset.pm
	lib/WebGUI/Asset/File/GalleryFile/Photo.pm
	lib/WebGUI/Asset/Post.pm
	lib/WebGUI/Asset/Template.pm
	lib/WebGUI/Asset/WikiPage.pm
	lib/WebGUI/Asset/Wobject/WikiMaster.pm
	lib/WebGUI/Cache.pm
	lib/WebGUI/Content/Setup.pm
	lib/WebGUI/Role/Asset/Subscribable.pm
	lib/WebGUI/Shop/Cart.pm
	lib/WebGUI/Shop/Pay.pm
	lib/WebGUI/Shop/PayDriver/ITransact.pm
	sbin/testEnvironment.pl
	t/Asset/WikiPage.t
	t/Shop/PayDriver.t
	t/Shop/PayDriver/ITransact.t
	t/Shop/PayDriver/Ogone.t
	t/Shop/TaxDriver/EU.t
	t/Shop/TaxDriver/Generic.t
	t/Workflow/Activity/RemoveOldCarts.t
	t/lib/WebGUI/Test.pm
This commit is contained in:
Colin Kuskie 2010-06-25 23:25:26 -07:00
commit 5febc0ebbc
258 changed files with 5528 additions and 2230 deletions

View file

@ -23,6 +23,7 @@ use WebGUI::Session;
use WebGUI::Shop::Cart;
use WebGUI::Shop::Ship;
use WebGUI::Shop::Transaction;
use WebGUI::Shop::PayDriver::ITransact;
use JSON;
use HTML::Form;
use WebGUI::Shop::PayDriver::ITransact;
@ -30,6 +31,7 @@ use WebGUI::Shop::PayDriver::ITransact;
#----------------------------------------------------------------------------
# Init
my $session = WebGUI::Test->session;
$session->user({userId => 3});
#----------------------------------------------------------------------------
@ -41,6 +43,25 @@ plan tests => 28;
# figure out if the test can actually run
my $e;
my $ship = WebGUI::Shop::Ship->new($session);
my $cart = WebGUI::Shop::Cart->newBySession($session);
WebGUI::Test->addToCleanup($cart);
my $shipper = $ship->getShipper('defaultfreeshipping000');
my $address = $cart->getAddressBook->addAddress( {
label => 'red',
firstName => 'Ellis Boyd', lastName => 'Redding',
address1 => 'cell block #5',
city => 'Shawshank', state => 'MN',
code => '55555', country => 'United States of America',
phoneNumber => '555.555.5555', email => 'red@shawshank.gov',
} );
$cart->update({
billingAddressId => $address->getId,
shippingAddressId => $address->getId,
shipperId => $shipper->getId,
});
my $transaction;
my $versionTag = WebGUI::VersionTag->getWorking($session);
my $home = WebGUI::Asset->getDefault($session);
@ -82,9 +103,6 @@ $cart->update({
shipperId => $shipper->getId,
});
my $hammerItem = $rockHammer->addToCart($rockHammer->getCollateral('variantsJSON', 'variantId', $smallHammer));
#######################################################################
#
# definition
@ -254,21 +272,8 @@ $driver->{_cardData} = {
cvv2 => '1234',
};
$driver->{_billingAddress} = {
firstName => 'Ellis Boyd',
lastName => 'Redding',
address1 => '#2 Row 30265',
city => 'Shawshank',
state => 'Maine',
code => '97025',
country => 'USA',
phoneNumber => '555.555.5555',
email => '30265@shawshank.gov',
};
my $transaction = WebGUI::Shop::Transaction->create($session, {
paymentMethod => $driver,
$cart->update({gatewayId => $driver->getId,});
$transaction = WebGUI::Shop::Transaction->create($session, {
cart => $cart,
isRecurring => $cart->requiresRecurringPayment,
});

View file

@ -22,6 +22,7 @@ use WebGUI::Test; # Must use this before any other WebGUI modules
use WebGUI::Session;
use JSON;
use HTML::Form;
use WebGUI::Shop::PayDriver::Ogone;
#----------------------------------------------------------------------------
# Init
@ -31,21 +32,13 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 45;
plan tests => 1 + $tests;
plan tests => 45;
#----------------------------------------------------------------------------
# figure out if the test can actually run
my $e;
note('Testing existence');
my $loaded = use_ok('WebGUI::Shop::PayDriver::Ogone');
SKIP: {
skip 'Unable to load module WebGUI::Shop::PayDriver::Ogone', $tests unless $loaded;
#######################################################################
#
# definition
@ -110,6 +103,13 @@ my $expectDefinition = {
hoverHelp => ignore(),
defaultValue => 1,
},
summaryTemplateId => {
fieldType => 'template',
label => ignore(),
hoverHelp => ignore(),
defaultValue => ignore(),
namespace => 'Shop/Credentials',
},
},
};
@ -355,6 +355,7 @@ isnt(
my $cart = $driver->getCart;
WebGUI::Test->addToCleanup($cart);
isa_ok ($cart, 'WebGUI::Shop::Cart', 'getCart returns an instantiated WebGUI::Shop::Cart object');
WebGUI::Test->addToCleanup($cart);
#######################################################################
#
@ -373,7 +374,7 @@ my @forms = HTML::Form->parse($html, 'http://www.webgui.org');
is (scalar @forms, 1, 'getEditForm generates just 1 form');
my @inputs = $forms[0]->inputs;
is (scalar @inputs, 17, 'getEditForm: the form has 17 controls');
is (scalar @inputs, 18, 'getEditForm: the form has 18 controls');
my @interestingFeatures;
foreach my $input (@inputs) {
@ -453,6 +454,10 @@ cmp_deeply(
name => 'useTestMode',
type => 'radio',
},
{
name => 'summaryTemplateId',
type => 'option',
},
],
'getEditForm made the correct form with all the elements'
@ -577,5 +582,4 @@ is ($count, 0, 'delete deleted the object');
undef $driver;
}
#vim:ft=perl